@jant/core 0.3.46 → 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 (109) 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 +60 -267
  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-DB-P66E5.js → app-3REcR-3U.js} +331 -189
  15. package/dist/app-B67XOEyo.js +6 -0
  16. package/dist/client/.vite/manifest.json +2 -2
  17. package/dist/client/_assets/{client-auth-BLCUje4M.js → client-auth-Ce5WEAVS.js} +102 -49
  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/client/components/__tests__/jant-settings-avatar.test.ts +2 -0
  27. package/src/client/components/__tests__/jant-settings-general.test.ts +70 -0
  28. package/src/client/components/jant-settings-general.ts +164 -22
  29. package/src/client/components/settings-types.ts +4 -6
  30. package/src/client-auth.ts +1 -1
  31. package/src/db/__tests__/demo-canonical-snapshot.test.ts +1 -1
  32. package/src/db/__tests__/migration-rehearsal.test.ts +2 -5
  33. package/src/db/backfills/0004_register_apple_touch_media_rows.sql +65 -0
  34. package/src/db/migrations/0021_thankful_phalanx.sql +16 -0
  35. package/src/db/migrations/meta/0021_snapshot.json +2121 -0
  36. package/src/db/migrations/meta/_journal.json +7 -0
  37. package/src/db/migrations/pg/0019_gray_natasha_romanoff.sql +20 -0
  38. package/src/db/migrations/pg/meta/0019_snapshot.json +2718 -0
  39. package/src/db/migrations/pg/meta/_journal.json +7 -0
  40. package/src/db/pg/schema.ts +21 -26
  41. package/src/db/rehearsal-fixtures/demo-current.json +1 -1
  42. package/src/db/schema.ts +16 -20
  43. package/src/i18n/__tests__/middleware.test.ts +43 -1
  44. package/src/i18n/coverage.generated.ts +17 -0
  45. package/src/i18n/i18n.ts +18 -2
  46. package/src/i18n/index.ts +3 -0
  47. package/src/i18n/locales/settings/en.po +16 -11
  48. package/src/i18n/locales/settings/en.ts +1 -1
  49. package/src/i18n/locales/settings/zh-Hans.po +17 -12
  50. package/src/i18n/locales/settings/zh-Hans.ts +1 -1
  51. package/src/i18n/locales/settings/zh-Hant.po +16 -11
  52. package/src/i18n/locales/settings/zh-Hant.ts +1 -1
  53. package/src/i18n/locales.ts +84 -2
  54. package/src/i18n/middleware.ts +25 -16
  55. package/src/i18n/supported-locales.ts +153 -0
  56. package/src/lib/__tests__/csp-builder.test.ts +19 -2
  57. package/src/lib/__tests__/feed.test.ts +242 -1
  58. package/src/lib/__tests__/post-meta.test.ts +0 -1
  59. package/src/lib/__tests__/view.test.ts +0 -1
  60. package/src/lib/csp-builder.ts +28 -10
  61. package/src/lib/feed.ts +153 -3
  62. package/src/middleware/__tests__/secure-headers.test.ts +89 -0
  63. package/src/middleware/auth.ts +1 -1
  64. package/src/middleware/secure-headers.ts +47 -1
  65. package/src/node/__tests__/cli-runtime-target.test.ts +110 -2
  66. package/src/node/__tests__/cli-site-snapshot.test.ts +308 -13
  67. package/src/node/__tests__/cli-site-token-env.test.ts +2 -7
  68. package/src/node/__tests__/cli-snapshot-meta.test.ts +85 -0
  69. package/src/node/__tests__/cli-sql-export.test.ts +49 -0
  70. package/src/node/index.ts +1 -0
  71. package/src/preset.css +8 -2
  72. package/src/routes/api/__tests__/settings.test.ts +3 -2
  73. package/src/routes/api/github-sync.tsx +1 -1
  74. package/src/routes/api/settings.ts +4 -1
  75. package/src/routes/auth/signin.tsx +6 -0
  76. package/src/routes/pages/archive.tsx +4 -2
  77. package/src/services/__tests__/post.test.ts +19 -19
  78. package/src/services/__tests__/search.test.ts +0 -1
  79. package/src/services/__tests__/settings.test.ts +22 -3
  80. package/src/services/bootstrap.ts +7 -3
  81. package/src/services/collection.ts +3 -3
  82. package/src/services/export.ts +0 -3
  83. package/src/services/navigation.ts +0 -2
  84. package/src/services/path.ts +1 -38
  85. package/src/services/post.ts +32 -66
  86. package/src/services/search.ts +0 -6
  87. package/src/services/settings.ts +47 -6
  88. package/src/services/site-admin.ts +6 -1
  89. package/src/styles/ui.css +12 -23
  90. package/src/types/entities.ts +0 -1
  91. package/src/ui/color-themes.ts +1 -1
  92. package/src/ui/dash/settings/GeneralContent.tsx +17 -19
  93. package/src/ui/dash/settings/SettingsRootContent.tsx +17 -28
  94. package/src/ui/feed/NoteCard.tsx +1 -11
  95. package/src/ui/feed/__tests__/timeline-cards.test.ts +1 -1
  96. package/src/ui/pages/PostPage.tsx +2 -0
  97. package/bin/commands/collections.js +0 -268
  98. package/bin/commands/media.js +0 -302
  99. package/bin/commands/posts.js +0 -262
  100. package/bin/commands/search.js +0 -53
  101. package/bin/commands/settings.js +0 -93
  102. package/bin/lib/http-api.js +0 -223
  103. package/bin/lib/media-upload.js +0 -206
  104. package/dist/app-CM7sb3xO.js +0 -5
  105. package/dist/client/_assets/client-DDs6NzB3.css +0 -2
  106. package/src/__tests__/bin/content-cli.test.ts +0 -179
  107. package/src/__tests__/bin/media-cli.test.ts +0 -192
  108. /package/dist/{github-api-BkRWnqMx.js → github-api-Bh0PH3zr.js} +0 -0
  109. /package/dist/{github-app-WeadXMb8.js → github-app-D0GvNnqp.js} +0 -0
