@jant/core 0.3.45 → 0.3.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/bin/commands/db/execute-file.js +12 -4
  2. package/bin/commands/db/rehearse.js +2 -2
  3. package/bin/commands/export.js +12 -4
  4. package/bin/commands/import-site.js +99 -305
  5. package/bin/commands/migrate.js +36 -69
  6. package/bin/commands/reset-password.js +10 -4
  7. package/bin/commands/site/export.js +59 -248
  8. package/bin/commands/site/snapshot/export.js +58 -45
  9. package/bin/commands/site/snapshot/import.js +104 -52
  10. package/bin/lib/node-env.js +100 -0
  11. package/bin/lib/runtime-target.js +64 -0
  12. package/bin/lib/site-snapshot.js +185 -54
  13. package/bin/lib/sql-export.js +19 -2
  14. package/dist/{app-C-L7wL6o.js → app-3REcR-3U.js} +332 -190
  15. package/dist/app-B67XOEyo.js +6 -0
  16. package/dist/client/.vite/manifest.json +2 -2
  17. package/dist/client/_assets/{client-auth-Dcon89Av.js → client-auth-Ce5WEAVS.js} +236 -183
  18. package/dist/client/_assets/client-s71Js1Cu.css +2 -0
  19. package/dist/{github-sync-CQ1x271f.js → export-ZBlfKSKm.js} +12 -439
  20. package/dist/github-sync-C593r22F.js +4 -0
  21. package/dist/github-sync-bL1hnx3Q.js +428 -0
  22. package/dist/index.js +3 -2
  23. package/dist/node.js +5 -4
  24. package/package.json +3 -2
  25. package/src/__tests__/helpers/export-fixtures.ts +0 -1
  26. package/src/__tests__/import-site-command.test.ts +18 -0
  27. package/src/client/components/__tests__/jant-settings-avatar.test.ts +2 -0
  28. package/src/client/components/__tests__/jant-settings-general.test.ts +70 -0
  29. package/src/client/components/jant-compose-dialog.ts +7 -6
  30. package/src/client/components/jant-compose-editor.ts +6 -5
  31. package/src/client/components/jant-settings-general.ts +164 -22
  32. package/src/client/components/settings-types.ts +4 -6
  33. package/src/client/random-uuid.ts +23 -0
  34. package/src/client-auth.ts +1 -1
  35. package/src/db/__tests__/demo-canonical-snapshot.test.ts +1 -1
  36. package/src/db/__tests__/migration-rehearsal.test.ts +2 -5
  37. package/src/db/backfills/0004_register_apple_touch_media_rows.sql +65 -0
  38. package/src/db/migrations/0021_thankful_phalanx.sql +16 -0
  39. package/src/db/migrations/meta/0021_snapshot.json +2121 -0
  40. package/src/db/migrations/meta/_journal.json +7 -0
  41. package/src/db/migrations/pg/0019_gray_natasha_romanoff.sql +20 -0
  42. package/src/db/migrations/pg/meta/0019_snapshot.json +2718 -0
  43. package/src/db/migrations/pg/meta/_journal.json +7 -0
  44. package/src/db/pg/schema.ts +21 -26
  45. package/src/db/rehearsal-fixtures/demo-current.json +1 -1
  46. package/src/db/schema.ts +16 -20
  47. package/src/i18n/__tests__/middleware.test.ts +43 -1
  48. package/src/i18n/coverage.generated.ts +17 -0
  49. package/src/i18n/i18n.ts +18 -2
  50. package/src/i18n/index.ts +3 -0
  51. package/src/i18n/locales/settings/en.po +16 -11
  52. package/src/i18n/locales/settings/en.ts +1 -1
  53. package/src/i18n/locales/settings/zh-Hans.po +17 -12
  54. package/src/i18n/locales/settings/zh-Hans.ts +1 -1
  55. package/src/i18n/locales/settings/zh-Hant.po +16 -11
  56. package/src/i18n/locales/settings/zh-Hant.ts +1 -1
  57. package/src/i18n/locales.ts +84 -2
  58. package/src/i18n/middleware.ts +25 -16
  59. package/src/i18n/supported-locales.ts +153 -0
  60. package/src/lib/__tests__/csp-builder.test.ts +19 -2
  61. package/src/lib/__tests__/feed.test.ts +242 -1
  62. package/src/lib/__tests__/post-meta.test.ts +0 -1
  63. package/src/lib/__tests__/view.test.ts +0 -1
  64. package/src/lib/csp-builder.ts +28 -10
  65. package/src/lib/feed.ts +153 -3
  66. package/src/middleware/__tests__/secure-headers.test.ts +89 -0
  67. package/src/middleware/auth.ts +1 -1
  68. package/src/middleware/secure-headers.ts +47 -1
  69. package/src/node/__tests__/cli-runtime-target.test.ts +110 -2
  70. package/src/node/__tests__/cli-site-snapshot.test.ts +308 -13
  71. package/src/node/__tests__/cli-site-token-env.test.ts +2 -7
  72. package/src/node/__tests__/cli-snapshot-meta.test.ts +85 -0
  73. package/src/node/__tests__/cli-sql-export.test.ts +49 -0
  74. package/src/node/index.ts +1 -0
  75. package/src/preset.css +8 -2
  76. package/src/routes/api/__tests__/settings.test.ts +3 -2
  77. package/src/routes/api/github-sync.tsx +1 -1
  78. package/src/routes/api/settings.ts +4 -1
  79. package/src/routes/auth/signin.tsx +6 -0
  80. package/src/routes/pages/archive.tsx +4 -2
  81. package/src/services/__tests__/post.test.ts +19 -19
  82. package/src/services/__tests__/search.test.ts +0 -1
  83. package/src/services/__tests__/settings.test.ts +22 -3
  84. package/src/services/bootstrap.ts +7 -3
  85. package/src/services/collection.ts +3 -3
  86. package/src/services/export.ts +0 -3
  87. package/src/services/navigation.ts +0 -2
  88. package/src/services/path.ts +1 -38
  89. package/src/services/post.ts +32 -66
  90. package/src/services/search.ts +0 -6
  91. package/src/services/settings.ts +47 -6
  92. package/src/services/site-admin.ts +6 -1
  93. package/src/styles/ui.css +12 -23
  94. package/src/types/entities.ts +0 -1
  95. package/src/ui/color-themes.ts +1 -1
  96. package/src/ui/dash/settings/GeneralContent.tsx +17 -19
  97. package/src/ui/dash/settings/SettingsRootContent.tsx +17 -28
  98. package/src/ui/feed/NoteCard.tsx +1 -11
  99. package/src/ui/feed/__tests__/timeline-cards.test.ts +1 -1
  100. package/src/ui/pages/HomePage.tsx +1 -4
  101. package/src/ui/pages/PostPage.tsx +2 -0
  102. package/bin/commands/collections.js +0 -268
  103. package/bin/commands/media.js +0 -302
  104. package/bin/commands/posts.js +0 -262
  105. package/bin/commands/search.js +0 -53
  106. package/bin/commands/settings.js +0 -93
  107. package/bin/lib/http-api.js +0 -223
  108. package/bin/lib/media-upload.js +0 -206
  109. package/dist/app-Hvqe7Ks_.js +0 -5
  110. package/dist/client/_assets/client-DDs6NzB3.css +0 -2
  111. package/src/__tests__/bin/content-cli.test.ts +0 -179
  112. package/src/__tests__/bin/media-cli.test.ts +0 -192
  113. /package/dist/{github-api-BkRWnqMx.js → github-api-Bh0PH3zr.js} +0 -0
  114. /package/dist/{github-app-WeadXMb8.js → github-app-D0GvNnqp.js} +0 -0