@@ -0,0 +1,2718 @@
1
+ {
2
+ "id": "501a3f31-9836-4746-8cab-99a5beede475",
3
+ "prevId": "bb4b8e68-8e9b-4c2f-ad80-cb1807235945",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "account_id": {
18
+ "name": "account_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "provider_id": {
24
+ "name": "provider_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "user_id": {
30
+ "name": "user_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "id_token": {
48
+ "name": "id_token",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "access_token_expires_at": {
54
+ "name": "access_token_expires_at",
55
+ "type": "timestamp with time zone",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "refresh_token_expires_at": {
60
+ "name": "refresh_token_expires_at",
61
+ "type": "timestamp with time zone",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "scope": {
66
+ "name": "scope",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp with time zone",
80
+ "primaryKey": false,
81
+ "notNull": true
82
+ },
83
+ "updated_at": {
84
+ "name": "updated_at",
85
+ "type": "timestamp with time zone",
86
+ "primaryKey": false,
87
+ "notNull": true
88
+ }
89
+ },
90
+ "indexes": {},
91
+ "foreignKeys": {
92
+ "account_user_id_user_id_fk": {
93
+ "name": "account_user_id_user_id_fk",
94
+ "tableFrom": "account",
95
+ "tableTo": "user",
96
+ "columnsFrom": ["user_id"],
97
+ "columnsTo": ["id"],
98
+ "onDelete": "no action",
99
+ "onUpdate": "no action"
100
+ }
101
+ },
102
+ "compositePrimaryKeys": {},
103
+ "uniqueConstraints": {},
104
+ "policies": {},
105
+ "checkConstraints": {},
106
+ "isRLSEnabled": false
107
+ },
108
+ "public.api_token": {
109
+ "name": "api_token",
110
+ "schema": "",
111
+ "columns": {
112
+ "id": {
113
+ "name": "id",
114
+ "type": "text",
115
+ "primaryKey": true,
116
+ "notNull": true
117
+ },
118
+ "site_id": {
119
+ "name": "site_id",
120
+ "type": "text",
121
+ "primaryKey": false,
122
+ "notNull": true
123
+ },
124
+ "name": {
125
+ "name": "name",
126
+ "type": "text",
127
+ "primaryKey": false,
128
+ "notNull": true
129
+ },
130
+ "token_hash": {
131
+ "name": "token_hash",
132
+ "type": "text",
133
+ "primaryKey": false,
134
+ "notNull": true
135
+ },
136
+ "prefix": {
137
+ "name": "prefix",
138
+ "type": "text",
139
+ "primaryKey": false,
140
+ "notNull": true
141
+ },
142
+ "last_used_at": {
143
+ "name": "last_used_at",
144
+ "type": "integer",
145
+ "primaryKey": false,
146
+ "notNull": false
147
+ },
148
+ "created_at": {
149
+ "name": "created_at",
150
+ "type": "integer",
151
+ "primaryKey": false,
152
+ "notNull": true
153
+ },
154
+ "updated_at": {
155
+ "name": "updated_at",
156
+ "type": "integer",
157
+ "primaryKey": false,
158
+ "notNull": true
159
+ }
160
+ },
161
+ "indexes": {
162
+ "idx_api_token_site_id": {
163
+ "name": "idx_api_token_site_id",
164
+ "columns": [
165
+ {
166
+ "expression": "site_id",
167
+ "isExpression": false,
168
+ "asc": true,
169
+ "nulls": "last"
170
+ }
171
+ ],
172
+ "isUnique": false,
173
+ "concurrently": false,
174
+ "method": "btree",
175
+ "with": {}
176
+ }
177
+ },
178
+ "foreignKeys": {
179
+ "api_token_site_id_site_id_fk": {
180
+ "name": "api_token_site_id_site_id_fk",
181
+ "tableFrom": "api_token",
182
+ "tableTo": "site",
183
+ "columnsFrom": ["site_id"],
184
+ "columnsTo": ["id"],
185
+ "onDelete": "cascade",
186
+ "onUpdate": "no action"
187
+ }
188
+ },
189
+ "compositePrimaryKeys": {},
190
+ "uniqueConstraints": {
191
+ "api_token_token_hash_unique": {
192
+ "name": "api_token_token_hash_unique",
193
+ "nullsNotDistinct": false,
194
+ "columns": ["token_hash"]
195
+ }
196
+ },
197
+ "policies": {},
198
+ "checkConstraints": {},
199
+ "isRLSEnabled": false
200
+ },
201
+ "public.collection_directory_item": {
202
+ "name": "collection_directory_item",
203
+ "schema": "",
204
+ "columns": {
205
+ "id": {
206
+ "name": "id",
207
+ "type": "text",
208
+ "primaryKey": true,
209
+ "notNull": true
210
+ },
211
+ "site_id": {
212
+ "name": "site_id",
213
+ "type": "text",
214
+ "primaryKey": false,
215
+ "notNull": true
216
+ },
217
+ "type": {
218
+ "name": "type",
219
+ "type": "text",
220
+ "primaryKey": false,
221
+ "notNull": true
222
+ },
223
+ "collection_id": {
224
+ "name": "collection_id",
225
+ "type": "text",
226
+ "primaryKey": false,
227
+ "notNull": false
228
+ },
229
+ "label": {
230
+ "name": "label",
231
+ "type": "text",
232
+ "primaryKey": false,
233
+ "notNull": false
234
+ },
235
+ "url": {
236
+ "name": "url",
237
+ "type": "text",
238
+ "primaryKey": false,
239
+ "notNull": false
240
+ },
241
+ "description": {
242
+ "name": "description",
243
+ "type": "text",
244
+ "primaryKey": false,
245
+ "notNull": false
246
+ },
247
+ "position": {
248
+ "name": "position",
249
+ "type": "text",
250
+ "primaryKey": false,
251
+ "notNull": true,
252
+ "default": "'a0'"
253
+ },
254
+ "created_at": {
255
+ "name": "created_at",
256
+ "type": "integer",
257
+ "primaryKey": false,
258
+ "notNull": true
259
+ },
260
+ "updated_at": {
261
+ "name": "updated_at",
262
+ "type": "integer",
263
+ "primaryKey": false,
264
+ "notNull": true
265
+ }
266
+ },
267
+ "indexes": {
268
+ "idx_collection_directory_item_site_collection_id": {
269
+ "name": "idx_collection_directory_item_site_collection_id",
270
+ "columns": [
271
+ {
272
+ "expression": "site_id",
273
+ "isExpression": false,
274
+ "asc": true,
275
+ "nulls": "last"
276
+ },
277
+ {
278
+ "expression": "collection_id",
279
+ "isExpression": false,
280
+ "asc": true,
281
+ "nulls": "last"
282
+ }
283
+ ],
284
+ "isUnique": false,
285
+ "concurrently": false,
286
+ "method": "btree",
287
+ "with": {}
288
+ },
289
+ "uq_collection_directory_item_site_position": {
290
+ "name": "uq_collection_directory_item_site_position",
291
+ "columns": [
292
+ {
293
+ "expression": "site_id",
294
+ "isExpression": false,
295
+ "asc": true,
296
+ "nulls": "last"
297
+ },
298
+ {
299
+ "expression": "position",
300
+ "isExpression": false,
301
+ "asc": true,
302
+ "nulls": "last"
303
+ }
304
+ ],
305
+ "isUnique": true,
306
+ "concurrently": false,
307
+ "method": "btree",
308
+ "with": {}
309
+ },
310
+ "uq_collection_directory_item_site_collection_once": {
311
+ "name": "uq_collection_directory_item_site_collection_once",
312
+ "columns": [
313
+ {
314
+ "expression": "site_id",
315
+ "isExpression": false,
316
+ "asc": true,
317
+ "nulls": "last"
318
+ },
319
+ {
320
+ "expression": "collection_id",
321
+ "isExpression": false,
322
+ "asc": true,
323
+ "nulls": "last"
324
+ }
325
+ ],
326
+ "isUnique": true,
327
+ "where": "\"collection_directory_item\".\"type\" = 'collection' AND \"collection_directory_item\".\"collection_id\" IS NOT NULL",
328
+ "concurrently": false,
329
+ "method": "btree",
330
+ "with": {}
331
+ }
332
+ },
333
+ "foreignKeys": {
334
+ "collection_directory_item_site_id_site_id_fk": {
335
+ "name": "collection_directory_item_site_id_site_id_fk",
336
+ "tableFrom": "collection_directory_item",
337
+ "tableTo": "site",
338
+ "columnsFrom": ["site_id"],
339
+ "columnsTo": ["id"],
340
+ "onDelete": "cascade",
341
+ "onUpdate": "no action"
342
+ },
343
+ "collection_directory_item_collection_id_collection_id_fk": {
344
+ "name": "collection_directory_item_collection_id_collection_id_fk",
345
+ "tableFrom": "collection_directory_item",
346
+ "tableTo": "collection",
347
+ "columnsFrom": ["collection_id"],
348
+ "columnsTo": ["id"],
349
+ "onDelete": "cascade",
350
+ "onUpdate": "no action"
351
+ }
352
+ },
353
+ "compositePrimaryKeys": {},
354
+ "uniqueConstraints": {},
355
+ "policies": {},
356
+ "checkConstraints": {
357
+ "chk_collection_directory_item_type": {
358
+ "name": "chk_collection_directory_item_type",
359
+ "value": "\"collection_directory_item\".\"type\" IN ('collection', 'divider', 'link')"
360
+ },
361
+ "chk_collection_directory_item_shape": {
362
+ "name": "chk_collection_directory_item_shape",
363
+ "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 )"
364
+ },
365
+ "chk_collection_directory_item_label": {
366
+ "name": "chk_collection_directory_item_label",
367
+ "value": "\"collection_directory_item\".\"type\" <> 'collection' OR \"collection_directory_item\".\"label\" IS NULL"
368
+ },
369
+ "chk_collection_directory_item_description": {
370
+ "name": "chk_collection_directory_item_description",
371
+ "value": "\"collection_directory_item\".\"type\" = 'link' OR \"collection_directory_item\".\"description\" IS NULL"
372
+ }
373
+ },
374
+ "isRLSEnabled": false
375
+ },
376
+ "public.collection": {
377
+ "name": "collection",
378
+ "schema": "",
379
+ "columns": {
380
+ "id": {
381
+ "name": "id",
382
+ "type": "text",
383
+ "primaryKey": true,
384
+ "notNull": true
385
+ },
386
+ "site_id": {
387
+ "name": "site_id",
388
+ "type": "text",
389
+ "primaryKey": false,
390
+ "notNull": true
391
+ },
392
+ "title": {
393
+ "name": "title",
394
+ "type": "text",
395
+ "primaryKey": false,
396
+ "notNull": true
397
+ },
398
+ "description": {
399
+ "name": "description",
400
+ "type": "text",
401
+ "primaryKey": false,
402
+ "notNull": false
403
+ },
404
+ "sort_order": {
405
+ "name": "sort_order",
406
+ "type": "text",
407
+ "primaryKey": false,
408
+ "notNull": true,
409
+ "default": "'newest'"
410
+ },
411
+ "created_at": {
412
+ "name": "created_at",
413
+ "type": "integer",
414
+ "primaryKey": false,
415
+ "notNull": true
416
+ },
417
+ "updated_at": {
418
+ "name": "updated_at",
419
+ "type": "integer",
420
+ "primaryKey": false,
421
+ "notNull": true
422
+ }
423
+ },
424
+ "indexes": {
425
+ "idx_collection_site_created_at": {
426
+ "name": "idx_collection_site_created_at",
427
+ "columns": [
428
+ {
429
+ "expression": "site_id",
430
+ "isExpression": false,
431
+ "asc": true,
432
+ "nulls": "last"
433
+ },
434
+ {
435
+ "expression": "created_at",
436
+ "isExpression": false,
437
+ "asc": true,
438
+ "nulls": "last"
439
+ }
440
+ ],
441
+ "isUnique": false,
442
+ "concurrently": false,
443
+ "method": "btree",
444
+ "with": {}
445
+ }
446
+ },
447
+ "foreignKeys": {
448
+ "collection_site_id_site_id_fk": {
449
+ "name": "collection_site_id_site_id_fk",
450
+ "tableFrom": "collection",
451
+ "tableTo": "site",
452
+ "columnsFrom": ["site_id"],
453
+ "columnsTo": ["id"],
454
+ "onDelete": "cascade",
455
+ "onUpdate": "no action"
456
+ }
457
+ },
458
+ "compositePrimaryKeys": {},
459
+ "uniqueConstraints": {},
460
+ "policies": {},
461
+ "checkConstraints": {
462
+ "chk_collection_sort_order": {
463
+ "name": "chk_collection_sort_order",
464
+ "value": "\"collection\".\"sort_order\" IN ('newest', 'oldest', 'rating_desc')"
465
+ }
466
+ },
467
+ "isRLSEnabled": false
468
+ },
469
+ "public.github_app_installation": {
470
+ "name": "github_app_installation",
471
+ "schema": "",
472
+ "columns": {
473
+ "installation_id": {
474
+ "name": "installation_id",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true
478
+ },
479
+ "site_id": {
480
+ "name": "site_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "account_login": {
486
+ "name": "account_login",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "account_type": {
492
+ "name": "account_type",
493
+ "type": "text",
494
+ "primaryKey": false,
495
+ "notNull": true
496
+ },
497
+ "account_avatar_url": {
498
+ "name": "account_avatar_url",
499
+ "type": "text",
500
+ "primaryKey": false,
501
+ "notNull": true,
502
+ "default": "''"
503
+ },
504
+ "added_at": {
505
+ "name": "added_at",
506
+ "type": "integer",
507
+ "primaryKey": false,
508
+ "notNull": true
509
+ }
510
+ },
511
+ "indexes": {
512
+ "github_app_installation_by_installation": {
513
+ "name": "github_app_installation_by_installation",
514
+ "columns": [
515
+ {
516
+ "expression": "installation_id",
517
+ "isExpression": false,
518
+ "asc": true,
519
+ "nulls": "last"
520
+ }
521
+ ],
522
+ "isUnique": false,
523
+ "concurrently": false,
524
+ "method": "btree",
525
+ "with": {}
526
+ },
527
+ "github_app_installation_by_site": {
528
+ "name": "github_app_installation_by_site",
529
+ "columns": [
530
+ {
531
+ "expression": "site_id",
532
+ "isExpression": false,
533
+ "asc": true,
534
+ "nulls": "last"
535
+ }
536
+ ],
537
+ "isUnique": false,
538
+ "concurrently": false,
539
+ "method": "btree",
540
+ "with": {}
541
+ }
542
+ },
543
+ "foreignKeys": {
544
+ "github_app_installation_site_id_site_id_fk": {
545
+ "name": "github_app_installation_site_id_site_id_fk",
546
+ "tableFrom": "github_app_installation",
547
+ "tableTo": "site",
548
+ "columnsFrom": ["site_id"],
549
+ "columnsTo": ["id"],
550
+ "onDelete": "cascade",
551
+ "onUpdate": "no action"
552
+ }
553
+ },
554
+ "compositePrimaryKeys": {
555
+ "github_app_installation_installation_id_site_id_pk": {
556
+ "name": "github_app_installation_installation_id_site_id_pk",
557
+ "columns": ["installation_id", "site_id"]
558
+ }
559
+ },
560
+ "uniqueConstraints": {},
561
+ "policies": {},
562
+ "checkConstraints": {
563
+ "chk_github_app_installation_account_type": {
564
+ "name": "chk_github_app_installation_account_type",
565
+ "value": "\"github_app_installation\".\"account_type\" IN ('User', 'Organization')"
566
+ }
567
+ },
568
+ "isRLSEnabled": false
569
+ },
570
+ "public.media": {
571
+ "name": "media",
572
+ "schema": "",
573
+ "columns": {
574
+ "id": {
575
+ "name": "id",
576
+ "type": "text",
577
+ "primaryKey": true,
578
+ "notNull": true
579
+ },
580
+ "site_id": {
581
+ "name": "site_id",
582
+ "type": "text",
583
+ "primaryKey": false,
584
+ "notNull": true
585
+ },
586
+ "post_id": {
587
+ "name": "post_id",
588
+ "type": "text",
589
+ "primaryKey": false,
590
+ "notNull": false
591
+ },
592
+ "filename": {
593
+ "name": "filename",
594
+ "type": "text",
595
+ "primaryKey": false,
596
+ "notNull": true
597
+ },
598
+ "original_name": {
599
+ "name": "original_name",
600
+ "type": "text",
601
+ "primaryKey": false,
602
+ "notNull": true
603
+ },
604
+ "mime_type": {
605
+ "name": "mime_type",
606
+ "type": "text",
607
+ "primaryKey": false,
608
+ "notNull": true
609
+ },
610
+ "size": {
611
+ "name": "size",
612
+ "type": "integer",
613
+ "primaryKey": false,
614
+ "notNull": true
615
+ },
616
+ "storage_key": {
617
+ "name": "storage_key",
618
+ "type": "text",
619
+ "primaryKey": false,
620
+ "notNull": true
621
+ },
622
+ "provider": {
623
+ "name": "provider",
624
+ "type": "text",
625
+ "primaryKey": false,
626
+ "notNull": true,
627
+ "default": "'r2'"
628
+ },
629
+ "width": {
630
+ "name": "width",
631
+ "type": "integer",
632
+ "primaryKey": false,
633
+ "notNull": false
634
+ },
635
+ "height": {
636
+ "name": "height",
637
+ "type": "integer",
638
+ "primaryKey": false,
639
+ "notNull": false
640
+ },
641
+ "duration_seconds": {
642
+ "name": "duration_seconds",
643
+ "type": "integer",
644
+ "primaryKey": false,
645
+ "notNull": false
646
+ },
647
+ "alt": {
648
+ "name": "alt",
649
+ "type": "text",
650
+ "primaryKey": false,
651
+ "notNull": false
652
+ },
653
+ "position": {
654
+ "name": "position",
655
+ "type": "text",
656
+ "primaryKey": false,
657
+ "notNull": true,
658
+ "default": "'a0'"
659
+ },
660
+ "blurhash": {
661
+ "name": "blurhash",
662
+ "type": "text",
663
+ "primaryKey": false,
664
+ "notNull": false
665
+ },
666
+ "waveform": {
667
+ "name": "waveform",
668
+ "type": "text",
669
+ "primaryKey": false,
670
+ "notNull": false
671
+ },
672
+ "poster_key": {
673
+ "name": "poster_key",
674
+ "type": "text",
675
+ "primaryKey": false,
676
+ "notNull": false
677
+ },
678
+ "summary": {
679
+ "name": "summary",
680
+ "type": "text",
681
+ "primaryKey": false,
682
+ "notNull": false
683
+ },
684
+ "chars": {
685
+ "name": "chars",
686
+ "type": "integer",
687
+ "primaryKey": false,
688
+ "notNull": false
689
+ },
690
+ "media_kind": {
691
+ "name": "media_kind",
692
+ "type": "text",
693
+ "primaryKey": false,
694
+ "notNull": true,
695
+ "default": "'document'"
696
+ },
697
+ "created_at": {
698
+ "name": "created_at",
699
+ "type": "integer",
700
+ "primaryKey": false,
701
+ "notNull": true
702
+ },
703
+ "updated_at": {
704
+ "name": "updated_at",
705
+ "type": "integer",
706
+ "primaryKey": false,
707
+ "notNull": true
708
+ }
709
+ },
710
+ "indexes": {
711
+ "idx_media_site_post_id_position": {
712
+ "name": "idx_media_site_post_id_position",
713
+ "columns": [
714
+ {
715
+ "expression": "site_id",
716
+ "isExpression": false,
717
+ "asc": true,
718
+ "nulls": "last"
719
+ },
720
+ {
721
+ "expression": "post_id",
722
+ "isExpression": false,
723
+ "asc": true,
724
+ "nulls": "last"
725
+ },
726
+ {
727
+ "expression": "position",
728
+ "isExpression": false,
729
+ "asc": true,
730
+ "nulls": "last"
731
+ }
732
+ ],
733
+ "isUnique": false,
734
+ "concurrently": false,
735
+ "method": "btree",
736
+ "with": {}
737
+ },
738
+ "uq_media_site_post_position": {
739
+ "name": "uq_media_site_post_position",
740
+ "columns": [
741
+ {
742
+ "expression": "site_id",
743
+ "isExpression": false,
744
+ "asc": true,
745
+ "nulls": "last"
746
+ },
747
+ {
748
+ "expression": "post_id",
749
+ "isExpression": false,
750
+ "asc": true,
751
+ "nulls": "last"
752
+ },
753
+ {
754
+ "expression": "position",
755
+ "isExpression": false,
756
+ "asc": true,
757
+ "nulls": "last"
758
+ }
759
+ ],
760
+ "isUnique": true,
761
+ "where": "\"media\".\"post_id\" IS NOT NULL",
762
+ "concurrently": false,
763
+ "method": "btree",
764
+ "with": {}
765
+ },
766
+ "uq_media_provider_storage_key": {
767
+ "name": "uq_media_provider_storage_key",
768
+ "columns": [
769
+ {
770
+ "expression": "provider",
771
+ "isExpression": false,
772
+ "asc": true,
773
+ "nulls": "last"
774
+ },
775
+ {
776
+ "expression": "storage_key",
777
+ "isExpression": false,
778
+ "asc": true,
779
+ "nulls": "last"
780
+ }
781
+ ],
782
+ "isUnique": true,
783
+ "concurrently": false,
784
+ "method": "btree",
785
+ "with": {}
786
+ },
787
+ "idx_media_site_media_kind_post_id": {
788
+ "name": "idx_media_site_media_kind_post_id",
789
+ "columns": [
790
+ {
791
+ "expression": "site_id",
792
+ "isExpression": false,
793
+ "asc": true,
794
+ "nulls": "last"
795
+ },
796
+ {
797
+ "expression": "media_kind",
798
+ "isExpression": false,
799
+ "asc": true,
800
+ "nulls": "last"
801
+ },
802
+ {
803
+ "expression": "post_id",
804
+ "isExpression": false,
805
+ "asc": true,
806
+ "nulls": "last"
807
+ }
808
+ ],
809
+ "isUnique": false,
810
+ "concurrently": false,
811
+ "method": "btree",
812
+ "with": {}
813
+ }
814
+ },
815
+ "foreignKeys": {
816
+ "media_site_id_site_id_fk": {
817
+ "name": "media_site_id_site_id_fk",
818
+ "tableFrom": "media",
819
+ "tableTo": "site",
820
+ "columnsFrom": ["site_id"],
821
+ "columnsTo": ["id"],
822
+ "onDelete": "cascade",
823
+ "onUpdate": "no action"
824
+ },
825
+ "media_post_id_post_id_fk": {
826
+ "name": "media_post_id_post_id_fk",
827
+ "tableFrom": "media",
828
+ "tableTo": "post",
829
+ "columnsFrom": ["post_id"],
830
+ "columnsTo": ["id"],
831
+ "onDelete": "set null",
832
+ "onUpdate": "no action"
833
+ }
834
+ },
835
+ "compositePrimaryKeys": {},
836
+ "uniqueConstraints": {},
837
+ "policies": {},
838
+ "checkConstraints": {
839
+ "chk_media_size_positive": {
840
+ "name": "chk_media_size_positive",
841
+ "value": "\"media\".\"size\" > 0"
842
+ },
843
+ "chk_media_position_not_blank": {
844
+ "name": "chk_media_position_not_blank",
845
+ "value": "trim(\"media\".\"position\") <> ''"
846
+ },
847
+ "chk_media_dimensions_positive": {
848
+ "name": "chk_media_dimensions_positive",
849
+ "value": "(\n \"media\".\"width\" IS NULL OR \"media\".\"width\" > 0\n ) AND (\n \"media\".\"height\" IS NULL OR \"media\".\"height\" > 0\n )"
850
+ },
851
+ "chk_media_chars_nonnegative": {
852
+ "name": "chk_media_chars_nonnegative",
853
+ "value": "\"media\".\"chars\" IS NULL OR \"media\".\"chars\" >= 0"
854
+ }
855
+ },
856
+ "isRLSEnabled": false
857
+ },
858
+ "public.nav_item": {
859
+ "name": "nav_item",
860
+ "schema": "",
861
+ "columns": {
862
+ "id": {
863
+ "name": "id",
864
+ "type": "text",
865
+ "primaryKey": true,
866
+ "notNull": true
867
+ },
868
+ "site_id": {
869
+ "name": "site_id",
870
+ "type": "text",
871
+ "primaryKey": false,
872
+ "notNull": true
873
+ },
874
+ "type": {
875
+ "name": "type",
876
+ "type": "text",
877
+ "primaryKey": false,
878
+ "notNull": true,
879
+ "default": "'link'"
880
+ },
881
+ "system_key": {
882
+ "name": "system_key",
883
+ "type": "text",
884
+ "primaryKey": false,
885
+ "notNull": false
886
+ },
887
+ "collection_id": {
888
+ "name": "collection_id",
889
+ "type": "text",
890
+ "primaryKey": false,
891
+ "notNull": false
892
+ },
893
+ "label": {
894
+ "name": "label",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": true
898
+ },
899
+ "url": {
900
+ "name": "url",
901
+ "type": "text",
902
+ "primaryKey": false,
903
+ "notNull": true
904
+ },
905
+ "placement": {
906
+ "name": "placement",
907
+ "type": "text",
908
+ "primaryKey": false,
909
+ "notNull": true,
910
+ "default": "'header'"
911
+ },
912
+ "position": {
913
+ "name": "position",
914
+ "type": "text",
915
+ "primaryKey": false,
916
+ "notNull": true,
917
+ "default": "'a0'"
918
+ },
919
+ "created_at": {
920
+ "name": "created_at",
921
+ "type": "integer",
922
+ "primaryKey": false,
923
+ "notNull": true
924
+ },
925
+ "updated_at": {
926
+ "name": "updated_at",
927
+ "type": "integer",
928
+ "primaryKey": false,
929
+ "notNull": true
930
+ }
931
+ },
932
+ "indexes": {
933
+ "uq_nav_item_site_position": {
934
+ "name": "uq_nav_item_site_position",
935
+ "columns": [
936
+ {
937
+ "expression": "site_id",
938
+ "isExpression": false,
939
+ "asc": true,
940
+ "nulls": "last"
941
+ },
942
+ {
943
+ "expression": "position",
944
+ "isExpression": false,
945
+ "asc": true,
946
+ "nulls": "last"
947
+ }
948
+ ],
949
+ "isUnique": true,
950
+ "concurrently": false,
951
+ "method": "btree",
952
+ "with": {}
953
+ },
954
+ "uq_nav_item_site_system_key": {
955
+ "name": "uq_nav_item_site_system_key",
956
+ "columns": [
957
+ {
958
+ "expression": "site_id",
959
+ "isExpression": false,
960
+ "asc": true,
961
+ "nulls": "last"
962
+ },
963
+ {
964
+ "expression": "system_key",
965
+ "isExpression": false,
966
+ "asc": true,
967
+ "nulls": "last"
968
+ }
969
+ ],
970
+ "isUnique": true,
971
+ "where": "\"nav_item\".\"system_key\" IS NOT NULL",
972
+ "concurrently": false,
973
+ "method": "btree",
974
+ "with": {}
975
+ },
976
+ "uq_nav_item_site_collection_id": {
977
+ "name": "uq_nav_item_site_collection_id",
978
+ "columns": [
979
+ {
980
+ "expression": "site_id",
981
+ "isExpression": false,
982
+ "asc": true,
983
+ "nulls": "last"
984
+ },
985
+ {
986
+ "expression": "collection_id",
987
+ "isExpression": false,
988
+ "asc": true,
989
+ "nulls": "last"
990
+ }
991
+ ],
992
+ "isUnique": true,
993
+ "where": "\"nav_item\".\"collection_id\" IS NOT NULL",
994
+ "concurrently": false,
995
+ "method": "btree",
996
+ "with": {}
997
+ }
998
+ },
999
+ "foreignKeys": {
1000
+ "nav_item_site_id_site_id_fk": {
1001
+ "name": "nav_item_site_id_site_id_fk",
1002
+ "tableFrom": "nav_item",
1003
+ "tableTo": "site",
1004
+ "columnsFrom": ["site_id"],
1005
+ "columnsTo": ["id"],
1006
+ "onDelete": "cascade",
1007
+ "onUpdate": "no action"
1008
+ },
1009
+ "nav_item_collection_id_collection_id_fk": {
1010
+ "name": "nav_item_collection_id_collection_id_fk",
1011
+ "tableFrom": "nav_item",
1012
+ "tableTo": "collection",
1013
+ "columnsFrom": ["collection_id"],
1014
+ "columnsTo": ["id"],
1015
+ "onDelete": "cascade",
1016
+ "onUpdate": "no action"
1017
+ }
1018
+ },
1019
+ "compositePrimaryKeys": {},
1020
+ "uniqueConstraints": {},
1021
+ "policies": {},
1022
+ "checkConstraints": {
1023
+ "chk_nav_item_type": {
1024
+ "name": "chk_nav_item_type",
1025
+ "value": "\"nav_item\".\"type\" IN ('link', 'system', 'collection')"
1026
+ },
1027
+ "chk_nav_item_placement": {
1028
+ "name": "chk_nav_item_placement",
1029
+ "value": "\"nav_item\".\"placement\" IN ('header', 'more')"
1030
+ },
1031
+ "chk_nav_item_shape": {
1032
+ "name": "chk_nav_item_shape",
1033
+ "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 )"
1034
+ }
1035
+ },
1036
+ "isRLSEnabled": false
1037
+ },
1038
+ "public.path_registry": {
1039
+ "name": "path_registry",
1040
+ "schema": "",
1041
+ "columns": {
1042
+ "id": {
1043
+ "name": "id",
1044
+ "type": "text",
1045
+ "primaryKey": true,
1046
+ "notNull": true
1047
+ },
1048
+ "site_id": {
1049
+ "name": "site_id",
1050
+ "type": "text",
1051
+ "primaryKey": false,
1052
+ "notNull": true
1053
+ },
1054
+ "path": {
1055
+ "name": "path",
1056
+ "type": "text",
1057
+ "primaryKey": false,
1058
+ "notNull": true
1059
+ },
1060
+ "kind": {
1061
+ "name": "kind",
1062
+ "type": "text",
1063
+ "primaryKey": false,
1064
+ "notNull": true
1065
+ },
1066
+ "post_id": {
1067
+ "name": "post_id",
1068
+ "type": "text",
1069
+ "primaryKey": false,
1070
+ "notNull": false
1071
+ },
1072
+ "collection_id": {
1073
+ "name": "collection_id",
1074
+ "type": "text",
1075
+ "primaryKey": false,
1076
+ "notNull": false
1077
+ },
1078
+ "redirect_to_path": {
1079
+ "name": "redirect_to_path",
1080
+ "type": "text",
1081
+ "primaryKey": false,
1082
+ "notNull": false
1083
+ },
1084
+ "redirect_type": {
1085
+ "name": "redirect_type",
1086
+ "type": "integer",
1087
+ "primaryKey": false,
1088
+ "notNull": false
1089
+ },
1090
+ "archive_query": {
1091
+ "name": "archive_query",
1092
+ "type": "text",
1093
+ "primaryKey": false,
1094
+ "notNull": false
1095
+ },
1096
+ "created_at": {
1097
+ "name": "created_at",
1098
+ "type": "integer",
1099
+ "primaryKey": false,
1100
+ "notNull": true
1101
+ },
1102
+ "updated_at": {
1103
+ "name": "updated_at",
1104
+ "type": "integer",
1105
+ "primaryKey": false,
1106
+ "notNull": true
1107
+ }
1108
+ },
1109
+ "indexes": {
1110
+ "uq_path_registry_site_path": {
1111
+ "name": "uq_path_registry_site_path",
1112
+ "columns": [
1113
+ {
1114
+ "expression": "site_id",
1115
+ "isExpression": false,
1116
+ "asc": true,
1117
+ "nulls": "last"
1118
+ },
1119
+ {
1120
+ "expression": "path",
1121
+ "isExpression": false,
1122
+ "asc": true,
1123
+ "nulls": "last"
1124
+ }
1125
+ ],
1126
+ "isUnique": true,
1127
+ "concurrently": false,
1128
+ "method": "btree",
1129
+ "with": {}
1130
+ },
1131
+ "uq_path_registry_site_post_slug": {
1132
+ "name": "uq_path_registry_site_post_slug",
1133
+ "columns": [
1134
+ {
1135
+ "expression": "site_id",
1136
+ "isExpression": false,
1137
+ "asc": true,
1138
+ "nulls": "last"
1139
+ },
1140
+ {
1141
+ "expression": "post_id",
1142
+ "isExpression": false,
1143
+ "asc": true,
1144
+ "nulls": "last"
1145
+ }
1146
+ ],
1147
+ "isUnique": true,
1148
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"post_id\" IS NOT NULL",
1149
+ "concurrently": false,
1150
+ "method": "btree",
1151
+ "with": {}
1152
+ },
1153
+ "uq_path_registry_site_collection_slug": {
1154
+ "name": "uq_path_registry_site_collection_slug",
1155
+ "columns": [
1156
+ {
1157
+ "expression": "site_id",
1158
+ "isExpression": false,
1159
+ "asc": true,
1160
+ "nulls": "last"
1161
+ },
1162
+ {
1163
+ "expression": "collection_id",
1164
+ "isExpression": false,
1165
+ "asc": true,
1166
+ "nulls": "last"
1167
+ }
1168
+ ],
1169
+ "isUnique": true,
1170
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"collection_id\" IS NOT NULL",
1171
+ "concurrently": false,
1172
+ "method": "btree",
1173
+ "with": {}
1174
+ },
1175
+ "idx_path_registry_site_post_id": {
1176
+ "name": "idx_path_registry_site_post_id",
1177
+ "columns": [
1178
+ {
1179
+ "expression": "site_id",
1180
+ "isExpression": false,
1181
+ "asc": true,
1182
+ "nulls": "last"
1183
+ },
1184
+ {
1185
+ "expression": "post_id",
1186
+ "isExpression": false,
1187
+ "asc": true,
1188
+ "nulls": "last"
1189
+ }
1190
+ ],
1191
+ "isUnique": false,
1192
+ "concurrently": false,
1193
+ "method": "btree",
1194
+ "with": {}
1195
+ },
1196
+ "idx_path_registry_site_collection_id": {
1197
+ "name": "idx_path_registry_site_collection_id",
1198
+ "columns": [
1199
+ {
1200
+ "expression": "site_id",
1201
+ "isExpression": false,
1202
+ "asc": true,
1203
+ "nulls": "last"
1204
+ },
1205
+ {
1206
+ "expression": "collection_id",
1207
+ "isExpression": false,
1208
+ "asc": true,
1209
+ "nulls": "last"
1210
+ }
1211
+ ],
1212
+ "isUnique": false,
1213
+ "concurrently": false,
1214
+ "method": "btree",
1215
+ "with": {}
1216
+ }
1217
+ },
1218
+ "foreignKeys": {
1219
+ "path_registry_site_id_site_id_fk": {
1220
+ "name": "path_registry_site_id_site_id_fk",
1221
+ "tableFrom": "path_registry",
1222
+ "tableTo": "site",
1223
+ "columnsFrom": ["site_id"],
1224
+ "columnsTo": ["id"],
1225
+ "onDelete": "cascade",
1226
+ "onUpdate": "no action"
1227
+ },
1228
+ "path_registry_post_id_post_id_fk": {
1229
+ "name": "path_registry_post_id_post_id_fk",
1230
+ "tableFrom": "path_registry",
1231
+ "tableTo": "post",
1232
+ "columnsFrom": ["post_id"],
1233
+ "columnsTo": ["id"],
1234
+ "onDelete": "cascade",
1235
+ "onUpdate": "no action"
1236
+ },
1237
+ "path_registry_collection_id_collection_id_fk": {
1238
+ "name": "path_registry_collection_id_collection_id_fk",
1239
+ "tableFrom": "path_registry",
1240
+ "tableTo": "collection",
1241
+ "columnsFrom": ["collection_id"],
1242
+ "columnsTo": ["id"],
1243
+ "onDelete": "cascade",
1244
+ "onUpdate": "no action"
1245
+ }
1246
+ },
1247
+ "compositePrimaryKeys": {},
1248
+ "uniqueConstraints": {},
1249
+ "policies": {},
1250
+ "checkConstraints": {
1251
+ "chk_path_registry_kind": {
1252
+ "name": "chk_path_registry_kind",
1253
+ "value": "\"path_registry\".\"kind\" IN ('slug', 'alias', 'redirect', 'archive')"
1254
+ },
1255
+ "chk_path_registry_shape": {
1256
+ "name": "chk_path_registry_shape",
1257
+ "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 )"
1258
+ }
1259
+ },
1260
+ "isRLSEnabled": false
1261
+ },
1262
+ "public.post_collection": {
1263
+ "name": "post_collection",
1264
+ "schema": "",
1265
+ "columns": {
1266
+ "site_id": {
1267
+ "name": "site_id",
1268
+ "type": "text",
1269
+ "primaryKey": false,
1270
+ "notNull": true
1271
+ },
1272
+ "post_id": {
1273
+ "name": "post_id",
1274
+ "type": "text",
1275
+ "primaryKey": false,
1276
+ "notNull": true
1277
+ },
1278
+ "collection_id": {
1279
+ "name": "collection_id",
1280
+ "type": "text",
1281
+ "primaryKey": false,
1282
+ "notNull": true
1283
+ },
1284
+ "created_at": {
1285
+ "name": "created_at",
1286
+ "type": "integer",
1287
+ "primaryKey": false,
1288
+ "notNull": true
1289
+ },
1290
+ "position": {
1291
+ "name": "position",
1292
+ "type": "integer",
1293
+ "primaryKey": false,
1294
+ "notNull": true,
1295
+ "default": 0
1296
+ },
1297
+ "pinned_at": {
1298
+ "name": "pinned_at",
1299
+ "type": "integer",
1300
+ "primaryKey": false,
1301
+ "notNull": false
1302
+ }
1303
+ },
1304
+ "indexes": {
1305
+ "idx_post_collection_site_collection_id": {
1306
+ "name": "idx_post_collection_site_collection_id",
1307
+ "columns": [
1308
+ {
1309
+ "expression": "site_id",
1310
+ "isExpression": false,
1311
+ "asc": true,
1312
+ "nulls": "last"
1313
+ },
1314
+ {
1315
+ "expression": "collection_id",
1316
+ "isExpression": false,
1317
+ "asc": true,
1318
+ "nulls": "last"
1319
+ }
1320
+ ],
1321
+ "isUnique": false,
1322
+ "concurrently": false,
1323
+ "method": "btree",
1324
+ "with": {}
1325
+ },
1326
+ "idx_post_collection_site_collection_created_post": {
1327
+ "name": "idx_post_collection_site_collection_created_post",
1328
+ "columns": [
1329
+ {
1330
+ "expression": "site_id",
1331
+ "isExpression": false,
1332
+ "asc": true,
1333
+ "nulls": "last"
1334
+ },
1335
+ {
1336
+ "expression": "collection_id",
1337
+ "isExpression": false,
1338
+ "asc": true,
1339
+ "nulls": "last"
1340
+ },
1341
+ {
1342
+ "expression": "created_at",
1343
+ "isExpression": false,
1344
+ "asc": true,
1345
+ "nulls": "last"
1346
+ },
1347
+ {
1348
+ "expression": "post_id",
1349
+ "isExpression": false,
1350
+ "asc": true,
1351
+ "nulls": "last"
1352
+ }
1353
+ ],
1354
+ "isUnique": false,
1355
+ "concurrently": false,
1356
+ "method": "btree",
1357
+ "with": {}
1358
+ }
1359
+ },
1360
+ "foreignKeys": {
1361
+ "post_collection_site_id_site_id_fk": {
1362
+ "name": "post_collection_site_id_site_id_fk",
1363
+ "tableFrom": "post_collection",
1364
+ "tableTo": "site",
1365
+ "columnsFrom": ["site_id"],
1366
+ "columnsTo": ["id"],
1367
+ "onDelete": "cascade",
1368
+ "onUpdate": "no action"
1369
+ },
1370
+ "post_collection_post_id_post_id_fk": {
1371
+ "name": "post_collection_post_id_post_id_fk",
1372
+ "tableFrom": "post_collection",
1373
+ "tableTo": "post",
1374
+ "columnsFrom": ["post_id"],
1375
+ "columnsTo": ["id"],
1376
+ "onDelete": "cascade",
1377
+ "onUpdate": "no action"
1378
+ },
1379
+ "post_collection_collection_id_collection_id_fk": {
1380
+ "name": "post_collection_collection_id_collection_id_fk",
1381
+ "tableFrom": "post_collection",
1382
+ "tableTo": "collection",
1383
+ "columnsFrom": ["collection_id"],
1384
+ "columnsTo": ["id"],
1385
+ "onDelete": "cascade",
1386
+ "onUpdate": "no action"
1387
+ }
1388
+ },
1389
+ "compositePrimaryKeys": {
1390
+ "post_collection_site_id_post_id_collection_id_pk": {
1391
+ "name": "post_collection_site_id_post_id_collection_id_pk",
1392
+ "columns": ["site_id", "post_id", "collection_id"]
1393
+ }
1394
+ },
1395
+ "uniqueConstraints": {},
1396
+ "policies": {},
1397
+ "checkConstraints": {},
1398
+ "isRLSEnabled": false
1399
+ },
1400
+ "public.post": {
1401
+ "name": "post",
1402
+ "schema": "",
1403
+ "columns": {
1404
+ "id": {
1405
+ "name": "id",
1406
+ "type": "text",
1407
+ "primaryKey": true,
1408
+ "notNull": true
1409
+ },
1410
+ "site_id": {
1411
+ "name": "site_id",
1412
+ "type": "text",
1413
+ "primaryKey": false,
1414
+ "notNull": true
1415
+ },
1416
+ "format": {
1417
+ "name": "format",
1418
+ "type": "text",
1419
+ "primaryKey": false,
1420
+ "notNull": true
1421
+ },
1422
+ "status": {
1423
+ "name": "status",
1424
+ "type": "text",
1425
+ "primaryKey": false,
1426
+ "notNull": true,
1427
+ "default": "'published'"
1428
+ },
1429
+ "visibility": {
1430
+ "name": "visibility",
1431
+ "type": "text",
1432
+ "primaryKey": false,
1433
+ "notNull": false,
1434
+ "default": "'public'"
1435
+ },
1436
+ "pinned_at": {
1437
+ "name": "pinned_at",
1438
+ "type": "integer",
1439
+ "primaryKey": false,
1440
+ "notNull": false
1441
+ },
1442
+ "featured_at": {
1443
+ "name": "featured_at",
1444
+ "type": "integer",
1445
+ "primaryKey": false,
1446
+ "notNull": false
1447
+ },
1448
+ "title": {
1449
+ "name": "title",
1450
+ "type": "text",
1451
+ "primaryKey": false,
1452
+ "notNull": false
1453
+ },
1454
+ "url": {
1455
+ "name": "url",
1456
+ "type": "text",
1457
+ "primaryKey": false,
1458
+ "notNull": false
1459
+ },
1460
+ "body": {
1461
+ "name": "body",
1462
+ "type": "text",
1463
+ "primaryKey": false,
1464
+ "notNull": false
1465
+ },
1466
+ "body_html": {
1467
+ "name": "body_html",
1468
+ "type": "text",
1469
+ "primaryKey": false,
1470
+ "notNull": false
1471
+ },
1472
+ "body_text": {
1473
+ "name": "body_text",
1474
+ "type": "text",
1475
+ "primaryKey": false,
1476
+ "notNull": false
1477
+ },
1478
+ "quote_text": {
1479
+ "name": "quote_text",
1480
+ "type": "text",
1481
+ "primaryKey": false,
1482
+ "notNull": false
1483
+ },
1484
+ "summary": {
1485
+ "name": "summary",
1486
+ "type": "text",
1487
+ "primaryKey": false,
1488
+ "notNull": false
1489
+ },
1490
+ "search_text": {
1491
+ "name": "search_text",
1492
+ "type": "text",
1493
+ "primaryKey": false,
1494
+ "notNull": false,
1495
+ "generated": {
1496
+ "as": "coalesce(\"title\", '') || ' ' || coalesce(\"url\", '') || ' ' || coalesce(\"quote_text\", '') || ' ' || coalesce(\"body_text\", '')",
1497
+ "type": "stored"
1498
+ }
1499
+ },
1500
+ "search_document": {
1501
+ "name": "search_document",
1502
+ "type": "tsvector",
1503
+ "primaryKey": false,
1504
+ "notNull": false,
1505
+ "generated": {
1506
+ "as": "setweight(to_tsvector('simple', coalesce(\"title\", '')), 'A') ||\n setweight(to_tsvector('simple', coalesce(\"url\", '')), 'A') ||\n setweight(to_tsvector('simple', coalesce(\"quote_text\", '')), 'B') ||\n setweight(to_tsvector('simple', coalesce(\"body_text\", '')), 'C')",
1507
+ "type": "stored"
1508
+ }
1509
+ },
1510
+ "rating": {
1511
+ "name": "rating",
1512
+ "type": "integer",
1513
+ "primaryKey": false,
1514
+ "notNull": false
1515
+ },
1516
+ "preview_image_key": {
1517
+ "name": "preview_image_key",
1518
+ "type": "text",
1519
+ "primaryKey": false,
1520
+ "notNull": false
1521
+ },
1522
+ "preview_kind": {
1523
+ "name": "preview_kind",
1524
+ "type": "text",
1525
+ "primaryKey": false,
1526
+ "notNull": false
1527
+ },
1528
+ "preview_provider": {
1529
+ "name": "preview_provider",
1530
+ "type": "text",
1531
+ "primaryKey": false,
1532
+ "notNull": false
1533
+ },
1534
+ "reply_to_id": {
1535
+ "name": "reply_to_id",
1536
+ "type": "text",
1537
+ "primaryKey": false,
1538
+ "notNull": false
1539
+ },
1540
+ "thread_id": {
1541
+ "name": "thread_id",
1542
+ "type": "text",
1543
+ "primaryKey": false,
1544
+ "notNull": true
1545
+ },
1546
+ "published_at": {
1547
+ "name": "published_at",
1548
+ "type": "integer",
1549
+ "primaryKey": false,
1550
+ "notNull": false
1551
+ },
1552
+ "last_activity_at": {
1553
+ "name": "last_activity_at",
1554
+ "type": "integer",
1555
+ "primaryKey": false,
1556
+ "notNull": false
1557
+ },
1558
+ "created_at": {
1559
+ "name": "created_at",
1560
+ "type": "integer",
1561
+ "primaryKey": false,
1562
+ "notNull": true
1563
+ },
1564
+ "updated_at": {
1565
+ "name": "updated_at",
1566
+ "type": "integer",
1567
+ "primaryKey": false,
1568
+ "notNull": true
1569
+ }
1570
+ },
1571
+ "indexes": {
1572
+ "idx_post_site_thread_id": {
1573
+ "name": "idx_post_site_thread_id",
1574
+ "columns": [
1575
+ {
1576
+ "expression": "site_id",
1577
+ "isExpression": false,
1578
+ "asc": true,
1579
+ "nulls": "last"
1580
+ },
1581
+ {
1582
+ "expression": "thread_id",
1583
+ "isExpression": false,
1584
+ "asc": true,
1585
+ "nulls": "last"
1586
+ }
1587
+ ],
1588
+ "isUnique": false,
1589
+ "concurrently": false,
1590
+ "method": "btree",
1591
+ "with": {}
1592
+ },
1593
+ "idx_post_site_thread_created": {
1594
+ "name": "idx_post_site_thread_created",
1595
+ "columns": [
1596
+ {
1597
+ "expression": "site_id",
1598
+ "isExpression": false,
1599
+ "asc": true,
1600
+ "nulls": "last"
1601
+ },
1602
+ {
1603
+ "expression": "thread_id",
1604
+ "isExpression": false,
1605
+ "asc": true,
1606
+ "nulls": "last"
1607
+ },
1608
+ {
1609
+ "expression": "created_at",
1610
+ "isExpression": false,
1611
+ "asc": true,
1612
+ "nulls": "last"
1613
+ },
1614
+ {
1615
+ "expression": "id",
1616
+ "isExpression": false,
1617
+ "asc": true,
1618
+ "nulls": "last"
1619
+ }
1620
+ ],
1621
+ "isUnique": false,
1622
+ "concurrently": false,
1623
+ "method": "btree",
1624
+ "with": {}
1625
+ },
1626
+ "idx_post_site_status_published": {
1627
+ "name": "idx_post_site_status_published",
1628
+ "columns": [
1629
+ {
1630
+ "expression": "site_id",
1631
+ "isExpression": false,
1632
+ "asc": true,
1633
+ "nulls": "last"
1634
+ },
1635
+ {
1636
+ "expression": "status",
1637
+ "isExpression": false,
1638
+ "asc": true,
1639
+ "nulls": "last"
1640
+ },
1641
+ {
1642
+ "expression": "published_at",
1643
+ "isExpression": false,
1644
+ "asc": true,
1645
+ "nulls": "last"
1646
+ }
1647
+ ],
1648
+ "isUnique": false,
1649
+ "concurrently": false,
1650
+ "method": "btree",
1651
+ "with": {}
1652
+ },
1653
+ "idx_post_site_status_activity": {
1654
+ "name": "idx_post_site_status_activity",
1655
+ "columns": [
1656
+ {
1657
+ "expression": "site_id",
1658
+ "isExpression": false,
1659
+ "asc": true,
1660
+ "nulls": "last"
1661
+ },
1662
+ {
1663
+ "expression": "status",
1664
+ "isExpression": false,
1665
+ "asc": true,
1666
+ "nulls": "last"
1667
+ },
1668
+ {
1669
+ "expression": "last_activity_at",
1670
+ "isExpression": false,
1671
+ "asc": true,
1672
+ "nulls": "last"
1673
+ }
1674
+ ],
1675
+ "isUnique": false,
1676
+ "concurrently": false,
1677
+ "method": "btree",
1678
+ "with": {}
1679
+ },
1680
+ "idx_post_site_root_published_activity": {
1681
+ "name": "idx_post_site_root_published_activity",
1682
+ "columns": [
1683
+ {
1684
+ "expression": "site_id",
1685
+ "isExpression": false,
1686
+ "asc": true,
1687
+ "nulls": "last"
1688
+ },
1689
+ {
1690
+ "expression": "last_activity_at",
1691
+ "isExpression": false,
1692
+ "asc": true,
1693
+ "nulls": "last"
1694
+ },
1695
+ {
1696
+ "expression": "id",
1697
+ "isExpression": false,
1698
+ "asc": true,
1699
+ "nulls": "last"
1700
+ }
1701
+ ],
1702
+ "isUnique": false,
1703
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'",
1704
+ "concurrently": false,
1705
+ "method": "btree",
1706
+ "with": {}
1707
+ },
1708
+ "idx_post_site_root_draft_updated": {
1709
+ "name": "idx_post_site_root_draft_updated",
1710
+ "columns": [
1711
+ {
1712
+ "expression": "site_id",
1713
+ "isExpression": false,
1714
+ "asc": true,
1715
+ "nulls": "last"
1716
+ },
1717
+ {
1718
+ "expression": "updated_at",
1719
+ "isExpression": false,
1720
+ "asc": true,
1721
+ "nulls": "last"
1722
+ },
1723
+ {
1724
+ "expression": "id",
1725
+ "isExpression": false,
1726
+ "asc": true,
1727
+ "nulls": "last"
1728
+ }
1729
+ ],
1730
+ "isUnique": false,
1731
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'draft'",
1732
+ "concurrently": false,
1733
+ "method": "btree",
1734
+ "with": {}
1735
+ },
1736
+ "idx_post_site_reply_thread_created": {
1737
+ "name": "idx_post_site_reply_thread_created",
1738
+ "columns": [
1739
+ {
1740
+ "expression": "site_id",
1741
+ "isExpression": false,
1742
+ "asc": true,
1743
+ "nulls": "last"
1744
+ },
1745
+ {
1746
+ "expression": "thread_id",
1747
+ "isExpression": false,
1748
+ "asc": true,
1749
+ "nulls": "last"
1750
+ },
1751
+ {
1752
+ "expression": "created_at",
1753
+ "isExpression": false,
1754
+ "asc": true,
1755
+ "nulls": "last"
1756
+ },
1757
+ {
1758
+ "expression": "id",
1759
+ "isExpression": false,
1760
+ "asc": true,
1761
+ "nulls": "last"
1762
+ }
1763
+ ],
1764
+ "isUnique": false,
1765
+ "where": "\"post\".\"reply_to_id\" IS NOT NULL AND \"post\".\"status\" = 'published'",
1766
+ "concurrently": false,
1767
+ "method": "btree",
1768
+ "with": {}
1769
+ },
1770
+ "idx_post_site_featured_featured_at": {
1771
+ "name": "idx_post_site_featured_featured_at",
1772
+ "columns": [
1773
+ {
1774
+ "expression": "site_id",
1775
+ "isExpression": false,
1776
+ "asc": true,
1777
+ "nulls": "last"
1778
+ },
1779
+ {
1780
+ "expression": "featured_at",
1781
+ "isExpression": false,
1782
+ "asc": true,
1783
+ "nulls": "last"
1784
+ },
1785
+ {
1786
+ "expression": "thread_id",
1787
+ "isExpression": false,
1788
+ "asc": true,
1789
+ "nulls": "last"
1790
+ },
1791
+ {
1792
+ "expression": "id",
1793
+ "isExpression": false,
1794
+ "asc": true,
1795
+ "nulls": "last"
1796
+ }
1797
+ ],
1798
+ "isUnique": false,
1799
+ "where": "\"post\".\"status\" = 'published' AND \"post\".\"featured_at\" IS NOT NULL",
1800
+ "concurrently": false,
1801
+ "method": "btree",
1802
+ "with": {}
1803
+ },
1804
+ "idx_post_search_document": {
1805
+ "name": "idx_post_search_document",
1806
+ "columns": [
1807
+ {
1808
+ "expression": "search_document",
1809
+ "isExpression": false,
1810
+ "asc": true,
1811
+ "nulls": "last"
1812
+ }
1813
+ ],
1814
+ "isUnique": false,
1815
+ "concurrently": false,
1816
+ "method": "gin",
1817
+ "with": {}
1818
+ },
1819
+ "idx_post_search_text_trgm": {
1820
+ "name": "idx_post_search_text_trgm",
1821
+ "columns": [
1822
+ {
1823
+ "expression": "search_text",
1824
+ "isExpression": false,
1825
+ "asc": true,
1826
+ "nulls": "last",
1827
+ "opclass": "gin_trgm_ops"
1828
+ }
1829
+ ],
1830
+ "isUnique": false,
1831
+ "concurrently": false,
1832
+ "method": "gin",
1833
+ "with": {}
1834
+ }
1835
+ },
1836
+ "foreignKeys": {
1837
+ "post_site_id_site_id_fk": {
1838
+ "name": "post_site_id_site_id_fk",
1839
+ "tableFrom": "post",
1840
+ "tableTo": "site",
1841
+ "columnsFrom": ["site_id"],
1842
+ "columnsTo": ["id"],
1843
+ "onDelete": "cascade",
1844
+ "onUpdate": "no action"
1845
+ },
1846
+ "post_site_id_reply_to_id_post_site_id_id_fk": {
1847
+ "name": "post_site_id_reply_to_id_post_site_id_id_fk",
1848
+ "tableFrom": "post",
1849
+ "tableTo": "post",
1850
+ "columnsFrom": ["site_id", "reply_to_id"],
1851
+ "columnsTo": ["site_id", "id"],
1852
+ "onDelete": "no action",
1853
+ "onUpdate": "no action"
1854
+ },
1855
+ "post_site_id_thread_id_post_site_id_id_fk": {
1856
+ "name": "post_site_id_thread_id_post_site_id_id_fk",
1857
+ "tableFrom": "post",
1858
+ "tableTo": "post",
1859
+ "columnsFrom": ["site_id", "thread_id"],
1860
+ "columnsTo": ["site_id", "id"],
1861
+ "onDelete": "no action",
1862
+ "onUpdate": "no action"
1863
+ }
1864
+ },
1865
+ "compositePrimaryKeys": {},
1866
+ "uniqueConstraints": {
1867
+ "uq_post_site_id_id": {
1868
+ "name": "uq_post_site_id_id",
1869
+ "nullsNotDistinct": false,
1870
+ "columns": ["site_id", "id"]
1871
+ }
1872
+ },
1873
+ "policies": {},
1874
+ "checkConstraints": {
1875
+ "chk_post_reply_to_not_self": {
1876
+ "name": "chk_post_reply_to_not_self",
1877
+ "value": "\"post\".\"reply_to_id\" IS NULL OR \"post\".\"reply_to_id\" <> \"post\".\"id\""
1878
+ },
1879
+ "chk_post_thread_shape": {
1880
+ "name": "chk_post_thread_shape",
1881
+ "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 )"
1882
+ }
1883
+ },
1884
+ "isRLSEnabled": false
1885
+ },
1886
+ "public.rate_limit": {
1887
+ "name": "rate_limit",
1888
+ "schema": "",
1889
+ "columns": {
1890
+ "key": {
1891
+ "name": "key",
1892
+ "type": "text",
1893
+ "primaryKey": false,
1894
+ "notNull": true
1895
+ },
1896
+ "window_start": {
1897
+ "name": "window_start",
1898
+ "type": "integer",
1899
+ "primaryKey": false,
1900
+ "notNull": true
1901
+ },
1902
+ "count": {
1903
+ "name": "count",
1904
+ "type": "integer",
1905
+ "primaryKey": false,
1906
+ "notNull": true,
1907
+ "default": 0
1908
+ }
1909
+ },
1910
+ "indexes": {},
1911
+ "foreignKeys": {},
1912
+ "compositePrimaryKeys": {
1913
+ "rate_limit_key_window_start_pk": {
1914
+ "name": "rate_limit_key_window_start_pk",
1915
+ "columns": ["key", "window_start"]
1916
+ }
1917
+ },
1918
+ "uniqueConstraints": {},
1919
+ "policies": {},
1920
+ "checkConstraints": {},
1921
+ "isRLSEnabled": false
1922
+ },
1923
+ "public.session": {
1924
+ "name": "session",
1925
+ "schema": "",
1926
+ "columns": {
1927
+ "id": {
1928
+ "name": "id",
1929
+ "type": "text",
1930
+ "primaryKey": true,
1931
+ "notNull": true
1932
+ },
1933
+ "expires_at": {
1934
+ "name": "expires_at",
1935
+ "type": "timestamp with time zone",
1936
+ "primaryKey": false,
1937
+ "notNull": true
1938
+ },
1939
+ "token": {
1940
+ "name": "token",
1941
+ "type": "text",
1942
+ "primaryKey": false,
1943
+ "notNull": true
1944
+ },
1945
+ "created_at": {
1946
+ "name": "created_at",
1947
+ "type": "timestamp with time zone",
1948
+ "primaryKey": false,
1949
+ "notNull": true
1950
+ },
1951
+ "updated_at": {
1952
+ "name": "updated_at",
1953
+ "type": "timestamp with time zone",
1954
+ "primaryKey": false,
1955
+ "notNull": true
1956
+ },
1957
+ "ip_address": {
1958
+ "name": "ip_address",
1959
+ "type": "text",
1960
+ "primaryKey": false,
1961
+ "notNull": false
1962
+ },
1963
+ "user_agent": {
1964
+ "name": "user_agent",
1965
+ "type": "text",
1966
+ "primaryKey": false,
1967
+ "notNull": false
1968
+ },
1969
+ "user_id": {
1970
+ "name": "user_id",
1971
+ "type": "text",
1972
+ "primaryKey": false,
1973
+ "notNull": true
1974
+ }
1975
+ },
1976
+ "indexes": {
1977
+ "idx_session_user_id": {
1978
+ "name": "idx_session_user_id",
1979
+ "columns": [
1980
+ {
1981
+ "expression": "user_id",
1982
+ "isExpression": false,
1983
+ "asc": true,
1984
+ "nulls": "last"
1985
+ }
1986
+ ],
1987
+ "isUnique": false,
1988
+ "concurrently": false,
1989
+ "method": "btree",
1990
+ "with": {}
1991
+ }
1992
+ },
1993
+ "foreignKeys": {
1994
+ "session_user_id_user_id_fk": {
1995
+ "name": "session_user_id_user_id_fk",
1996
+ "tableFrom": "session",
1997
+ "tableTo": "user",
1998
+ "columnsFrom": ["user_id"],
1999
+ "columnsTo": ["id"],
2000
+ "onDelete": "no action",
2001
+ "onUpdate": "no action"
2002
+ }
2003
+ },
2004
+ "compositePrimaryKeys": {},
2005
+ "uniqueConstraints": {
2006
+ "session_token_unique": {
2007
+ "name": "session_token_unique",
2008
+ "nullsNotDistinct": false,
2009
+ "columns": ["token"]
2010
+ }
2011
+ },
2012
+ "policies": {},
2013
+ "checkConstraints": {},
2014
+ "isRLSEnabled": false
2015
+ },
2016
+ "public.site_setting": {
2017
+ "name": "site_setting",
2018
+ "schema": "",
2019
+ "columns": {
2020
+ "site_id": {
2021
+ "name": "site_id",
2022
+ "type": "text",
2023
+ "primaryKey": false,
2024
+ "notNull": true
2025
+ },
2026
+ "key": {
2027
+ "name": "key",
2028
+ "type": "text",
2029
+ "primaryKey": false,
2030
+ "notNull": true
2031
+ },
2032
+ "value": {
2033
+ "name": "value",
2034
+ "type": "text",
2035
+ "primaryKey": false,
2036
+ "notNull": true
2037
+ },
2038
+ "updated_at": {
2039
+ "name": "updated_at",
2040
+ "type": "integer",
2041
+ "primaryKey": false,
2042
+ "notNull": true
2043
+ }
2044
+ },
2045
+ "indexes": {
2046
+ "idx_site_setting_site_id": {
2047
+ "name": "idx_site_setting_site_id",
2048
+ "columns": [
2049
+ {
2050
+ "expression": "site_id",
2051
+ "isExpression": false,
2052
+ "asc": true,
2053
+ "nulls": "last"
2054
+ }
2055
+ ],
2056
+ "isUnique": false,
2057
+ "concurrently": false,
2058
+ "method": "btree",
2059
+ "with": {}
2060
+ }
2061
+ },
2062
+ "foreignKeys": {
2063
+ "site_setting_site_id_site_id_fk": {
2064
+ "name": "site_setting_site_id_site_id_fk",
2065
+ "tableFrom": "site_setting",
2066
+ "tableTo": "site",
2067
+ "columnsFrom": ["site_id"],
2068
+ "columnsTo": ["id"],
2069
+ "onDelete": "cascade",
2070
+ "onUpdate": "no action"
2071
+ }
2072
+ },
2073
+ "compositePrimaryKeys": {
2074
+ "site_setting_site_id_key_pk": {
2075
+ "name": "site_setting_site_id_key_pk",
2076
+ "columns": ["site_id", "key"]
2077
+ }
2078
+ },
2079
+ "uniqueConstraints": {},
2080
+ "policies": {},
2081
+ "checkConstraints": {},
2082
+ "isRLSEnabled": false
2083
+ },
2084
+ "public.site_domain": {
2085
+ "name": "site_domain",
2086
+ "schema": "",
2087
+ "columns": {
2088
+ "id": {
2089
+ "name": "id",
2090
+ "type": "text",
2091
+ "primaryKey": true,
2092
+ "notNull": true
2093
+ },
2094
+ "site_id": {
2095
+ "name": "site_id",
2096
+ "type": "text",
2097
+ "primaryKey": false,
2098
+ "notNull": true
2099
+ },
2100
+ "host": {
2101
+ "name": "host",
2102
+ "type": "text",
2103
+ "primaryKey": false,
2104
+ "notNull": true
2105
+ },
2106
+ "path_prefix": {
2107
+ "name": "path_prefix",
2108
+ "type": "text",
2109
+ "primaryKey": false,
2110
+ "notNull": false
2111
+ },
2112
+ "kind": {
2113
+ "name": "kind",
2114
+ "type": "text",
2115
+ "primaryKey": false,
2116
+ "notNull": true,
2117
+ "default": "'primary'"
2118
+ },
2119
+ "redirect_to_primary": {
2120
+ "name": "redirect_to_primary",
2121
+ "type": "boolean",
2122
+ "primaryKey": false,
2123
+ "notNull": true,
2124
+ "default": true
2125
+ },
2126
+ "created_at": {
2127
+ "name": "created_at",
2128
+ "type": "integer",
2129
+ "primaryKey": false,
2130
+ "notNull": true
2131
+ },
2132
+ "updated_at": {
2133
+ "name": "updated_at",
2134
+ "type": "integer",
2135
+ "primaryKey": false,
2136
+ "notNull": true
2137
+ }
2138
+ },
2139
+ "indexes": {
2140
+ "uq_site_domain_host": {
2141
+ "name": "uq_site_domain_host",
2142
+ "columns": [
2143
+ {
2144
+ "expression": "host",
2145
+ "isExpression": false,
2146
+ "asc": true,
2147
+ "nulls": "last"
2148
+ }
2149
+ ],
2150
+ "isUnique": true,
2151
+ "concurrently": false,
2152
+ "method": "btree",
2153
+ "with": {}
2154
+ },
2155
+ "idx_site_domain_site_id": {
2156
+ "name": "idx_site_domain_site_id",
2157
+ "columns": [
2158
+ {
2159
+ "expression": "site_id",
2160
+ "isExpression": false,
2161
+ "asc": true,
2162
+ "nulls": "last"
2163
+ }
2164
+ ],
2165
+ "isUnique": false,
2166
+ "concurrently": false,
2167
+ "method": "btree",
2168
+ "with": {}
2169
+ }
2170
+ },
2171
+ "foreignKeys": {
2172
+ "site_domain_site_id_site_id_fk": {
2173
+ "name": "site_domain_site_id_site_id_fk",
2174
+ "tableFrom": "site_domain",
2175
+ "tableTo": "site",
2176
+ "columnsFrom": ["site_id"],
2177
+ "columnsTo": ["id"],
2178
+ "onDelete": "cascade",
2179
+ "onUpdate": "no action"
2180
+ }
2181
+ },
2182
+ "compositePrimaryKeys": {},
2183
+ "uniqueConstraints": {},
2184
+ "policies": {},
2185
+ "checkConstraints": {
2186
+ "chk_site_domain_kind": {
2187
+ "name": "chk_site_domain_kind",
2188
+ "value": "\"site_domain\".\"kind\" IN ('primary', 'alias')"
2189
+ }
2190
+ },
2191
+ "isRLSEnabled": false
2192
+ },
2193
+ "public.site_member": {
2194
+ "name": "site_member",
2195
+ "schema": "",
2196
+ "columns": {
2197
+ "site_id": {
2198
+ "name": "site_id",
2199
+ "type": "text",
2200
+ "primaryKey": false,
2201
+ "notNull": true
2202
+ },
2203
+ "user_id": {
2204
+ "name": "user_id",
2205
+ "type": "text",
2206
+ "primaryKey": false,
2207
+ "notNull": true
2208
+ },
2209
+ "role": {
2210
+ "name": "role",
2211
+ "type": "text",
2212
+ "primaryKey": false,
2213
+ "notNull": true,
2214
+ "default": "'editor'"
2215
+ },
2216
+ "created_at": {
2217
+ "name": "created_at",
2218
+ "type": "integer",
2219
+ "primaryKey": false,
2220
+ "notNull": true
2221
+ },
2222
+ "updated_at": {
2223
+ "name": "updated_at",
2224
+ "type": "integer",
2225
+ "primaryKey": false,
2226
+ "notNull": true
2227
+ }
2228
+ },
2229
+ "indexes": {
2230
+ "idx_site_member_user_id": {
2231
+ "name": "idx_site_member_user_id",
2232
+ "columns": [
2233
+ {
2234
+ "expression": "user_id",
2235
+ "isExpression": false,
2236
+ "asc": true,
2237
+ "nulls": "last"
2238
+ }
2239
+ ],
2240
+ "isUnique": false,
2241
+ "concurrently": false,
2242
+ "method": "btree",
2243
+ "with": {}
2244
+ }
2245
+ },
2246
+ "foreignKeys": {
2247
+ "site_member_site_id_site_id_fk": {
2248
+ "name": "site_member_site_id_site_id_fk",
2249
+ "tableFrom": "site_member",
2250
+ "tableTo": "site",
2251
+ "columnsFrom": ["site_id"],
2252
+ "columnsTo": ["id"],
2253
+ "onDelete": "cascade",
2254
+ "onUpdate": "no action"
2255
+ }
2256
+ },
2257
+ "compositePrimaryKeys": {
2258
+ "site_member_site_id_user_id_pk": {
2259
+ "name": "site_member_site_id_user_id_pk",
2260
+ "columns": ["site_id", "user_id"]
2261
+ }
2262
+ },
2263
+ "uniqueConstraints": {},
2264
+ "policies": {},
2265
+ "checkConstraints": {
2266
+ "chk_site_member_role": {
2267
+ "name": "chk_site_member_role",
2268
+ "value": "\"site_member\".\"role\" IN ('owner', 'admin', 'editor')"
2269
+ }
2270
+ },
2271
+ "isRLSEnabled": false
2272
+ },
2273
+ "public.site": {
2274
+ "name": "site",
2275
+ "schema": "",
2276
+ "columns": {
2277
+ "id": {
2278
+ "name": "id",
2279
+ "type": "text",
2280
+ "primaryKey": true,
2281
+ "notNull": true
2282
+ },
2283
+ "key": {
2284
+ "name": "key",
2285
+ "type": "text",
2286
+ "primaryKey": false,
2287
+ "notNull": true
2288
+ },
2289
+ "status": {
2290
+ "name": "status",
2291
+ "type": "text",
2292
+ "primaryKey": false,
2293
+ "notNull": true,
2294
+ "default": "'active'"
2295
+ },
2296
+ "provisioning_idempotency_key": {
2297
+ "name": "provisioning_idempotency_key",
2298
+ "type": "text",
2299
+ "primaryKey": false,
2300
+ "notNull": false
2301
+ },
2302
+ "created_at": {
2303
+ "name": "created_at",
2304
+ "type": "integer",
2305
+ "primaryKey": false,
2306
+ "notNull": true
2307
+ },
2308
+ "updated_at": {
2309
+ "name": "updated_at",
2310
+ "type": "integer",
2311
+ "primaryKey": false,
2312
+ "notNull": true
2313
+ }
2314
+ },
2315
+ "indexes": {
2316
+ "uq_site_key": {
2317
+ "name": "uq_site_key",
2318
+ "columns": [
2319
+ {
2320
+ "expression": "key",
2321
+ "isExpression": false,
2322
+ "asc": true,
2323
+ "nulls": "last"
2324
+ }
2325
+ ],
2326
+ "isUnique": true,
2327
+ "concurrently": false,
2328
+ "method": "btree",
2329
+ "with": {}
2330
+ },
2331
+ "uq_site_provisioning_idempotency_key": {
2332
+ "name": "uq_site_provisioning_idempotency_key",
2333
+ "columns": [
2334
+ {
2335
+ "expression": "provisioning_idempotency_key",
2336
+ "isExpression": false,
2337
+ "asc": true,
2338
+ "nulls": "last"
2339
+ }
2340
+ ],
2341
+ "isUnique": true,
2342
+ "where": "\"site\".\"provisioning_idempotency_key\" IS NOT NULL",
2343
+ "concurrently": false,
2344
+ "method": "btree",
2345
+ "with": {}
2346
+ }
2347
+ },
2348
+ "foreignKeys": {},
2349
+ "compositePrimaryKeys": {},
2350
+ "uniqueConstraints": {},
2351
+ "policies": {},
2352
+ "checkConstraints": {
2353
+ "chk_site_status": {
2354
+ "name": "chk_site_status",
2355
+ "value": "\"site\".\"status\" IN ('active', 'suspended')"
2356
+ }
2357
+ },
2358
+ "isRLSEnabled": false
2359
+ },
2360
+ "public.upload_session": {
2361
+ "name": "upload_session",
2362
+ "schema": "",
2363
+ "columns": {
2364
+ "id": {
2365
+ "name": "id",
2366
+ "type": "text",
2367
+ "primaryKey": true,
2368
+ "notNull": true
2369
+ },
2370
+ "site_id": {
2371
+ "name": "site_id",
2372
+ "type": "text",
2373
+ "primaryKey": false,
2374
+ "notNull": true
2375
+ },
2376
+ "media_id": {
2377
+ "name": "media_id",
2378
+ "type": "text",
2379
+ "primaryKey": false,
2380
+ "notNull": true
2381
+ },
2382
+ "original_name": {
2383
+ "name": "original_name",
2384
+ "type": "text",
2385
+ "primaryKey": false,
2386
+ "notNull": true
2387
+ },
2388
+ "filename": {
2389
+ "name": "filename",
2390
+ "type": "text",
2391
+ "primaryKey": false,
2392
+ "notNull": true
2393
+ },
2394
+ "provider": {
2395
+ "name": "provider",
2396
+ "type": "text",
2397
+ "primaryKey": false,
2398
+ "notNull": true
2399
+ },
2400
+ "expected_content_type": {
2401
+ "name": "expected_content_type",
2402
+ "type": "text",
2403
+ "primaryKey": false,
2404
+ "notNull": true
2405
+ },
2406
+ "expected_size": {
2407
+ "name": "expected_size",
2408
+ "type": "integer",
2409
+ "primaryKey": false,
2410
+ "notNull": true
2411
+ },
2412
+ "expected_checksum_sha256": {
2413
+ "name": "expected_checksum_sha256",
2414
+ "type": "text",
2415
+ "primaryKey": false,
2416
+ "notNull": false
2417
+ },
2418
+ "content_disposition": {
2419
+ "name": "content_disposition",
2420
+ "type": "text",
2421
+ "primaryKey": false,
2422
+ "notNull": true,
2423
+ "default": "'inline'"
2424
+ },
2425
+ "temp_storage_key": {
2426
+ "name": "temp_storage_key",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": true
2430
+ },
2431
+ "final_storage_key": {
2432
+ "name": "final_storage_key",
2433
+ "type": "text",
2434
+ "primaryKey": false,
2435
+ "notNull": true
2436
+ },
2437
+ "multipart_upload_id": {
2438
+ "name": "multipart_upload_id",
2439
+ "type": "text",
2440
+ "primaryKey": false,
2441
+ "notNull": false
2442
+ },
2443
+ "state": {
2444
+ "name": "state",
2445
+ "type": "text",
2446
+ "primaryKey": false,
2447
+ "notNull": true,
2448
+ "default": "'pending'"
2449
+ },
2450
+ "expires_at": {
2451
+ "name": "expires_at",
2452
+ "type": "integer",
2453
+ "primaryKey": false,
2454
+ "notNull": true
2455
+ },
2456
+ "created_at": {
2457
+ "name": "created_at",
2458
+ "type": "integer",
2459
+ "primaryKey": false,
2460
+ "notNull": true
2461
+ },
2462
+ "updated_at": {
2463
+ "name": "updated_at",
2464
+ "type": "integer",
2465
+ "primaryKey": false,
2466
+ "notNull": true
2467
+ }
2468
+ },
2469
+ "indexes": {
2470
+ "uq_upload_session_media_id": {
2471
+ "name": "uq_upload_session_media_id",
2472
+ "columns": [
2473
+ {
2474
+ "expression": "media_id",
2475
+ "isExpression": false,
2476
+ "asc": true,
2477
+ "nulls": "last"
2478
+ }
2479
+ ],
2480
+ "isUnique": true,
2481
+ "concurrently": false,
2482
+ "method": "btree",
2483
+ "with": {}
2484
+ },
2485
+ "uq_upload_session_temp_storage_key": {
2486
+ "name": "uq_upload_session_temp_storage_key",
2487
+ "columns": [
2488
+ {
2489
+ "expression": "temp_storage_key",
2490
+ "isExpression": false,
2491
+ "asc": true,
2492
+ "nulls": "last"
2493
+ }
2494
+ ],
2495
+ "isUnique": true,
2496
+ "concurrently": false,
2497
+ "method": "btree",
2498
+ "with": {}
2499
+ },
2500
+ "uq_upload_session_final_storage_key": {
2501
+ "name": "uq_upload_session_final_storage_key",
2502
+ "columns": [
2503
+ {
2504
+ "expression": "final_storage_key",
2505
+ "isExpression": false,
2506
+ "asc": true,
2507
+ "nulls": "last"
2508
+ }
2509
+ ],
2510
+ "isUnique": true,
2511
+ "concurrently": false,
2512
+ "method": "btree",
2513
+ "with": {}
2514
+ },
2515
+ "idx_upload_session_site_state": {
2516
+ "name": "idx_upload_session_site_state",
2517
+ "columns": [
2518
+ {
2519
+ "expression": "site_id",
2520
+ "isExpression": false,
2521
+ "asc": true,
2522
+ "nulls": "last"
2523
+ },
2524
+ {
2525
+ "expression": "state",
2526
+ "isExpression": false,
2527
+ "asc": true,
2528
+ "nulls": "last"
2529
+ }
2530
+ ],
2531
+ "isUnique": false,
2532
+ "concurrently": false,
2533
+ "method": "btree",
2534
+ "with": {}
2535
+ },
2536
+ "idx_upload_session_site_expires_at": {
2537
+ "name": "idx_upload_session_site_expires_at",
2538
+ "columns": [
2539
+ {
2540
+ "expression": "site_id",
2541
+ "isExpression": false,
2542
+ "asc": true,
2543
+ "nulls": "last"
2544
+ },
2545
+ {
2546
+ "expression": "expires_at",
2547
+ "isExpression": false,
2548
+ "asc": true,
2549
+ "nulls": "last"
2550
+ }
2551
+ ],
2552
+ "isUnique": false,
2553
+ "concurrently": false,
2554
+ "method": "btree",
2555
+ "with": {}
2556
+ }
2557
+ },
2558
+ "foreignKeys": {
2559
+ "upload_session_site_id_site_id_fk": {
2560
+ "name": "upload_session_site_id_site_id_fk",
2561
+ "tableFrom": "upload_session",
2562
+ "tableTo": "site",
2563
+ "columnsFrom": ["site_id"],
2564
+ "columnsTo": ["id"],
2565
+ "onDelete": "cascade",
2566
+ "onUpdate": "no action"
2567
+ }
2568
+ },
2569
+ "compositePrimaryKeys": {},
2570
+ "uniqueConstraints": {},
2571
+ "policies": {},
2572
+ "checkConstraints": {
2573
+ "chk_upload_session_expected_size_positive": {
2574
+ "name": "chk_upload_session_expected_size_positive",
2575
+ "value": "\"upload_session\".\"expected_size\" > 0"
2576
+ },
2577
+ "chk_upload_session_state": {
2578
+ "name": "chk_upload_session_state",
2579
+ "value": "\"upload_session\".\"state\" IN ('pending', 'uploaded', 'completed', 'aborted', 'failed')"
2580
+ },
2581
+ "chk_upload_session_content_disposition": {
2582
+ "name": "chk_upload_session_content_disposition",
2583
+ "value": "\"upload_session\".\"content_disposition\" IN ('inline', 'attachment')"
2584
+ }
2585
+ },
2586
+ "isRLSEnabled": false
2587
+ },
2588
+ "public.user": {
2589
+ "name": "user",
2590
+ "schema": "",
2591
+ "columns": {
2592
+ "id": {
2593
+ "name": "id",
2594
+ "type": "text",
2595
+ "primaryKey": true,
2596
+ "notNull": true
2597
+ },
2598
+ "name": {
2599
+ "name": "name",
2600
+ "type": "text",
2601
+ "primaryKey": false,
2602
+ "notNull": true
2603
+ },
2604
+ "email": {
2605
+ "name": "email",
2606
+ "type": "text",
2607
+ "primaryKey": false,
2608
+ "notNull": true
2609
+ },
2610
+ "email_verified": {
2611
+ "name": "email_verified",
2612
+ "type": "boolean",
2613
+ "primaryKey": false,
2614
+ "notNull": true,
2615
+ "default": false
2616
+ },
2617
+ "image": {
2618
+ "name": "image",
2619
+ "type": "text",
2620
+ "primaryKey": false,
2621
+ "notNull": false
2622
+ },
2623
+ "role": {
2624
+ "name": "role",
2625
+ "type": "text",
2626
+ "primaryKey": false,
2627
+ "notNull": false,
2628
+ "default": "'member'"
2629
+ },
2630
+ "created_at": {
2631
+ "name": "created_at",
2632
+ "type": "timestamp with time zone",
2633
+ "primaryKey": false,
2634
+ "notNull": true
2635
+ },
2636
+ "updated_at": {
2637
+ "name": "updated_at",
2638
+ "type": "timestamp with time zone",
2639
+ "primaryKey": false,
2640
+ "notNull": true
2641
+ }
2642
+ },
2643
+ "indexes": {},
2644
+ "foreignKeys": {},
2645
+ "compositePrimaryKeys": {},
2646
+ "uniqueConstraints": {
2647
+ "user_email_unique": {
2648
+ "name": "user_email_unique",
2649
+ "nullsNotDistinct": false,
2650
+ "columns": ["email"]
2651
+ }
2652
+ },
2653
+ "policies": {},
2654
+ "checkConstraints": {},
2655
+ "isRLSEnabled": false
2656
+ },
2657
+ "public.verification": {
2658
+ "name": "verification",
2659
+ "schema": "",
2660
+ "columns": {
2661
+ "id": {
2662
+ "name": "id",
2663
+ "type": "text",
2664
+ "primaryKey": true,
2665
+ "notNull": true
2666
+ },
2667
+ "identifier": {
2668
+ "name": "identifier",
2669
+ "type": "text",
2670
+ "primaryKey": false,
2671
+ "notNull": true
2672
+ },
2673
+ "value": {
2674
+ "name": "value",
2675
+ "type": "text",
2676
+ "primaryKey": false,
2677
+ "notNull": true
2678
+ },
2679
+ "expires_at": {
2680
+ "name": "expires_at",
2681
+ "type": "timestamp with time zone",
2682
+ "primaryKey": false,
2683
+ "notNull": true
2684
+ },
2685
+ "created_at": {
2686
+ "name": "created_at",
2687
+ "type": "timestamp with time zone",
2688
+ "primaryKey": false,
2689
+ "notNull": false
2690
+ },
2691
+ "updated_at": {
2692
+ "name": "updated_at",
2693
+ "type": "timestamp with time zone",
2694
+ "primaryKey": false,
2695
+ "notNull": false
2696
+ }
2697
+ },
2698
+ "indexes": {},
2699
+ "foreignKeys": {},
2700
+ "compositePrimaryKeys": {},
2701
+ "uniqueConstraints": {},
2702
+ "policies": {},
2703
+ "checkConstraints": {},
2704
+ "isRLSEnabled": false
2705
+ }
2706
+ },
2707
+ "enums": {},
2708
+ "schemas": {},
2709
+ "sequences": {},
2710
+ "roles": {},
2711
+ "policies": {},
2712
+ "views": {},
2713
+ "_meta": {
2714
+ "columns": {},
2715
+ "schemas": {},
2716
+ "tables": {}
2717
+ }
2718
+ }