@@ -0,0 +1,2121 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "7499a341-b72f-41c4-807b-e929b2062dc2",
5
+ "prevId": "63b04dd1-f05a-40f7-b648-64ad298ef51e",
6
+ "tables": {
7
+ "account": {
8
+ "name": "account",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "account_id": {
18
+ "name": "account_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "provider_id": {
25
+ "name": "provider_id",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "user_id": {
32
+ "name": "user_id",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "access_token": {
39
+ "name": "access_token",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "refresh_token": {
46
+ "name": "refresh_token",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": false,
50
+ "autoincrement": false
51
+ },
52
+ "id_token": {
53
+ "name": "id_token",
54
+ "type": "text",
55
+ "primaryKey": false,
56
+ "notNull": false,
57
+ "autoincrement": false
58
+ },
59
+ "access_token_expires_at": {
60
+ "name": "access_token_expires_at",
61
+ "type": "integer",
62
+ "primaryKey": false,
63
+ "notNull": false,
64
+ "autoincrement": false
65
+ },
66
+ "refresh_token_expires_at": {
67
+ "name": "refresh_token_expires_at",
68
+ "type": "integer",
69
+ "primaryKey": false,
70
+ "notNull": false,
71
+ "autoincrement": false
72
+ },
73
+ "scope": {
74
+ "name": "scope",
75
+ "type": "text",
76
+ "primaryKey": false,
77
+ "notNull": false,
78
+ "autoincrement": false
79
+ },
80
+ "password": {
81
+ "name": "password",
82
+ "type": "text",
83
+ "primaryKey": false,
84
+ "notNull": false,
85
+ "autoincrement": false
86
+ },
87
+ "created_at": {
88
+ "name": "created_at",
89
+ "type": "integer",
90
+ "primaryKey": false,
91
+ "notNull": true,
92
+ "autoincrement": false
93
+ },
94
+ "updated_at": {
95
+ "name": "updated_at",
96
+ "type": "integer",
97
+ "primaryKey": false,
98
+ "notNull": true,
99
+ "autoincrement": false
100
+ }
101
+ },
102
+ "indexes": {},
103
+ "foreignKeys": {
104
+ "account_user_id_user_id_fk": {
105
+ "name": "account_user_id_user_id_fk",
106
+ "tableFrom": "account",
107
+ "tableTo": "user",
108
+ "columnsFrom": ["user_id"],
109
+ "columnsTo": ["id"],
110
+ "onDelete": "no action",
111
+ "onUpdate": "no action"
112
+ }
113
+ },
114
+ "compositePrimaryKeys": {},
115
+ "uniqueConstraints": {},
116
+ "checkConstraints": {}
117
+ },
118
+ "api_token": {
119
+ "name": "api_token",
120
+ "columns": {
121
+ "id": {
122
+ "name": "id",
123
+ "type": "text",
124
+ "primaryKey": true,
125
+ "notNull": true,
126
+ "autoincrement": false
127
+ },
128
+ "site_id": {
129
+ "name": "site_id",
130
+ "type": "text",
131
+ "primaryKey": false,
132
+ "notNull": true,
133
+ "autoincrement": false
134
+ },
135
+ "name": {
136
+ "name": "name",
137
+ "type": "text",
138
+ "primaryKey": false,
139
+ "notNull": true,
140
+ "autoincrement": false
141
+ },
142
+ "token_hash": {
143
+ "name": "token_hash",
144
+ "type": "text",
145
+ "primaryKey": false,
146
+ "notNull": true,
147
+ "autoincrement": false
148
+ },
149
+ "prefix": {
150
+ "name": "prefix",
151
+ "type": "text",
152
+ "primaryKey": false,
153
+ "notNull": true,
154
+ "autoincrement": false
155
+ },
156
+ "last_used_at": {
157
+ "name": "last_used_at",
158
+ "type": "integer",
159
+ "primaryKey": false,
160
+ "notNull": false,
161
+ "autoincrement": false
162
+ },
163
+ "created_at": {
164
+ "name": "created_at",
165
+ "type": "integer",
166
+ "primaryKey": false,
167
+ "notNull": true,
168
+ "autoincrement": false
169
+ },
170
+ "updated_at": {
171
+ "name": "updated_at",
172
+ "type": "integer",
173
+ "primaryKey": false,
174
+ "notNull": true,
175
+ "autoincrement": false
176
+ }
177
+ },
178
+ "indexes": {
179
+ "api_token_token_hash_unique": {
180
+ "name": "api_token_token_hash_unique",
181
+ "columns": ["token_hash"],
182
+ "isUnique": true
183
+ },
184
+ "idx_api_token_site_id": {
185
+ "name": "idx_api_token_site_id",
186
+ "columns": ["site_id"],
187
+ "isUnique": false
188
+ }
189
+ },
190
+ "foreignKeys": {
191
+ "api_token_site_id_site_id_fk": {
192
+ "name": "api_token_site_id_site_id_fk",
193
+ "tableFrom": "api_token",
194
+ "tableTo": "site",
195
+ "columnsFrom": ["site_id"],
196
+ "columnsTo": ["id"],
197
+ "onDelete": "cascade",
198
+ "onUpdate": "no action"
199
+ }
200
+ },
201
+ "compositePrimaryKeys": {},
202
+ "uniqueConstraints": {},
203
+ "checkConstraints": {}
204
+ },
205
+ "collection_directory_item": {
206
+ "name": "collection_directory_item",
207
+ "columns": {
208
+ "id": {
209
+ "name": "id",
210
+ "type": "text",
211
+ "primaryKey": true,
212
+ "notNull": true,
213
+ "autoincrement": false
214
+ },
215
+ "site_id": {
216
+ "name": "site_id",
217
+ "type": "text",
218
+ "primaryKey": false,
219
+ "notNull": true,
220
+ "autoincrement": false
221
+ },
222
+ "type": {
223
+ "name": "type",
224
+ "type": "text",
225
+ "primaryKey": false,
226
+ "notNull": true,
227
+ "autoincrement": false
228
+ },
229
+ "collection_id": {
230
+ "name": "collection_id",
231
+ "type": "text",
232
+ "primaryKey": false,
233
+ "notNull": false,
234
+ "autoincrement": false
235
+ },
236
+ "label": {
237
+ "name": "label",
238
+ "type": "text",
239
+ "primaryKey": false,
240
+ "notNull": false,
241
+ "autoincrement": false
242
+ },
243
+ "url": {
244
+ "name": "url",
245
+ "type": "text",
246
+ "primaryKey": false,
247
+ "notNull": false,
248
+ "autoincrement": false
249
+ },
250
+ "description": {
251
+ "name": "description",
252
+ "type": "text",
253
+ "primaryKey": false,
254
+ "notNull": false,
255
+ "autoincrement": false
256
+ },
257
+ "position": {
258
+ "name": "position",
259
+ "type": "text",
260
+ "primaryKey": false,
261
+ "notNull": true,
262
+ "autoincrement": false,
263
+ "default": "'a0'"
264
+ },
265
+ "created_at": {
266
+ "name": "created_at",
267
+ "type": "integer",
268
+ "primaryKey": false,
269
+ "notNull": true,
270
+ "autoincrement": false
271
+ },
272
+ "updated_at": {
273
+ "name": "updated_at",
274
+ "type": "integer",
275
+ "primaryKey": false,
276
+ "notNull": true,
277
+ "autoincrement": false
278
+ }
279
+ },
280
+ "indexes": {
281
+ "idx_collection_directory_item_site_collection_id": {
282
+ "name": "idx_collection_directory_item_site_collection_id",
283
+ "columns": ["site_id", "collection_id"],
284
+ "isUnique": false
285
+ },
286
+ "uq_collection_directory_item_site_position": {
287
+ "name": "uq_collection_directory_item_site_position",
288
+ "columns": ["site_id", "position"],
289
+ "isUnique": true
290
+ },
291
+ "uq_collection_directory_item_site_collection_once": {
292
+ "name": "uq_collection_directory_item_site_collection_once",
293
+ "columns": ["site_id", "collection_id"],
294
+ "isUnique": true,
295
+ "where": "\"collection_directory_item\".\"type\" = 'collection' AND \"collection_directory_item\".\"collection_id\" IS NOT NULL"
296
+ }
297
+ },
298
+ "foreignKeys": {
299
+ "collection_directory_item_site_id_site_id_fk": {
300
+ "name": "collection_directory_item_site_id_site_id_fk",
301
+ "tableFrom": "collection_directory_item",
302
+ "tableTo": "site",
303
+ "columnsFrom": ["site_id"],
304
+ "columnsTo": ["id"],
305
+ "onDelete": "cascade",
306
+ "onUpdate": "no action"
307
+ },
308
+ "collection_directory_item_collection_id_collection_id_fk": {
309
+ "name": "collection_directory_item_collection_id_collection_id_fk",
310
+ "tableFrom": "collection_directory_item",
311
+ "tableTo": "collection",
312
+ "columnsFrom": ["collection_id"],
313
+ "columnsTo": ["id"],
314
+ "onDelete": "cascade",
315
+ "onUpdate": "no action"
316
+ }
317
+ },
318
+ "compositePrimaryKeys": {},
319
+ "uniqueConstraints": {},
320
+ "checkConstraints": {
321
+ "chk_collection_directory_item_type": {
322
+ "name": "chk_collection_directory_item_type",
323
+ "value": "\"collection_directory_item\".\"type\" IN ('collection', 'divider', 'link')"
324
+ },
325
+ "chk_collection_directory_item_shape": {
326
+ "name": "chk_collection_directory_item_shape",
327
+ "value": "(\n \"collection_directory_item\".\"type\" = 'collection'\n AND \"collection_directory_item\".\"collection_id\" IS NOT NULL\n AND \"collection_directory_item\".\"label\" IS NULL\n AND \"collection_directory_item\".\"url\" IS NULL\n ) OR (\n \"collection_directory_item\".\"type\" = 'divider'\n AND \"collection_directory_item\".\"collection_id\" IS NULL\n AND \"collection_directory_item\".\"url\" IS NULL\n ) OR (\n \"collection_directory_item\".\"type\" = 'link'\n AND \"collection_directory_item\".\"collection_id\" IS NULL\n AND \"collection_directory_item\".\"label\" IS NOT NULL\n AND \"collection_directory_item\".\"url\" IS NOT NULL\n )"
328
+ },
329
+ "chk_collection_directory_item_label": {
330
+ "name": "chk_collection_directory_item_label",
331
+ "value": "\"collection_directory_item\".\"type\" <> 'collection' OR \"collection_directory_item\".\"label\" IS NULL"
332
+ },
333
+ "chk_collection_directory_item_description": {
334
+ "name": "chk_collection_directory_item_description",
335
+ "value": "\"collection_directory_item\".\"type\" = 'link' OR \"collection_directory_item\".\"description\" IS NULL"
336
+ }
337
+ }
338
+ },
339
+ "collection": {
340
+ "name": "collection",
341
+ "columns": {
342
+ "id": {
343
+ "name": "id",
344
+ "type": "text",
345
+ "primaryKey": true,
346
+ "notNull": true,
347
+ "autoincrement": false
348
+ },
349
+ "site_id": {
350
+ "name": "site_id",
351
+ "type": "text",
352
+ "primaryKey": false,
353
+ "notNull": true,
354
+ "autoincrement": false
355
+ },
356
+ "title": {
357
+ "name": "title",
358
+ "type": "text",
359
+ "primaryKey": false,
360
+ "notNull": true,
361
+ "autoincrement": false
362
+ },
363
+ "description": {
364
+ "name": "description",
365
+ "type": "text",
366
+ "primaryKey": false,
367
+ "notNull": false,
368
+ "autoincrement": false
369
+ },
370
+ "sort_order": {
371
+ "name": "sort_order",
372
+ "type": "text",
373
+ "primaryKey": false,
374
+ "notNull": true,
375
+ "autoincrement": false,
376
+ "default": "'newest'"
377
+ },
378
+ "created_at": {
379
+ "name": "created_at",
380
+ "type": "integer",
381
+ "primaryKey": false,
382
+ "notNull": true,
383
+ "autoincrement": false
384
+ },
385
+ "updated_at": {
386
+ "name": "updated_at",
387
+ "type": "integer",
388
+ "primaryKey": false,
389
+ "notNull": true,
390
+ "autoincrement": false
391
+ }
392
+ },
393
+ "indexes": {
394
+ "idx_collection_site_created_at": {
395
+ "name": "idx_collection_site_created_at",
396
+ "columns": ["site_id", "created_at"],
397
+ "isUnique": false
398
+ }
399
+ },
400
+ "foreignKeys": {
401
+ "collection_site_id_site_id_fk": {
402
+ "name": "collection_site_id_site_id_fk",
403
+ "tableFrom": "collection",
404
+ "tableTo": "site",
405
+ "columnsFrom": ["site_id"],
406
+ "columnsTo": ["id"],
407
+ "onDelete": "cascade",
408
+ "onUpdate": "no action"
409
+ }
410
+ },
411
+ "compositePrimaryKeys": {},
412
+ "uniqueConstraints": {},
413
+ "checkConstraints": {
414
+ "chk_collection_sort_order": {
415
+ "name": "chk_collection_sort_order",
416
+ "value": "\"collection\".\"sort_order\" IN ('newest', 'oldest', 'rating_desc')"
417
+ }
418
+ }
419
+ },
420
+ "github_app_installation": {
421
+ "name": "github_app_installation",
422
+ "columns": {
423
+ "installation_id": {
424
+ "name": "installation_id",
425
+ "type": "text",
426
+ "primaryKey": false,
427
+ "notNull": true,
428
+ "autoincrement": false
429
+ },
430
+ "site_id": {
431
+ "name": "site_id",
432
+ "type": "text",
433
+ "primaryKey": false,
434
+ "notNull": true,
435
+ "autoincrement": false
436
+ },
437
+ "account_login": {
438
+ "name": "account_login",
439
+ "type": "text",
440
+ "primaryKey": false,
441
+ "notNull": true,
442
+ "autoincrement": false
443
+ },
444
+ "account_type": {
445
+ "name": "account_type",
446
+ "type": "text",
447
+ "primaryKey": false,
448
+ "notNull": true,
449
+ "autoincrement": false
450
+ },
451
+ "account_avatar_url": {
452
+ "name": "account_avatar_url",
453
+ "type": "text",
454
+ "primaryKey": false,
455
+ "notNull": true,
456
+ "autoincrement": false,
457
+ "default": "''"
458
+ },
459
+ "added_at": {
460
+ "name": "added_at",
461
+ "type": "integer",
462
+ "primaryKey": false,
463
+ "notNull": true,
464
+ "autoincrement": false
465
+ }
466
+ },
467
+ "indexes": {
468
+ "github_app_installation_by_installation": {
469
+ "name": "github_app_installation_by_installation",
470
+ "columns": ["installation_id"],
471
+ "isUnique": false
472
+ },
473
+ "github_app_installation_by_site": {
474
+ "name": "github_app_installation_by_site",
475
+ "columns": ["site_id"],
476
+ "isUnique": false
477
+ }
478
+ },
479
+ "foreignKeys": {
480
+ "github_app_installation_site_id_site_id_fk": {
481
+ "name": "github_app_installation_site_id_site_id_fk",
482
+ "tableFrom": "github_app_installation",
483
+ "tableTo": "site",
484
+ "columnsFrom": ["site_id"],
485
+ "columnsTo": ["id"],
486
+ "onDelete": "cascade",
487
+ "onUpdate": "no action"
488
+ }
489
+ },
490
+ "compositePrimaryKeys": {
491
+ "github_app_installation_installation_id_site_id_pk": {
492
+ "columns": ["installation_id", "site_id"],
493
+ "name": "github_app_installation_installation_id_site_id_pk"
494
+ }
495
+ },
496
+ "uniqueConstraints": {},
497
+ "checkConstraints": {
498
+ "chk_github_app_installation_account_type": {
499
+ "name": "chk_github_app_installation_account_type",
500
+ "value": "\"github_app_installation\".\"account_type\" IN ('User', 'Organization')"
501
+ }
502
+ }
503
+ },
504
+ "media": {
505
+ "name": "media",
506
+ "columns": {
507
+ "id": {
508
+ "name": "id",
509
+ "type": "text",
510
+ "primaryKey": true,
511
+ "notNull": true,
512
+ "autoincrement": false
513
+ },
514
+ "site_id": {
515
+ "name": "site_id",
516
+ "type": "text",
517
+ "primaryKey": false,
518
+ "notNull": true,
519
+ "autoincrement": false
520
+ },
521
+ "post_id": {
522
+ "name": "post_id",
523
+ "type": "text",
524
+ "primaryKey": false,
525
+ "notNull": false,
526
+ "autoincrement": false
527
+ },
528
+ "filename": {
529
+ "name": "filename",
530
+ "type": "text",
531
+ "primaryKey": false,
532
+ "notNull": true,
533
+ "autoincrement": false
534
+ },
535
+ "original_name": {
536
+ "name": "original_name",
537
+ "type": "text",
538
+ "primaryKey": false,
539
+ "notNull": true,
540
+ "autoincrement": false
541
+ },
542
+ "mime_type": {
543
+ "name": "mime_type",
544
+ "type": "text",
545
+ "primaryKey": false,
546
+ "notNull": true,
547
+ "autoincrement": false
548
+ },
549
+ "size": {
550
+ "name": "size",
551
+ "type": "integer",
552
+ "primaryKey": false,
553
+ "notNull": true,
554
+ "autoincrement": false
555
+ },
556
+ "storage_key": {
557
+ "name": "storage_key",
558
+ "type": "text",
559
+ "primaryKey": false,
560
+ "notNull": true,
561
+ "autoincrement": false
562
+ },
563
+ "provider": {
564
+ "name": "provider",
565
+ "type": "text",
566
+ "primaryKey": false,
567
+ "notNull": true,
568
+ "autoincrement": false,
569
+ "default": "'r2'"
570
+ },
571
+ "width": {
572
+ "name": "width",
573
+ "type": "integer",
574
+ "primaryKey": false,
575
+ "notNull": false,
576
+ "autoincrement": false
577
+ },
578
+ "height": {
579
+ "name": "height",
580
+ "type": "integer",
581
+ "primaryKey": false,
582
+ "notNull": false,
583
+ "autoincrement": false
584
+ },
585
+ "duration_seconds": {
586
+ "name": "duration_seconds",
587
+ "type": "integer",
588
+ "primaryKey": false,
589
+ "notNull": false,
590
+ "autoincrement": false
591
+ },
592
+ "alt": {
593
+ "name": "alt",
594
+ "type": "text",
595
+ "primaryKey": false,
596
+ "notNull": false,
597
+ "autoincrement": false
598
+ },
599
+ "position": {
600
+ "name": "position",
601
+ "type": "text",
602
+ "primaryKey": false,
603
+ "notNull": true,
604
+ "autoincrement": false,
605
+ "default": "'a0'"
606
+ },
607
+ "blurhash": {
608
+ "name": "blurhash",
609
+ "type": "text",
610
+ "primaryKey": false,
611
+ "notNull": false,
612
+ "autoincrement": false
613
+ },
614
+ "waveform": {
615
+ "name": "waveform",
616
+ "type": "text",
617
+ "primaryKey": false,
618
+ "notNull": false,
619
+ "autoincrement": false
620
+ },
621
+ "poster_key": {
622
+ "name": "poster_key",
623
+ "type": "text",
624
+ "primaryKey": false,
625
+ "notNull": false,
626
+ "autoincrement": false
627
+ },
628
+ "summary": {
629
+ "name": "summary",
630
+ "type": "text",
631
+ "primaryKey": false,
632
+ "notNull": false,
633
+ "autoincrement": false
634
+ },
635
+ "chars": {
636
+ "name": "chars",
637
+ "type": "integer",
638
+ "primaryKey": false,
639
+ "notNull": false,
640
+ "autoincrement": false
641
+ },
642
+ "media_kind": {
643
+ "name": "media_kind",
644
+ "type": "text",
645
+ "primaryKey": false,
646
+ "notNull": true,
647
+ "autoincrement": false,
648
+ "default": "'document'"
649
+ },
650
+ "created_at": {
651
+ "name": "created_at",
652
+ "type": "integer",
653
+ "primaryKey": false,
654
+ "notNull": true,
655
+ "autoincrement": false
656
+ },
657
+ "updated_at": {
658
+ "name": "updated_at",
659
+ "type": "integer",
660
+ "primaryKey": false,
661
+ "notNull": true,
662
+ "autoincrement": false
663
+ }
664
+ },
665
+ "indexes": {
666
+ "idx_media_site_post_id_position": {
667
+ "name": "idx_media_site_post_id_position",
668
+ "columns": ["site_id", "post_id", "position"],
669
+ "isUnique": false
670
+ },
671
+ "uq_media_site_post_position": {
672
+ "name": "uq_media_site_post_position",
673
+ "columns": ["site_id", "post_id", "position"],
674
+ "isUnique": true,
675
+ "where": "\"media\".\"post_id\" IS NOT NULL"
676
+ },
677
+ "uq_media_provider_storage_key": {
678
+ "name": "uq_media_provider_storage_key",
679
+ "columns": ["provider", "storage_key"],
680
+ "isUnique": true
681
+ },
682
+ "idx_media_site_media_kind_post_id": {
683
+ "name": "idx_media_site_media_kind_post_id",
684
+ "columns": ["site_id", "media_kind", "post_id"],
685
+ "isUnique": false
686
+ }
687
+ },
688
+ "foreignKeys": {
689
+ "media_site_id_site_id_fk": {
690
+ "name": "media_site_id_site_id_fk",
691
+ "tableFrom": "media",
692
+ "tableTo": "site",
693
+ "columnsFrom": ["site_id"],
694
+ "columnsTo": ["id"],
695
+ "onDelete": "cascade",
696
+ "onUpdate": "no action"
697
+ },
698
+ "media_post_id_post_id_fk": {
699
+ "name": "media_post_id_post_id_fk",
700
+ "tableFrom": "media",
701
+ "tableTo": "post",
702
+ "columnsFrom": ["post_id"],
703
+ "columnsTo": ["id"],
704
+ "onDelete": "set null",
705
+ "onUpdate": "no action"
706
+ }
707
+ },
708
+ "compositePrimaryKeys": {},
709
+ "uniqueConstraints": {},
710
+ "checkConstraints": {
711
+ "chk_media_size_positive": {
712
+ "name": "chk_media_size_positive",
713
+ "value": "\"media\".\"size\" > 0"
714
+ },
715
+ "chk_media_position_not_blank": {
716
+ "name": "chk_media_position_not_blank",
717
+ "value": "trim(\"media\".\"position\") <> ''"
718
+ },
719
+ "chk_media_dimensions_positive": {
720
+ "name": "chk_media_dimensions_positive",
721
+ "value": "(\n \"media\".\"width\" IS NULL OR \"media\".\"width\" > 0\n ) AND (\n \"media\".\"height\" IS NULL OR \"media\".\"height\" > 0\n )"
722
+ },
723
+ "chk_media_chars_nonnegative": {
724
+ "name": "chk_media_chars_nonnegative",
725
+ "value": "\"media\".\"chars\" IS NULL OR \"media\".\"chars\" >= 0"
726
+ }
727
+ }
728
+ },
729
+ "nav_item": {
730
+ "name": "nav_item",
731
+ "columns": {
732
+ "id": {
733
+ "name": "id",
734
+ "type": "text",
735
+ "primaryKey": true,
736
+ "notNull": true,
737
+ "autoincrement": false
738
+ },
739
+ "site_id": {
740
+ "name": "site_id",
741
+ "type": "text",
742
+ "primaryKey": false,
743
+ "notNull": true,
744
+ "autoincrement": false
745
+ },
746
+ "type": {
747
+ "name": "type",
748
+ "type": "text",
749
+ "primaryKey": false,
750
+ "notNull": true,
751
+ "autoincrement": false,
752
+ "default": "'link'"
753
+ },
754
+ "system_key": {
755
+ "name": "system_key",
756
+ "type": "text",
757
+ "primaryKey": false,
758
+ "notNull": false,
759
+ "autoincrement": false
760
+ },
761
+ "collection_id": {
762
+ "name": "collection_id",
763
+ "type": "text",
764
+ "primaryKey": false,
765
+ "notNull": false,
766
+ "autoincrement": false
767
+ },
768
+ "label": {
769
+ "name": "label",
770
+ "type": "text",
771
+ "primaryKey": false,
772
+ "notNull": true,
773
+ "autoincrement": false
774
+ },
775
+ "url": {
776
+ "name": "url",
777
+ "type": "text",
778
+ "primaryKey": false,
779
+ "notNull": true,
780
+ "autoincrement": false
781
+ },
782
+ "placement": {
783
+ "name": "placement",
784
+ "type": "text",
785
+ "primaryKey": false,
786
+ "notNull": true,
787
+ "autoincrement": false,
788
+ "default": "'header'"
789
+ },
790
+ "position": {
791
+ "name": "position",
792
+ "type": "text",
793
+ "primaryKey": false,
794
+ "notNull": true,
795
+ "autoincrement": false,
796
+ "default": "'a0'"
797
+ },
798
+ "created_at": {
799
+ "name": "created_at",
800
+ "type": "integer",
801
+ "primaryKey": false,
802
+ "notNull": true,
803
+ "autoincrement": false
804
+ },
805
+ "updated_at": {
806
+ "name": "updated_at",
807
+ "type": "integer",
808
+ "primaryKey": false,
809
+ "notNull": true,
810
+ "autoincrement": false
811
+ }
812
+ },
813
+ "indexes": {
814
+ "uq_nav_item_site_position": {
815
+ "name": "uq_nav_item_site_position",
816
+ "columns": ["site_id", "position"],
817
+ "isUnique": true
818
+ },
819
+ "uq_nav_item_site_system_key": {
820
+ "name": "uq_nav_item_site_system_key",
821
+ "columns": ["site_id", "system_key"],
822
+ "isUnique": true,
823
+ "where": "\"nav_item\".\"system_key\" IS NOT NULL"
824
+ },
825
+ "uq_nav_item_site_collection_id": {
826
+ "name": "uq_nav_item_site_collection_id",
827
+ "columns": ["site_id", "collection_id"],
828
+ "isUnique": true,
829
+ "where": "\"nav_item\".\"collection_id\" IS NOT NULL"
830
+ }
831
+ },
832
+ "foreignKeys": {
833
+ "nav_item_site_id_site_id_fk": {
834
+ "name": "nav_item_site_id_site_id_fk",
835
+ "tableFrom": "nav_item",
836
+ "tableTo": "site",
837
+ "columnsFrom": ["site_id"],
838
+ "columnsTo": ["id"],
839
+ "onDelete": "cascade",
840
+ "onUpdate": "no action"
841
+ },
842
+ "nav_item_collection_id_collection_id_fk": {
843
+ "name": "nav_item_collection_id_collection_id_fk",
844
+ "tableFrom": "nav_item",
845
+ "tableTo": "collection",
846
+ "columnsFrom": ["collection_id"],
847
+ "columnsTo": ["id"],
848
+ "onDelete": "cascade",
849
+ "onUpdate": "no action"
850
+ }
851
+ },
852
+ "compositePrimaryKeys": {},
853
+ "uniqueConstraints": {},
854
+ "checkConstraints": {
855
+ "chk_nav_item_type": {
856
+ "name": "chk_nav_item_type",
857
+ "value": "\"nav_item\".\"type\" IN ('link', 'system', 'collection')"
858
+ },
859
+ "chk_nav_item_placement": {
860
+ "name": "chk_nav_item_placement",
861
+ "value": "\"nav_item\".\"placement\" IN ('header', 'more')"
862
+ },
863
+ "chk_nav_item_shape": {
864
+ "name": "chk_nav_item_shape",
865
+ "value": "(\n \"nav_item\".\"type\" = 'link'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'system'\n AND \"nav_item\".\"system_key\" IS NOT NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'collection'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NOT NULL\n )"
866
+ }
867
+ }
868
+ },
869
+ "path_registry": {
870
+ "name": "path_registry",
871
+ "columns": {
872
+ "id": {
873
+ "name": "id",
874
+ "type": "text",
875
+ "primaryKey": true,
876
+ "notNull": true,
877
+ "autoincrement": false
878
+ },
879
+ "site_id": {
880
+ "name": "site_id",
881
+ "type": "text",
882
+ "primaryKey": false,
883
+ "notNull": true,
884
+ "autoincrement": false
885
+ },
886
+ "path": {
887
+ "name": "path",
888
+ "type": "text",
889
+ "primaryKey": false,
890
+ "notNull": true,
891
+ "autoincrement": false
892
+ },
893
+ "kind": {
894
+ "name": "kind",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": true,
898
+ "autoincrement": false
899
+ },
900
+ "post_id": {
901
+ "name": "post_id",
902
+ "type": "text",
903
+ "primaryKey": false,
904
+ "notNull": false,
905
+ "autoincrement": false
906
+ },
907
+ "collection_id": {
908
+ "name": "collection_id",
909
+ "type": "text",
910
+ "primaryKey": false,
911
+ "notNull": false,
912
+ "autoincrement": false
913
+ },
914
+ "redirect_to_path": {
915
+ "name": "redirect_to_path",
916
+ "type": "text",
917
+ "primaryKey": false,
918
+ "notNull": false,
919
+ "autoincrement": false
920
+ },
921
+ "redirect_type": {
922
+ "name": "redirect_type",
923
+ "type": "integer",
924
+ "primaryKey": false,
925
+ "notNull": false,
926
+ "autoincrement": false
927
+ },
928
+ "archive_query": {
929
+ "name": "archive_query",
930
+ "type": "text",
931
+ "primaryKey": false,
932
+ "notNull": false,
933
+ "autoincrement": false
934
+ },
935
+ "created_at": {
936
+ "name": "created_at",
937
+ "type": "integer",
938
+ "primaryKey": false,
939
+ "notNull": true,
940
+ "autoincrement": false
941
+ },
942
+ "updated_at": {
943
+ "name": "updated_at",
944
+ "type": "integer",
945
+ "primaryKey": false,
946
+ "notNull": true,
947
+ "autoincrement": false
948
+ }
949
+ },
950
+ "indexes": {
951
+ "uq_path_registry_site_path": {
952
+ "name": "uq_path_registry_site_path",
953
+ "columns": ["site_id", "path"],
954
+ "isUnique": true
955
+ },
956
+ "uq_path_registry_site_post_slug": {
957
+ "name": "uq_path_registry_site_post_slug",
958
+ "columns": ["site_id", "post_id"],
959
+ "isUnique": true,
960
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"post_id\" IS NOT NULL"
961
+ },
962
+ "uq_path_registry_site_collection_slug": {
963
+ "name": "uq_path_registry_site_collection_slug",
964
+ "columns": ["site_id", "collection_id"],
965
+ "isUnique": true,
966
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"collection_id\" IS NOT NULL"
967
+ },
968
+ "idx_path_registry_site_post_id": {
969
+ "name": "idx_path_registry_site_post_id",
970
+ "columns": ["site_id", "post_id"],
971
+ "isUnique": false
972
+ },
973
+ "idx_path_registry_site_collection_id": {
974
+ "name": "idx_path_registry_site_collection_id",
975
+ "columns": ["site_id", "collection_id"],
976
+ "isUnique": false
977
+ }
978
+ },
979
+ "foreignKeys": {
980
+ "path_registry_site_id_site_id_fk": {
981
+ "name": "path_registry_site_id_site_id_fk",
982
+ "tableFrom": "path_registry",
983
+ "tableTo": "site",
984
+ "columnsFrom": ["site_id"],
985
+ "columnsTo": ["id"],
986
+ "onDelete": "cascade",
987
+ "onUpdate": "no action"
988
+ },
989
+ "path_registry_post_id_post_id_fk": {
990
+ "name": "path_registry_post_id_post_id_fk",
991
+ "tableFrom": "path_registry",
992
+ "tableTo": "post",
993
+ "columnsFrom": ["post_id"],
994
+ "columnsTo": ["id"],
995
+ "onDelete": "cascade",
996
+ "onUpdate": "no action"
997
+ },
998
+ "path_registry_collection_id_collection_id_fk": {
999
+ "name": "path_registry_collection_id_collection_id_fk",
1000
+ "tableFrom": "path_registry",
1001
+ "tableTo": "collection",
1002
+ "columnsFrom": ["collection_id"],
1003
+ "columnsTo": ["id"],
1004
+ "onDelete": "cascade",
1005
+ "onUpdate": "no action"
1006
+ }
1007
+ },
1008
+ "compositePrimaryKeys": {},
1009
+ "uniqueConstraints": {},
1010
+ "checkConstraints": {
1011
+ "chk_path_registry_kind": {
1012
+ "name": "chk_path_registry_kind",
1013
+ "value": "\"path_registry\".\"kind\" IN ('slug', 'alias', 'redirect', 'archive')"
1014
+ },
1015
+ "chk_path_registry_shape": {
1016
+ "name": "chk_path_registry_shape",
1017
+ "value": "(\n \"path_registry\".\"kind\" IN ('slug', 'alias')\n AND (\n (\"path_registry\".\"post_id\" IS NOT NULL AND \"path_registry\".\"collection_id\" IS NULL)\n OR (\"path_registry\".\"post_id\" IS NULL AND \"path_registry\".\"collection_id\" IS NOT NULL)\n )\n AND \"path_registry\".\"redirect_to_path\" IS NULL\n AND \"path_registry\".\"redirect_type\" IS NULL\n AND \"path_registry\".\"archive_query\" IS NULL\n ) OR (\n \"path_registry\".\"kind\" = 'redirect'\n AND \"path_registry\".\"post_id\" IS NULL\n AND \"path_registry\".\"collection_id\" IS NULL\n AND \"path_registry\".\"redirect_to_path\" IS NOT NULL\n AND \"path_registry\".\"redirect_type\" IN (301, 302)\n AND \"path_registry\".\"archive_query\" IS NULL\n ) OR (\n \"path_registry\".\"kind\" = 'archive'\n AND \"path_registry\".\"post_id\" IS NULL\n AND \"path_registry\".\"collection_id\" IS NULL\n AND \"path_registry\".\"redirect_to_path\" IS NULL\n AND \"path_registry\".\"redirect_type\" IS NULL\n AND \"path_registry\".\"archive_query\" IS NOT NULL\n )"
1018
+ }
1019
+ }
1020
+ },
1021
+ "post_collection": {
1022
+ "name": "post_collection",
1023
+ "columns": {
1024
+ "site_id": {
1025
+ "name": "site_id",
1026
+ "type": "text",
1027
+ "primaryKey": false,
1028
+ "notNull": true,
1029
+ "autoincrement": false
1030
+ },
1031
+ "post_id": {
1032
+ "name": "post_id",
1033
+ "type": "text",
1034
+ "primaryKey": false,
1035
+ "notNull": true,
1036
+ "autoincrement": false
1037
+ },
1038
+ "collection_id": {
1039
+ "name": "collection_id",
1040
+ "type": "text",
1041
+ "primaryKey": false,
1042
+ "notNull": true,
1043
+ "autoincrement": false
1044
+ },
1045
+ "created_at": {
1046
+ "name": "created_at",
1047
+ "type": "integer",
1048
+ "primaryKey": false,
1049
+ "notNull": true,
1050
+ "autoincrement": false
1051
+ },
1052
+ "position": {
1053
+ "name": "position",
1054
+ "type": "integer",
1055
+ "primaryKey": false,
1056
+ "notNull": true,
1057
+ "autoincrement": false,
1058
+ "default": 0
1059
+ },
1060
+ "pinned_at": {
1061
+ "name": "pinned_at",
1062
+ "type": "integer",
1063
+ "primaryKey": false,
1064
+ "notNull": false,
1065
+ "autoincrement": false
1066
+ }
1067
+ },
1068
+ "indexes": {
1069
+ "idx_post_collection_site_collection_id": {
1070
+ "name": "idx_post_collection_site_collection_id",
1071
+ "columns": ["site_id", "collection_id"],
1072
+ "isUnique": false
1073
+ },
1074
+ "idx_post_collection_site_collection_created_post": {
1075
+ "name": "idx_post_collection_site_collection_created_post",
1076
+ "columns": ["site_id", "collection_id", "created_at", "post_id"],
1077
+ "isUnique": false
1078
+ }
1079
+ },
1080
+ "foreignKeys": {
1081
+ "post_collection_site_id_site_id_fk": {
1082
+ "name": "post_collection_site_id_site_id_fk",
1083
+ "tableFrom": "post_collection",
1084
+ "tableTo": "site",
1085
+ "columnsFrom": ["site_id"],
1086
+ "columnsTo": ["id"],
1087
+ "onDelete": "cascade",
1088
+ "onUpdate": "no action"
1089
+ },
1090
+ "post_collection_post_id_post_id_fk": {
1091
+ "name": "post_collection_post_id_post_id_fk",
1092
+ "tableFrom": "post_collection",
1093
+ "tableTo": "post",
1094
+ "columnsFrom": ["post_id"],
1095
+ "columnsTo": ["id"],
1096
+ "onDelete": "cascade",
1097
+ "onUpdate": "no action"
1098
+ },
1099
+ "post_collection_collection_id_collection_id_fk": {
1100
+ "name": "post_collection_collection_id_collection_id_fk",
1101
+ "tableFrom": "post_collection",
1102
+ "tableTo": "collection",
1103
+ "columnsFrom": ["collection_id"],
1104
+ "columnsTo": ["id"],
1105
+ "onDelete": "cascade",
1106
+ "onUpdate": "no action"
1107
+ }
1108
+ },
1109
+ "compositePrimaryKeys": {
1110
+ "post_collection_site_id_post_id_collection_id_pk": {
1111
+ "columns": ["site_id", "post_id", "collection_id"],
1112
+ "name": "post_collection_site_id_post_id_collection_id_pk"
1113
+ }
1114
+ },
1115
+ "uniqueConstraints": {},
1116
+ "checkConstraints": {}
1117
+ },
1118
+ "post": {
1119
+ "name": "post",
1120
+ "columns": {
1121
+ "id": {
1122
+ "name": "id",
1123
+ "type": "text",
1124
+ "primaryKey": true,
1125
+ "notNull": true,
1126
+ "autoincrement": false
1127
+ },
1128
+ "site_id": {
1129
+ "name": "site_id",
1130
+ "type": "text",
1131
+ "primaryKey": false,
1132
+ "notNull": true,
1133
+ "autoincrement": false
1134
+ },
1135
+ "format": {
1136
+ "name": "format",
1137
+ "type": "text",
1138
+ "primaryKey": false,
1139
+ "notNull": true,
1140
+ "autoincrement": false
1141
+ },
1142
+ "status": {
1143
+ "name": "status",
1144
+ "type": "text",
1145
+ "primaryKey": false,
1146
+ "notNull": true,
1147
+ "autoincrement": false,
1148
+ "default": "'published'"
1149
+ },
1150
+ "visibility": {
1151
+ "name": "visibility",
1152
+ "type": "text",
1153
+ "primaryKey": false,
1154
+ "notNull": false,
1155
+ "autoincrement": false,
1156
+ "default": "'public'"
1157
+ },
1158
+ "pinned_at": {
1159
+ "name": "pinned_at",
1160
+ "type": "integer",
1161
+ "primaryKey": false,
1162
+ "notNull": false,
1163
+ "autoincrement": false
1164
+ },
1165
+ "featured_at": {
1166
+ "name": "featured_at",
1167
+ "type": "integer",
1168
+ "primaryKey": false,
1169
+ "notNull": false,
1170
+ "autoincrement": false
1171
+ },
1172
+ "title": {
1173
+ "name": "title",
1174
+ "type": "text",
1175
+ "primaryKey": false,
1176
+ "notNull": false,
1177
+ "autoincrement": false
1178
+ },
1179
+ "url": {
1180
+ "name": "url",
1181
+ "type": "text",
1182
+ "primaryKey": false,
1183
+ "notNull": false,
1184
+ "autoincrement": false
1185
+ },
1186
+ "body": {
1187
+ "name": "body",
1188
+ "type": "text",
1189
+ "primaryKey": false,
1190
+ "notNull": false,
1191
+ "autoincrement": false
1192
+ },
1193
+ "body_html": {
1194
+ "name": "body_html",
1195
+ "type": "text",
1196
+ "primaryKey": false,
1197
+ "notNull": false,
1198
+ "autoincrement": false
1199
+ },
1200
+ "body_text": {
1201
+ "name": "body_text",
1202
+ "type": "text",
1203
+ "primaryKey": false,
1204
+ "notNull": false,
1205
+ "autoincrement": false
1206
+ },
1207
+ "quote_text": {
1208
+ "name": "quote_text",
1209
+ "type": "text",
1210
+ "primaryKey": false,
1211
+ "notNull": false,
1212
+ "autoincrement": false
1213
+ },
1214
+ "summary": {
1215
+ "name": "summary",
1216
+ "type": "text",
1217
+ "primaryKey": false,
1218
+ "notNull": false,
1219
+ "autoincrement": false
1220
+ },
1221
+ "rating": {
1222
+ "name": "rating",
1223
+ "type": "integer",
1224
+ "primaryKey": false,
1225
+ "notNull": false,
1226
+ "autoincrement": false
1227
+ },
1228
+ "preview_image_key": {
1229
+ "name": "preview_image_key",
1230
+ "type": "text",
1231
+ "primaryKey": false,
1232
+ "notNull": false,
1233
+ "autoincrement": false
1234
+ },
1235
+ "preview_kind": {
1236
+ "name": "preview_kind",
1237
+ "type": "text",
1238
+ "primaryKey": false,
1239
+ "notNull": false,
1240
+ "autoincrement": false
1241
+ },
1242
+ "preview_provider": {
1243
+ "name": "preview_provider",
1244
+ "type": "text",
1245
+ "primaryKey": false,
1246
+ "notNull": false,
1247
+ "autoincrement": false
1248
+ },
1249
+ "reply_to_id": {
1250
+ "name": "reply_to_id",
1251
+ "type": "text",
1252
+ "primaryKey": false,
1253
+ "notNull": false,
1254
+ "autoincrement": false
1255
+ },
1256
+ "thread_id": {
1257
+ "name": "thread_id",
1258
+ "type": "text",
1259
+ "primaryKey": false,
1260
+ "notNull": true,
1261
+ "autoincrement": false
1262
+ },
1263
+ "published_at": {
1264
+ "name": "published_at",
1265
+ "type": "integer",
1266
+ "primaryKey": false,
1267
+ "notNull": false,
1268
+ "autoincrement": false
1269
+ },
1270
+ "last_activity_at": {
1271
+ "name": "last_activity_at",
1272
+ "type": "integer",
1273
+ "primaryKey": false,
1274
+ "notNull": false,
1275
+ "autoincrement": false
1276
+ },
1277
+ "created_at": {
1278
+ "name": "created_at",
1279
+ "type": "integer",
1280
+ "primaryKey": false,
1281
+ "notNull": true,
1282
+ "autoincrement": false
1283
+ },
1284
+ "updated_at": {
1285
+ "name": "updated_at",
1286
+ "type": "integer",
1287
+ "primaryKey": false,
1288
+ "notNull": true,
1289
+ "autoincrement": false
1290
+ }
1291
+ },
1292
+ "indexes": {
1293
+ "uq_post_site_id_id": {
1294
+ "name": "uq_post_site_id_id",
1295
+ "columns": ["site_id", "id"],
1296
+ "isUnique": true
1297
+ },
1298
+ "idx_post_site_thread_id": {
1299
+ "name": "idx_post_site_thread_id",
1300
+ "columns": ["site_id", "thread_id"],
1301
+ "isUnique": false
1302
+ },
1303
+ "idx_post_site_thread_created": {
1304
+ "name": "idx_post_site_thread_created",
1305
+ "columns": ["site_id", "thread_id", "created_at", "id"],
1306
+ "isUnique": false
1307
+ },
1308
+ "idx_post_site_status_published": {
1309
+ "name": "idx_post_site_status_published",
1310
+ "columns": ["site_id", "status", "published_at"],
1311
+ "isUnique": false
1312
+ },
1313
+ "idx_post_site_status_activity": {
1314
+ "name": "idx_post_site_status_activity",
1315
+ "columns": ["site_id", "status", "last_activity_at"],
1316
+ "isUnique": false
1317
+ },
1318
+ "idx_post_site_root_published_activity": {
1319
+ "name": "idx_post_site_root_published_activity",
1320
+ "columns": ["site_id", "last_activity_at", "id"],
1321
+ "isUnique": false,
1322
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'"
1323
+ },
1324
+ "idx_post_site_root_draft_updated": {
1325
+ "name": "idx_post_site_root_draft_updated",
1326
+ "columns": ["site_id", "updated_at", "id"],
1327
+ "isUnique": false,
1328
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'draft'"
1329
+ },
1330
+ "idx_post_site_reply_thread_created": {
1331
+ "name": "idx_post_site_reply_thread_created",
1332
+ "columns": ["site_id", "thread_id", "created_at", "id"],
1333
+ "isUnique": false,
1334
+ "where": "\"post\".\"reply_to_id\" IS NOT NULL AND \"post\".\"status\" = 'published'"
1335
+ },
1336
+ "idx_post_site_featured_featured_at": {
1337
+ "name": "idx_post_site_featured_featured_at",
1338
+ "columns": ["site_id", "featured_at", "thread_id", "id"],
1339
+ "isUnique": false,
1340
+ "where": "\"post\".\"status\" = 'published' AND \"post\".\"featured_at\" IS NOT NULL"
1341
+ }
1342
+ },
1343
+ "foreignKeys": {
1344
+ "post_site_id_site_id_fk": {
1345
+ "name": "post_site_id_site_id_fk",
1346
+ "tableFrom": "post",
1347
+ "tableTo": "site",
1348
+ "columnsFrom": ["site_id"],
1349
+ "columnsTo": ["id"],
1350
+ "onDelete": "cascade",
1351
+ "onUpdate": "no action"
1352
+ },
1353
+ "post_site_id_reply_to_id_post_site_id_id_fk": {
1354
+ "name": "post_site_id_reply_to_id_post_site_id_id_fk",
1355
+ "tableFrom": "post",
1356
+ "tableTo": "post",
1357
+ "columnsFrom": ["site_id", "reply_to_id"],
1358
+ "columnsTo": ["site_id", "id"],
1359
+ "onDelete": "no action",
1360
+ "onUpdate": "no action"
1361
+ },
1362
+ "post_site_id_thread_id_post_site_id_id_fk": {
1363
+ "name": "post_site_id_thread_id_post_site_id_id_fk",
1364
+ "tableFrom": "post",
1365
+ "tableTo": "post",
1366
+ "columnsFrom": ["site_id", "thread_id"],
1367
+ "columnsTo": ["site_id", "id"],
1368
+ "onDelete": "no action",
1369
+ "onUpdate": "no action"
1370
+ }
1371
+ },
1372
+ "compositePrimaryKeys": {},
1373
+ "uniqueConstraints": {},
1374
+ "checkConstraints": {
1375
+ "chk_post_reply_to_not_self": {
1376
+ "name": "chk_post_reply_to_not_self",
1377
+ "value": "\"post\".\"reply_to_id\" IS NULL OR \"post\".\"reply_to_id\" <> \"post\".\"id\""
1378
+ },
1379
+ "chk_post_thread_shape": {
1380
+ "name": "chk_post_thread_shape",
1381
+ "value": "(\n \"post\".\"reply_to_id\" IS NULL\n AND \"post\".\"thread_id\" = \"post\".\"id\"\n ) OR (\n \"post\".\"reply_to_id\" IS NOT NULL\n AND \"post\".\"thread_id\" <> \"post\".\"id\"\n )"
1382
+ }
1383
+ }
1384
+ },
1385
+ "rate_limit": {
1386
+ "name": "rate_limit",
1387
+ "columns": {
1388
+ "key": {
1389
+ "name": "key",
1390
+ "type": "text",
1391
+ "primaryKey": false,
1392
+ "notNull": true,
1393
+ "autoincrement": false
1394
+ },
1395
+ "window_start": {
1396
+ "name": "window_start",
1397
+ "type": "integer",
1398
+ "primaryKey": false,
1399
+ "notNull": true,
1400
+ "autoincrement": false
1401
+ },
1402
+ "count": {
1403
+ "name": "count",
1404
+ "type": "integer",
1405
+ "primaryKey": false,
1406
+ "notNull": true,
1407
+ "autoincrement": false,
1408
+ "default": 0
1409
+ }
1410
+ },
1411
+ "indexes": {},
1412
+ "foreignKeys": {},
1413
+ "compositePrimaryKeys": {
1414
+ "rate_limit_key_window_start_pk": {
1415
+ "columns": ["key", "window_start"],
1416
+ "name": "rate_limit_key_window_start_pk"
1417
+ }
1418
+ },
1419
+ "uniqueConstraints": {},
1420
+ "checkConstraints": {}
1421
+ },
1422
+ "session": {
1423
+ "name": "session",
1424
+ "columns": {
1425
+ "id": {
1426
+ "name": "id",
1427
+ "type": "text",
1428
+ "primaryKey": true,
1429
+ "notNull": true,
1430
+ "autoincrement": false
1431
+ },
1432
+ "expires_at": {
1433
+ "name": "expires_at",
1434
+ "type": "integer",
1435
+ "primaryKey": false,
1436
+ "notNull": true,
1437
+ "autoincrement": false
1438
+ },
1439
+ "token": {
1440
+ "name": "token",
1441
+ "type": "text",
1442
+ "primaryKey": false,
1443
+ "notNull": true,
1444
+ "autoincrement": false
1445
+ },
1446
+ "created_at": {
1447
+ "name": "created_at",
1448
+ "type": "integer",
1449
+ "primaryKey": false,
1450
+ "notNull": true,
1451
+ "autoincrement": false
1452
+ },
1453
+ "updated_at": {
1454
+ "name": "updated_at",
1455
+ "type": "integer",
1456
+ "primaryKey": false,
1457
+ "notNull": true,
1458
+ "autoincrement": false
1459
+ },
1460
+ "ip_address": {
1461
+ "name": "ip_address",
1462
+ "type": "text",
1463
+ "primaryKey": false,
1464
+ "notNull": false,
1465
+ "autoincrement": false
1466
+ },
1467
+ "user_agent": {
1468
+ "name": "user_agent",
1469
+ "type": "text",
1470
+ "primaryKey": false,
1471
+ "notNull": false,
1472
+ "autoincrement": false
1473
+ },
1474
+ "user_id": {
1475
+ "name": "user_id",
1476
+ "type": "text",
1477
+ "primaryKey": false,
1478
+ "notNull": true,
1479
+ "autoincrement": false
1480
+ }
1481
+ },
1482
+ "indexes": {
1483
+ "session_token_unique": {
1484
+ "name": "session_token_unique",
1485
+ "columns": ["token"],
1486
+ "isUnique": true
1487
+ },
1488
+ "idx_session_user_id": {
1489
+ "name": "idx_session_user_id",
1490
+ "columns": ["user_id"],
1491
+ "isUnique": false
1492
+ }
1493
+ },
1494
+ "foreignKeys": {
1495
+ "session_user_id_user_id_fk": {
1496
+ "name": "session_user_id_user_id_fk",
1497
+ "tableFrom": "session",
1498
+ "tableTo": "user",
1499
+ "columnsFrom": ["user_id"],
1500
+ "columnsTo": ["id"],
1501
+ "onDelete": "no action",
1502
+ "onUpdate": "no action"
1503
+ }
1504
+ },
1505
+ "compositePrimaryKeys": {},
1506
+ "uniqueConstraints": {},
1507
+ "checkConstraints": {}
1508
+ },
1509
+ "site_setting": {
1510
+ "name": "site_setting",
1511
+ "columns": {
1512
+ "site_id": {
1513
+ "name": "site_id",
1514
+ "type": "text",
1515
+ "primaryKey": false,
1516
+ "notNull": true,
1517
+ "autoincrement": false
1518
+ },
1519
+ "key": {
1520
+ "name": "key",
1521
+ "type": "text",
1522
+ "primaryKey": false,
1523
+ "notNull": true,
1524
+ "autoincrement": false
1525
+ },
1526
+ "value": {
1527
+ "name": "value",
1528
+ "type": "text",
1529
+ "primaryKey": false,
1530
+ "notNull": true,
1531
+ "autoincrement": false
1532
+ },
1533
+ "updated_at": {
1534
+ "name": "updated_at",
1535
+ "type": "integer",
1536
+ "primaryKey": false,
1537
+ "notNull": true,
1538
+ "autoincrement": false
1539
+ }
1540
+ },
1541
+ "indexes": {
1542
+ "idx_site_setting_site_id": {
1543
+ "name": "idx_site_setting_site_id",
1544
+ "columns": ["site_id"],
1545
+ "isUnique": false
1546
+ }
1547
+ },
1548
+ "foreignKeys": {
1549
+ "site_setting_site_id_site_id_fk": {
1550
+ "name": "site_setting_site_id_site_id_fk",
1551
+ "tableFrom": "site_setting",
1552
+ "tableTo": "site",
1553
+ "columnsFrom": ["site_id"],
1554
+ "columnsTo": ["id"],
1555
+ "onDelete": "cascade",
1556
+ "onUpdate": "no action"
1557
+ }
1558
+ },
1559
+ "compositePrimaryKeys": {
1560
+ "site_setting_site_id_key_pk": {
1561
+ "columns": ["site_id", "key"],
1562
+ "name": "site_setting_site_id_key_pk"
1563
+ }
1564
+ },
1565
+ "uniqueConstraints": {},
1566
+ "checkConstraints": {}
1567
+ },
1568
+ "site_domain": {
1569
+ "name": "site_domain",
1570
+ "columns": {
1571
+ "id": {
1572
+ "name": "id",
1573
+ "type": "text",
1574
+ "primaryKey": true,
1575
+ "notNull": true,
1576
+ "autoincrement": false
1577
+ },
1578
+ "site_id": {
1579
+ "name": "site_id",
1580
+ "type": "text",
1581
+ "primaryKey": false,
1582
+ "notNull": true,
1583
+ "autoincrement": false
1584
+ },
1585
+ "host": {
1586
+ "name": "host",
1587
+ "type": "text",
1588
+ "primaryKey": false,
1589
+ "notNull": true,
1590
+ "autoincrement": false
1591
+ },
1592
+ "path_prefix": {
1593
+ "name": "path_prefix",
1594
+ "type": "text",
1595
+ "primaryKey": false,
1596
+ "notNull": false,
1597
+ "autoincrement": false
1598
+ },
1599
+ "kind": {
1600
+ "name": "kind",
1601
+ "type": "text",
1602
+ "primaryKey": false,
1603
+ "notNull": true,
1604
+ "autoincrement": false,
1605
+ "default": "'primary'"
1606
+ },
1607
+ "redirect_to_primary": {
1608
+ "name": "redirect_to_primary",
1609
+ "type": "integer",
1610
+ "primaryKey": false,
1611
+ "notNull": true,
1612
+ "autoincrement": false,
1613
+ "default": true
1614
+ },
1615
+ "created_at": {
1616
+ "name": "created_at",
1617
+ "type": "integer",
1618
+ "primaryKey": false,
1619
+ "notNull": true,
1620
+ "autoincrement": false
1621
+ },
1622
+ "updated_at": {
1623
+ "name": "updated_at",
1624
+ "type": "integer",
1625
+ "primaryKey": false,
1626
+ "notNull": true,
1627
+ "autoincrement": false
1628
+ }
1629
+ },
1630
+ "indexes": {
1631
+ "uq_site_domain_host": {
1632
+ "name": "uq_site_domain_host",
1633
+ "columns": ["host"],
1634
+ "isUnique": true
1635
+ },
1636
+ "idx_site_domain_site_id": {
1637
+ "name": "idx_site_domain_site_id",
1638
+ "columns": ["site_id"],
1639
+ "isUnique": false
1640
+ }
1641
+ },
1642
+ "foreignKeys": {
1643
+ "site_domain_site_id_site_id_fk": {
1644
+ "name": "site_domain_site_id_site_id_fk",
1645
+ "tableFrom": "site_domain",
1646
+ "tableTo": "site",
1647
+ "columnsFrom": ["site_id"],
1648
+ "columnsTo": ["id"],
1649
+ "onDelete": "cascade",
1650
+ "onUpdate": "no action"
1651
+ }
1652
+ },
1653
+ "compositePrimaryKeys": {},
1654
+ "uniqueConstraints": {},
1655
+ "checkConstraints": {
1656
+ "chk_site_domain_kind": {
1657
+ "name": "chk_site_domain_kind",
1658
+ "value": "\"site_domain\".\"kind\" IN ('primary', 'alias')"
1659
+ }
1660
+ }
1661
+ },
1662
+ "site_member": {
1663
+ "name": "site_member",
1664
+ "columns": {
1665
+ "site_id": {
1666
+ "name": "site_id",
1667
+ "type": "text",
1668
+ "primaryKey": false,
1669
+ "notNull": true,
1670
+ "autoincrement": false
1671
+ },
1672
+ "user_id": {
1673
+ "name": "user_id",
1674
+ "type": "text",
1675
+ "primaryKey": false,
1676
+ "notNull": true,
1677
+ "autoincrement": false
1678
+ },
1679
+ "role": {
1680
+ "name": "role",
1681
+ "type": "text",
1682
+ "primaryKey": false,
1683
+ "notNull": true,
1684
+ "autoincrement": false,
1685
+ "default": "'editor'"
1686
+ },
1687
+ "created_at": {
1688
+ "name": "created_at",
1689
+ "type": "integer",
1690
+ "primaryKey": false,
1691
+ "notNull": true,
1692
+ "autoincrement": false
1693
+ },
1694
+ "updated_at": {
1695
+ "name": "updated_at",
1696
+ "type": "integer",
1697
+ "primaryKey": false,
1698
+ "notNull": true,
1699
+ "autoincrement": false
1700
+ }
1701
+ },
1702
+ "indexes": {
1703
+ "idx_site_member_user_id": {
1704
+ "name": "idx_site_member_user_id",
1705
+ "columns": ["user_id"],
1706
+ "isUnique": false
1707
+ }
1708
+ },
1709
+ "foreignKeys": {
1710
+ "site_member_site_id_site_id_fk": {
1711
+ "name": "site_member_site_id_site_id_fk",
1712
+ "tableFrom": "site_member",
1713
+ "tableTo": "site",
1714
+ "columnsFrom": ["site_id"],
1715
+ "columnsTo": ["id"],
1716
+ "onDelete": "cascade",
1717
+ "onUpdate": "no action"
1718
+ }
1719
+ },
1720
+ "compositePrimaryKeys": {
1721
+ "site_member_site_id_user_id_pk": {
1722
+ "columns": ["site_id", "user_id"],
1723
+ "name": "site_member_site_id_user_id_pk"
1724
+ }
1725
+ },
1726
+ "uniqueConstraints": {},
1727
+ "checkConstraints": {
1728
+ "chk_site_member_role": {
1729
+ "name": "chk_site_member_role",
1730
+ "value": "\"site_member\".\"role\" IN ('owner', 'admin', 'editor')"
1731
+ }
1732
+ }
1733
+ },
1734
+ "site": {
1735
+ "name": "site",
1736
+ "columns": {
1737
+ "id": {
1738
+ "name": "id",
1739
+ "type": "text",
1740
+ "primaryKey": true,
1741
+ "notNull": true,
1742
+ "autoincrement": false
1743
+ },
1744
+ "key": {
1745
+ "name": "key",
1746
+ "type": "text",
1747
+ "primaryKey": false,
1748
+ "notNull": true,
1749
+ "autoincrement": false
1750
+ },
1751
+ "status": {
1752
+ "name": "status",
1753
+ "type": "text",
1754
+ "primaryKey": false,
1755
+ "notNull": true,
1756
+ "autoincrement": false,
1757
+ "default": "'active'"
1758
+ },
1759
+ "provisioning_idempotency_key": {
1760
+ "name": "provisioning_idempotency_key",
1761
+ "type": "text",
1762
+ "primaryKey": false,
1763
+ "notNull": false,
1764
+ "autoincrement": false
1765
+ },
1766
+ "created_at": {
1767
+ "name": "created_at",
1768
+ "type": "integer",
1769
+ "primaryKey": false,
1770
+ "notNull": true,
1771
+ "autoincrement": false
1772
+ },
1773
+ "updated_at": {
1774
+ "name": "updated_at",
1775
+ "type": "integer",
1776
+ "primaryKey": false,
1777
+ "notNull": true,
1778
+ "autoincrement": false
1779
+ }
1780
+ },
1781
+ "indexes": {
1782
+ "uq_site_key": {
1783
+ "name": "uq_site_key",
1784
+ "columns": ["key"],
1785
+ "isUnique": true
1786
+ },
1787
+ "uq_site_provisioning_idempotency_key": {
1788
+ "name": "uq_site_provisioning_idempotency_key",
1789
+ "columns": ["provisioning_idempotency_key"],
1790
+ "isUnique": true,
1791
+ "where": "\"site\".\"provisioning_idempotency_key\" IS NOT NULL"
1792
+ }
1793
+ },
1794
+ "foreignKeys": {},
1795
+ "compositePrimaryKeys": {},
1796
+ "uniqueConstraints": {},
1797
+ "checkConstraints": {
1798
+ "chk_site_status": {
1799
+ "name": "chk_site_status",
1800
+ "value": "\"site\".\"status\" IN ('active', 'suspended')"
1801
+ }
1802
+ }
1803
+ },
1804
+ "upload_session": {
1805
+ "name": "upload_session",
1806
+ "columns": {
1807
+ "id": {
1808
+ "name": "id",
1809
+ "type": "text",
1810
+ "primaryKey": true,
1811
+ "notNull": true,
1812
+ "autoincrement": false
1813
+ },
1814
+ "site_id": {
1815
+ "name": "site_id",
1816
+ "type": "text",
1817
+ "primaryKey": false,
1818
+ "notNull": true,
1819
+ "autoincrement": false
1820
+ },
1821
+ "media_id": {
1822
+ "name": "media_id",
1823
+ "type": "text",
1824
+ "primaryKey": false,
1825
+ "notNull": true,
1826
+ "autoincrement": false
1827
+ },
1828
+ "original_name": {
1829
+ "name": "original_name",
1830
+ "type": "text",
1831
+ "primaryKey": false,
1832
+ "notNull": true,
1833
+ "autoincrement": false
1834
+ },
1835
+ "filename": {
1836
+ "name": "filename",
1837
+ "type": "text",
1838
+ "primaryKey": false,
1839
+ "notNull": true,
1840
+ "autoincrement": false
1841
+ },
1842
+ "provider": {
1843
+ "name": "provider",
1844
+ "type": "text",
1845
+ "primaryKey": false,
1846
+ "notNull": true,
1847
+ "autoincrement": false
1848
+ },
1849
+ "expected_content_type": {
1850
+ "name": "expected_content_type",
1851
+ "type": "text",
1852
+ "primaryKey": false,
1853
+ "notNull": true,
1854
+ "autoincrement": false
1855
+ },
1856
+ "expected_size": {
1857
+ "name": "expected_size",
1858
+ "type": "integer",
1859
+ "primaryKey": false,
1860
+ "notNull": true,
1861
+ "autoincrement": false
1862
+ },
1863
+ "expected_checksum_sha256": {
1864
+ "name": "expected_checksum_sha256",
1865
+ "type": "text",
1866
+ "primaryKey": false,
1867
+ "notNull": false,
1868
+ "autoincrement": false
1869
+ },
1870
+ "content_disposition": {
1871
+ "name": "content_disposition",
1872
+ "type": "text",
1873
+ "primaryKey": false,
1874
+ "notNull": true,
1875
+ "autoincrement": false,
1876
+ "default": "'inline'"
1877
+ },
1878
+ "temp_storage_key": {
1879
+ "name": "temp_storage_key",
1880
+ "type": "text",
1881
+ "primaryKey": false,
1882
+ "notNull": true,
1883
+ "autoincrement": false
1884
+ },
1885
+ "final_storage_key": {
1886
+ "name": "final_storage_key",
1887
+ "type": "text",
1888
+ "primaryKey": false,
1889
+ "notNull": true,
1890
+ "autoincrement": false
1891
+ },
1892
+ "multipart_upload_id": {
1893
+ "name": "multipart_upload_id",
1894
+ "type": "text",
1895
+ "primaryKey": false,
1896
+ "notNull": false,
1897
+ "autoincrement": false
1898
+ },
1899
+ "state": {
1900
+ "name": "state",
1901
+ "type": "text",
1902
+ "primaryKey": false,
1903
+ "notNull": true,
1904
+ "autoincrement": false,
1905
+ "default": "'pending'"
1906
+ },
1907
+ "expires_at": {
1908
+ "name": "expires_at",
1909
+ "type": "integer",
1910
+ "primaryKey": false,
1911
+ "notNull": true,
1912
+ "autoincrement": false
1913
+ },
1914
+ "created_at": {
1915
+ "name": "created_at",
1916
+ "type": "integer",
1917
+ "primaryKey": false,
1918
+ "notNull": true,
1919
+ "autoincrement": false
1920
+ },
1921
+ "updated_at": {
1922
+ "name": "updated_at",
1923
+ "type": "integer",
1924
+ "primaryKey": false,
1925
+ "notNull": true,
1926
+ "autoincrement": false
1927
+ }
1928
+ },
1929
+ "indexes": {
1930
+ "uq_upload_session_media_id": {
1931
+ "name": "uq_upload_session_media_id",
1932
+ "columns": ["media_id"],
1933
+ "isUnique": true
1934
+ },
1935
+ "uq_upload_session_temp_storage_key": {
1936
+ "name": "uq_upload_session_temp_storage_key",
1937
+ "columns": ["temp_storage_key"],
1938
+ "isUnique": true
1939
+ },
1940
+ "uq_upload_session_final_storage_key": {
1941
+ "name": "uq_upload_session_final_storage_key",
1942
+ "columns": ["final_storage_key"],
1943
+ "isUnique": true
1944
+ },
1945
+ "idx_upload_session_site_state": {
1946
+ "name": "idx_upload_session_site_state",
1947
+ "columns": ["site_id", "state"],
1948
+ "isUnique": false
1949
+ },
1950
+ "idx_upload_session_site_expires_at": {
1951
+ "name": "idx_upload_session_site_expires_at",
1952
+ "columns": ["site_id", "expires_at"],
1953
+ "isUnique": false
1954
+ }
1955
+ },
1956
+ "foreignKeys": {
1957
+ "upload_session_site_id_site_id_fk": {
1958
+ "name": "upload_session_site_id_site_id_fk",
1959
+ "tableFrom": "upload_session",
1960
+ "tableTo": "site",
1961
+ "columnsFrom": ["site_id"],
1962
+ "columnsTo": ["id"],
1963
+ "onDelete": "cascade",
1964
+ "onUpdate": "no action"
1965
+ }
1966
+ },
1967
+ "compositePrimaryKeys": {},
1968
+ "uniqueConstraints": {},
1969
+ "checkConstraints": {
1970
+ "chk_upload_session_expected_size_positive": {
1971
+ "name": "chk_upload_session_expected_size_positive",
1972
+ "value": "\"upload_session\".\"expected_size\" > 0"
1973
+ },
1974
+ "chk_upload_session_state": {
1975
+ "name": "chk_upload_session_state",
1976
+ "value": "\"upload_session\".\"state\" IN ('pending', 'uploaded', 'completed', 'aborted', 'failed')"
1977
+ },
1978
+ "chk_upload_session_content_disposition": {
1979
+ "name": "chk_upload_session_content_disposition",
1980
+ "value": "\"upload_session\".\"content_disposition\" IN ('inline', 'attachment')"
1981
+ }
1982
+ }
1983
+ },
1984
+ "user": {
1985
+ "name": "user",
1986
+ "columns": {
1987
+ "id": {
1988
+ "name": "id",
1989
+ "type": "text",
1990
+ "primaryKey": true,
1991
+ "notNull": true,
1992
+ "autoincrement": false
1993
+ },
1994
+ "name": {
1995
+ "name": "name",
1996
+ "type": "text",
1997
+ "primaryKey": false,
1998
+ "notNull": true,
1999
+ "autoincrement": false
2000
+ },
2001
+ "email": {
2002
+ "name": "email",
2003
+ "type": "text",
2004
+ "primaryKey": false,
2005
+ "notNull": true,
2006
+ "autoincrement": false
2007
+ },
2008
+ "email_verified": {
2009
+ "name": "email_verified",
2010
+ "type": "integer",
2011
+ "primaryKey": false,
2012
+ "notNull": true,
2013
+ "autoincrement": false,
2014
+ "default": false
2015
+ },
2016
+ "image": {
2017
+ "name": "image",
2018
+ "type": "text",
2019
+ "primaryKey": false,
2020
+ "notNull": false,
2021
+ "autoincrement": false
2022
+ },
2023
+ "role": {
2024
+ "name": "role",
2025
+ "type": "text",
2026
+ "primaryKey": false,
2027
+ "notNull": false,
2028
+ "autoincrement": false,
2029
+ "default": "'member'"
2030
+ },
2031
+ "created_at": {
2032
+ "name": "created_at",
2033
+ "type": "integer",
2034
+ "primaryKey": false,
2035
+ "notNull": true,
2036
+ "autoincrement": false
2037
+ },
2038
+ "updated_at": {
2039
+ "name": "updated_at",
2040
+ "type": "integer",
2041
+ "primaryKey": false,
2042
+ "notNull": true,
2043
+ "autoincrement": false
2044
+ }
2045
+ },
2046
+ "indexes": {
2047
+ "user_email_unique": {
2048
+ "name": "user_email_unique",
2049
+ "columns": ["email"],
2050
+ "isUnique": true
2051
+ }
2052
+ },
2053
+ "foreignKeys": {},
2054
+ "compositePrimaryKeys": {},
2055
+ "uniqueConstraints": {},
2056
+ "checkConstraints": {}
2057
+ },
2058
+ "verification": {
2059
+ "name": "verification",
2060
+ "columns": {
2061
+ "id": {
2062
+ "name": "id",
2063
+ "type": "text",
2064
+ "primaryKey": true,
2065
+ "notNull": true,
2066
+ "autoincrement": false
2067
+ },
2068
+ "identifier": {
2069
+ "name": "identifier",
2070
+ "type": "text",
2071
+ "primaryKey": false,
2072
+ "notNull": true,
2073
+ "autoincrement": false
2074
+ },
2075
+ "value": {
2076
+ "name": "value",
2077
+ "type": "text",
2078
+ "primaryKey": false,
2079
+ "notNull": true,
2080
+ "autoincrement": false
2081
+ },
2082
+ "expires_at": {
2083
+ "name": "expires_at",
2084
+ "type": "integer",
2085
+ "primaryKey": false,
2086
+ "notNull": true,
2087
+ "autoincrement": false
2088
+ },
2089
+ "created_at": {
2090
+ "name": "created_at",
2091
+ "type": "integer",
2092
+ "primaryKey": false,
2093
+ "notNull": false,
2094
+ "autoincrement": false
2095
+ },
2096
+ "updated_at": {
2097
+ "name": "updated_at",
2098
+ "type": "integer",
2099
+ "primaryKey": false,
2100
+ "notNull": false,
2101
+ "autoincrement": false
2102
+ }
2103
+ },
2104
+ "indexes": {},
2105
+ "foreignKeys": {},
2106
+ "compositePrimaryKeys": {},
2107
+ "uniqueConstraints": {},
2108
+ "checkConstraints": {}
2109
+ }
2110
+ },
2111
+ "views": {},
2112
+ "enums": {},
2113
+ "_meta": {
2114
+ "schemas": {},
2115
+ "tables": {},
2116
+ "columns": {}
2117
+ },
2118
+ "internal": {
2119
+ "indexes": {}
2120
+ }
2121
+ }