@jant/core 0.6.15 → 0.6.16

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 (112) hide show
  1. package/bin/commands/import-site.js +7 -0
  2. package/dist/app-C75Zc8dD.js +6 -0
  3. package/dist/{app-C-oi_t8W.js → app-C7_4oab9.js} +480 -196
  4. package/dist/client/.vite/manifest.json +8 -8
  5. package/dist/client/_assets/chunks/{url-pLre2DM_.js → url-CU9pEbk5.js} +1 -1
  6. package/dist/client/_assets/{client-DxY5BFe8.js → client-Bq0vre8Y.js} +3 -3
  7. package/dist/client/_assets/client-D3VZyG4L.css +2 -0
  8. package/dist/client/_assets/{client-auth-CakPESv9.js → client-auth-F2rb9WfF.js} +1015 -977
  9. package/dist/{env-OHRKGcMj.js → env-BPYViDJJ.js} +1 -1
  10. package/dist/{export-CsFx6F_M.js → export-Dl5KCiEs.js} +93 -7
  11. package/dist/{github-api-BgSiE71w.js → github-api-BNF35Lkx.js} +1 -1
  12. package/dist/{github-app-BbklkFmU.js → github-app-DdiD-bC4.js} +1 -1
  13. package/dist/{github-sync-ppWXN3jb.js → github-sync-Bqg62IvV.js} +3 -3
  14. package/dist/{github-sync-Cq1pzzOI.js → github-sync-HdK2EgvJ.js} +3 -3
  15. package/dist/index.js +5 -5
  16. package/dist/node.js +6 -6
  17. package/dist/{url-BMYO-Zlt.js → url-CbLAtlZe.js} +517 -12
  18. package/package.json +1 -1
  19. package/src/__tests__/mise-config.test.ts +22 -0
  20. package/src/client/__tests__/compose-bridge.test.ts +252 -2
  21. package/src/client/__tests__/compose-shortcuts.test.ts +20 -0
  22. package/src/client/__tests__/toast.test.ts +65 -1
  23. package/src/client/components/__tests__/compose-format-convert.test.ts +0 -19
  24. package/src/client/components/__tests__/jant-command-palette.test.ts +51 -0
  25. package/src/client/components/__tests__/jant-compose-dialog.test.ts +2015 -318
  26. package/src/client/components/__tests__/jant-compose-editor.test.ts +53 -62
  27. package/src/client/components/__tests__/jant-compose-fullscreen.test.ts +35 -89
  28. package/src/client/components/compose-format-convert.ts +5 -1
  29. package/src/client/components/compose-types.ts +47 -3
  30. package/src/client/components/jant-command-palette.ts +12 -6
  31. package/src/client/components/jant-compose-dialog.ts +1464 -680
  32. package/src/client/components/jant-compose-editor.ts +225 -93
  33. package/src/client/components/jant-compose-fullscreen.ts +3 -5
  34. package/src/client/components/jant-post-menu.ts +91 -21
  35. package/src/client/compose-bridge.ts +143 -122
  36. package/src/client/compose-launch.ts +13 -0
  37. package/src/client/compose-shortcuts.ts +5 -1
  38. package/src/client/post-refresh.ts +135 -0
  39. package/src/client/tiptap/__tests__/link-input-rules.test.ts +121 -0
  40. package/src/client/tiptap/link-input-rules.ts +4 -4
  41. package/src/client/toast.ts +130 -38
  42. package/src/db/__tests__/backfill-thread-activity.test.ts +234 -0
  43. package/src/db/__tests__/thread-activity.test.ts +113 -0
  44. package/src/db/backfills/0005_split_thread_activity_from_quiet_replies.sql +68 -0
  45. package/src/db/migrations/0031_many_ego.sql +3 -0
  46. package/src/db/migrations/meta/0031_snapshot.json +2562 -0
  47. package/src/db/migrations/meta/_journal.json +7 -0
  48. package/src/db/migrations/pg/0029_rare_hairball.sql +3 -0
  49. package/src/db/migrations/pg/meta/0029_snapshot.json +3289 -0
  50. package/src/db/migrations/pg/meta/_journal.json +7 -0
  51. package/src/db/pg/schema.ts +18 -0
  52. package/src/db/schema.ts +20 -0
  53. package/src/db/thread-activity.ts +101 -0
  54. package/src/i18n/locales/public/en.po +89 -21
  55. package/src/i18n/locales/public/en.ts +1 -1
  56. package/src/i18n/locales/public/zh-Hans.po +88 -20
  57. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  58. package/src/i18n/locales/public/zh-Hant.po +88 -20
  59. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  60. package/src/lib/__tests__/feed.test.ts +168 -0
  61. package/src/lib/__tests__/markdown.test.ts +16 -0
  62. package/src/lib/__tests__/slug.test.ts +18 -0
  63. package/src/lib/__tests__/translit.test.ts +87 -0
  64. package/src/lib/__tests__/url.test.ts +53 -0
  65. package/src/lib/feed.ts +113 -11
  66. package/src/lib/hugo-markdown.ts +5 -0
  67. package/src/lib/link-preview.ts +25 -0
  68. package/src/lib/markdown-manager.ts +6 -1
  69. package/src/lib/post-display.ts +42 -9
  70. package/src/lib/timeline.ts +39 -9
  71. package/src/lib/tiptap-render.ts +4 -2
  72. package/src/lib/translit.ts +288 -0
  73. package/src/lib/url.ts +123 -12
  74. package/src/lib/view.ts +28 -0
  75. package/src/routes/api/__tests__/palette.test.ts +44 -0
  76. package/src/routes/api/posts.ts +13 -9
  77. package/src/routes/api/public/__tests__/posts.test.ts +38 -0
  78. package/src/routes/api/public/posts.ts +7 -0
  79. package/src/routes/compose.tsx +6 -2
  80. package/src/routes/feed/__tests__/sitemap.test.ts +68 -1
  81. package/src/routes/pages/__tests__/archive-params.test.ts +292 -0
  82. package/src/routes/pages/__tests__/featured.test.ts +6 -2
  83. package/src/routes/pages/__tests__/preview.test.ts +3 -1
  84. package/src/routes/pages/archive.tsx +65 -17
  85. package/src/routes/pages/page.tsx +5 -2
  86. package/src/services/__tests__/collection.test.ts +32 -1
  87. package/src/services/__tests__/post-timeline.test.ts +142 -11
  88. package/src/services/__tests__/post.test.ts +277 -0
  89. package/src/services/collection.ts +8 -10
  90. package/src/services/export-theme/assets/client-site.css +1 -1
  91. package/src/services/export.ts +3 -5
  92. package/src/services/path.ts +4 -1
  93. package/src/services/post.ts +297 -100
  94. package/src/services/search.ts +9 -0
  95. package/src/styles/components.css +0 -14
  96. package/src/styles/site-media.css +4 -4
  97. package/src/styles/tokens.css +62 -1
  98. package/src/styles/ui.css +1363 -1283
  99. package/src/types/entities.ts +5 -0
  100. package/src/types/props.ts +12 -0
  101. package/src/types/views.ts +6 -0
  102. package/src/ui/compose/ComposeDialog.tsx +17 -17
  103. package/src/ui/feed/LinkPreview.tsx +2 -7
  104. package/src/ui/feed/PostStatusBadges.tsx +42 -3
  105. package/src/ui/pages/ArchivePage.tsx +131 -24
  106. package/src/ui/pages/__tests__/ArchivePage.test.tsx +63 -0
  107. package/src/ui/shared/DraftPreviewBar.tsx +25 -9
  108. package/src/ui/shared/PostFooter.tsx +35 -12
  109. package/src/ui/shared/custom-icons.ts +5 -0
  110. package/src/ui/shared/post-article-attributes.ts +6 -0
  111. package/dist/app-BxCOR3Uc.js +0 -6
  112. package/dist/client/_assets/client-B_eGKN5p.css +0 -2
@@ -0,0 +1,3289 @@
1
+ {
2
+ "id": "69aa05e6-c4ab-48b3-8e23-fb8dfc3443e8",
3
+ "prevId": "7c37f5e6-29ce-41f3-ab1e-8c983db3a231",
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
+ "post_id": {
894
+ "name": "post_id",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": false
898
+ },
899
+ "label": {
900
+ "name": "label",
901
+ "type": "text",
902
+ "primaryKey": false,
903
+ "notNull": true
904
+ },
905
+ "url": {
906
+ "name": "url",
907
+ "type": "text",
908
+ "primaryKey": false,
909
+ "notNull": true
910
+ },
911
+ "placement": {
912
+ "name": "placement",
913
+ "type": "text",
914
+ "primaryKey": false,
915
+ "notNull": true,
916
+ "default": "'header'"
917
+ },
918
+ "position": {
919
+ "name": "position",
920
+ "type": "text",
921
+ "primaryKey": false,
922
+ "notNull": true,
923
+ "default": "'a0'"
924
+ },
925
+ "created_at": {
926
+ "name": "created_at",
927
+ "type": "integer",
928
+ "primaryKey": false,
929
+ "notNull": true
930
+ },
931
+ "updated_at": {
932
+ "name": "updated_at",
933
+ "type": "integer",
934
+ "primaryKey": false,
935
+ "notNull": true
936
+ }
937
+ },
938
+ "indexes": {
939
+ "uq_nav_item_site_position": {
940
+ "name": "uq_nav_item_site_position",
941
+ "columns": [
942
+ {
943
+ "expression": "site_id",
944
+ "isExpression": false,
945
+ "asc": true,
946
+ "nulls": "last"
947
+ },
948
+ {
949
+ "expression": "position",
950
+ "isExpression": false,
951
+ "asc": true,
952
+ "nulls": "last"
953
+ }
954
+ ],
955
+ "isUnique": true,
956
+ "concurrently": false,
957
+ "method": "btree",
958
+ "with": {}
959
+ },
960
+ "uq_nav_item_site_system_key": {
961
+ "name": "uq_nav_item_site_system_key",
962
+ "columns": [
963
+ {
964
+ "expression": "site_id",
965
+ "isExpression": false,
966
+ "asc": true,
967
+ "nulls": "last"
968
+ },
969
+ {
970
+ "expression": "system_key",
971
+ "isExpression": false,
972
+ "asc": true,
973
+ "nulls": "last"
974
+ }
975
+ ],
976
+ "isUnique": true,
977
+ "where": "\"nav_item\".\"system_key\" IS NOT NULL",
978
+ "concurrently": false,
979
+ "method": "btree",
980
+ "with": {}
981
+ },
982
+ "uq_nav_item_site_collection_id": {
983
+ "name": "uq_nav_item_site_collection_id",
984
+ "columns": [
985
+ {
986
+ "expression": "site_id",
987
+ "isExpression": false,
988
+ "asc": true,
989
+ "nulls": "last"
990
+ },
991
+ {
992
+ "expression": "collection_id",
993
+ "isExpression": false,
994
+ "asc": true,
995
+ "nulls": "last"
996
+ }
997
+ ],
998
+ "isUnique": true,
999
+ "where": "\"nav_item\".\"collection_id\" IS NOT NULL",
1000
+ "concurrently": false,
1001
+ "method": "btree",
1002
+ "with": {}
1003
+ },
1004
+ "uq_nav_item_site_post_id": {
1005
+ "name": "uq_nav_item_site_post_id",
1006
+ "columns": [
1007
+ {
1008
+ "expression": "site_id",
1009
+ "isExpression": false,
1010
+ "asc": true,
1011
+ "nulls": "last"
1012
+ },
1013
+ {
1014
+ "expression": "post_id",
1015
+ "isExpression": false,
1016
+ "asc": true,
1017
+ "nulls": "last"
1018
+ }
1019
+ ],
1020
+ "isUnique": true,
1021
+ "where": "\"nav_item\".\"post_id\" IS NOT NULL",
1022
+ "concurrently": false,
1023
+ "method": "btree",
1024
+ "with": {}
1025
+ }
1026
+ },
1027
+ "foreignKeys": {
1028
+ "nav_item_site_id_site_id_fk": {
1029
+ "name": "nav_item_site_id_site_id_fk",
1030
+ "tableFrom": "nav_item",
1031
+ "tableTo": "site",
1032
+ "columnsFrom": ["site_id"],
1033
+ "columnsTo": ["id"],
1034
+ "onDelete": "cascade",
1035
+ "onUpdate": "no action"
1036
+ },
1037
+ "nav_item_collection_id_collection_id_fk": {
1038
+ "name": "nav_item_collection_id_collection_id_fk",
1039
+ "tableFrom": "nav_item",
1040
+ "tableTo": "collection",
1041
+ "columnsFrom": ["collection_id"],
1042
+ "columnsTo": ["id"],
1043
+ "onDelete": "cascade",
1044
+ "onUpdate": "no action"
1045
+ },
1046
+ "nav_item_post_id_post_id_fk": {
1047
+ "name": "nav_item_post_id_post_id_fk",
1048
+ "tableFrom": "nav_item",
1049
+ "tableTo": "post",
1050
+ "columnsFrom": ["post_id"],
1051
+ "columnsTo": ["id"],
1052
+ "onDelete": "cascade",
1053
+ "onUpdate": "no action"
1054
+ }
1055
+ },
1056
+ "compositePrimaryKeys": {},
1057
+ "uniqueConstraints": {},
1058
+ "policies": {},
1059
+ "checkConstraints": {
1060
+ "chk_nav_item_type": {
1061
+ "name": "chk_nav_item_type",
1062
+ "value": "\"nav_item\".\"type\" IN ('link', 'system', 'collection', 'page')"
1063
+ },
1064
+ "chk_nav_item_placement": {
1065
+ "name": "chk_nav_item_placement",
1066
+ "value": "\"nav_item\".\"placement\" IN ('header', 'more')"
1067
+ },
1068
+ "chk_nav_item_shape": {
1069
+ "name": "chk_nav_item_shape",
1070
+ "value": "(\n \"nav_item\".\"type\" = 'link'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n AND \"nav_item\".\"post_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 AND \"nav_item\".\"post_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 AND \"nav_item\".\"post_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'page'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n AND \"nav_item\".\"post_id\" IS NOT NULL\n )"
1071
+ }
1072
+ },
1073
+ "isRLSEnabled": false
1074
+ },
1075
+ "public.path_registry": {
1076
+ "name": "path_registry",
1077
+ "schema": "",
1078
+ "columns": {
1079
+ "id": {
1080
+ "name": "id",
1081
+ "type": "text",
1082
+ "primaryKey": true,
1083
+ "notNull": true
1084
+ },
1085
+ "site_id": {
1086
+ "name": "site_id",
1087
+ "type": "text",
1088
+ "primaryKey": false,
1089
+ "notNull": true
1090
+ },
1091
+ "path": {
1092
+ "name": "path",
1093
+ "type": "text",
1094
+ "primaryKey": false,
1095
+ "notNull": true
1096
+ },
1097
+ "kind": {
1098
+ "name": "kind",
1099
+ "type": "text",
1100
+ "primaryKey": false,
1101
+ "notNull": true
1102
+ },
1103
+ "post_id": {
1104
+ "name": "post_id",
1105
+ "type": "text",
1106
+ "primaryKey": false,
1107
+ "notNull": false
1108
+ },
1109
+ "collection_id": {
1110
+ "name": "collection_id",
1111
+ "type": "text",
1112
+ "primaryKey": false,
1113
+ "notNull": false
1114
+ },
1115
+ "redirect_to_path": {
1116
+ "name": "redirect_to_path",
1117
+ "type": "text",
1118
+ "primaryKey": false,
1119
+ "notNull": false
1120
+ },
1121
+ "redirect_type": {
1122
+ "name": "redirect_type",
1123
+ "type": "integer",
1124
+ "primaryKey": false,
1125
+ "notNull": false
1126
+ },
1127
+ "archive_query": {
1128
+ "name": "archive_query",
1129
+ "type": "text",
1130
+ "primaryKey": false,
1131
+ "notNull": false
1132
+ },
1133
+ "created_at": {
1134
+ "name": "created_at",
1135
+ "type": "integer",
1136
+ "primaryKey": false,
1137
+ "notNull": true
1138
+ },
1139
+ "updated_at": {
1140
+ "name": "updated_at",
1141
+ "type": "integer",
1142
+ "primaryKey": false,
1143
+ "notNull": true
1144
+ }
1145
+ },
1146
+ "indexes": {
1147
+ "uq_path_registry_site_path": {
1148
+ "name": "uq_path_registry_site_path",
1149
+ "columns": [
1150
+ {
1151
+ "expression": "site_id",
1152
+ "isExpression": false,
1153
+ "asc": true,
1154
+ "nulls": "last"
1155
+ },
1156
+ {
1157
+ "expression": "path",
1158
+ "isExpression": false,
1159
+ "asc": true,
1160
+ "nulls": "last"
1161
+ }
1162
+ ],
1163
+ "isUnique": true,
1164
+ "concurrently": false,
1165
+ "method": "btree",
1166
+ "with": {}
1167
+ },
1168
+ "uq_path_registry_site_post_slug": {
1169
+ "name": "uq_path_registry_site_post_slug",
1170
+ "columns": [
1171
+ {
1172
+ "expression": "site_id",
1173
+ "isExpression": false,
1174
+ "asc": true,
1175
+ "nulls": "last"
1176
+ },
1177
+ {
1178
+ "expression": "post_id",
1179
+ "isExpression": false,
1180
+ "asc": true,
1181
+ "nulls": "last"
1182
+ }
1183
+ ],
1184
+ "isUnique": true,
1185
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"post_id\" IS NOT NULL",
1186
+ "concurrently": false,
1187
+ "method": "btree",
1188
+ "with": {}
1189
+ },
1190
+ "uq_path_registry_site_collection_slug": {
1191
+ "name": "uq_path_registry_site_collection_slug",
1192
+ "columns": [
1193
+ {
1194
+ "expression": "site_id",
1195
+ "isExpression": false,
1196
+ "asc": true,
1197
+ "nulls": "last"
1198
+ },
1199
+ {
1200
+ "expression": "collection_id",
1201
+ "isExpression": false,
1202
+ "asc": true,
1203
+ "nulls": "last"
1204
+ }
1205
+ ],
1206
+ "isUnique": true,
1207
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"collection_id\" IS NOT NULL",
1208
+ "concurrently": false,
1209
+ "method": "btree",
1210
+ "with": {}
1211
+ },
1212
+ "idx_path_registry_site_post_id": {
1213
+ "name": "idx_path_registry_site_post_id",
1214
+ "columns": [
1215
+ {
1216
+ "expression": "site_id",
1217
+ "isExpression": false,
1218
+ "asc": true,
1219
+ "nulls": "last"
1220
+ },
1221
+ {
1222
+ "expression": "post_id",
1223
+ "isExpression": false,
1224
+ "asc": true,
1225
+ "nulls": "last"
1226
+ }
1227
+ ],
1228
+ "isUnique": false,
1229
+ "concurrently": false,
1230
+ "method": "btree",
1231
+ "with": {}
1232
+ },
1233
+ "idx_path_registry_site_collection_id": {
1234
+ "name": "idx_path_registry_site_collection_id",
1235
+ "columns": [
1236
+ {
1237
+ "expression": "site_id",
1238
+ "isExpression": false,
1239
+ "asc": true,
1240
+ "nulls": "last"
1241
+ },
1242
+ {
1243
+ "expression": "collection_id",
1244
+ "isExpression": false,
1245
+ "asc": true,
1246
+ "nulls": "last"
1247
+ }
1248
+ ],
1249
+ "isUnique": false,
1250
+ "concurrently": false,
1251
+ "method": "btree",
1252
+ "with": {}
1253
+ }
1254
+ },
1255
+ "foreignKeys": {
1256
+ "path_registry_site_id_site_id_fk": {
1257
+ "name": "path_registry_site_id_site_id_fk",
1258
+ "tableFrom": "path_registry",
1259
+ "tableTo": "site",
1260
+ "columnsFrom": ["site_id"],
1261
+ "columnsTo": ["id"],
1262
+ "onDelete": "cascade",
1263
+ "onUpdate": "no action"
1264
+ },
1265
+ "path_registry_post_id_post_id_fk": {
1266
+ "name": "path_registry_post_id_post_id_fk",
1267
+ "tableFrom": "path_registry",
1268
+ "tableTo": "post",
1269
+ "columnsFrom": ["post_id"],
1270
+ "columnsTo": ["id"],
1271
+ "onDelete": "cascade",
1272
+ "onUpdate": "no action"
1273
+ },
1274
+ "path_registry_collection_id_collection_id_fk": {
1275
+ "name": "path_registry_collection_id_collection_id_fk",
1276
+ "tableFrom": "path_registry",
1277
+ "tableTo": "collection",
1278
+ "columnsFrom": ["collection_id"],
1279
+ "columnsTo": ["id"],
1280
+ "onDelete": "cascade",
1281
+ "onUpdate": "no action"
1282
+ }
1283
+ },
1284
+ "compositePrimaryKeys": {},
1285
+ "uniqueConstraints": {},
1286
+ "policies": {},
1287
+ "checkConstraints": {
1288
+ "chk_path_registry_kind": {
1289
+ "name": "chk_path_registry_kind",
1290
+ "value": "\"path_registry\".\"kind\" IN ('slug', 'alias', 'redirect', 'archive')"
1291
+ },
1292
+ "chk_path_registry_shape": {
1293
+ "name": "chk_path_registry_shape",
1294
+ "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 )"
1295
+ }
1296
+ },
1297
+ "isRLSEnabled": false
1298
+ },
1299
+ "public.post": {
1300
+ "name": "post",
1301
+ "schema": "",
1302
+ "columns": {
1303
+ "id": {
1304
+ "name": "id",
1305
+ "type": "text",
1306
+ "primaryKey": true,
1307
+ "notNull": true
1308
+ },
1309
+ "site_id": {
1310
+ "name": "site_id",
1311
+ "type": "text",
1312
+ "primaryKey": false,
1313
+ "notNull": true
1314
+ },
1315
+ "format": {
1316
+ "name": "format",
1317
+ "type": "text",
1318
+ "primaryKey": false,
1319
+ "notNull": true
1320
+ },
1321
+ "status": {
1322
+ "name": "status",
1323
+ "type": "text",
1324
+ "primaryKey": false,
1325
+ "notNull": true,
1326
+ "default": "'published'"
1327
+ },
1328
+ "visibility": {
1329
+ "name": "visibility",
1330
+ "type": "text",
1331
+ "primaryKey": false,
1332
+ "notNull": false,
1333
+ "default": "'public'"
1334
+ },
1335
+ "pinned_at": {
1336
+ "name": "pinned_at",
1337
+ "type": "integer",
1338
+ "primaryKey": false,
1339
+ "notNull": false
1340
+ },
1341
+ "featured_at": {
1342
+ "name": "featured_at",
1343
+ "type": "integer",
1344
+ "primaryKey": false,
1345
+ "notNull": false
1346
+ },
1347
+ "title": {
1348
+ "name": "title",
1349
+ "type": "text",
1350
+ "primaryKey": false,
1351
+ "notNull": false
1352
+ },
1353
+ "url": {
1354
+ "name": "url",
1355
+ "type": "text",
1356
+ "primaryKey": false,
1357
+ "notNull": false
1358
+ },
1359
+ "body": {
1360
+ "name": "body",
1361
+ "type": "text",
1362
+ "primaryKey": false,
1363
+ "notNull": false
1364
+ },
1365
+ "body_html": {
1366
+ "name": "body_html",
1367
+ "type": "text",
1368
+ "primaryKey": false,
1369
+ "notNull": false
1370
+ },
1371
+ "body_html_version": {
1372
+ "name": "body_html_version",
1373
+ "type": "integer",
1374
+ "primaryKey": false,
1375
+ "notNull": true,
1376
+ "default": 1
1377
+ },
1378
+ "body_text": {
1379
+ "name": "body_text",
1380
+ "type": "text",
1381
+ "primaryKey": false,
1382
+ "notNull": false
1383
+ },
1384
+ "quote_text": {
1385
+ "name": "quote_text",
1386
+ "type": "text",
1387
+ "primaryKey": false,
1388
+ "notNull": false
1389
+ },
1390
+ "summary": {
1391
+ "name": "summary",
1392
+ "type": "text",
1393
+ "primaryKey": false,
1394
+ "notNull": false
1395
+ },
1396
+ "search_text": {
1397
+ "name": "search_text",
1398
+ "type": "text",
1399
+ "primaryKey": false,
1400
+ "notNull": false,
1401
+ "generated": {
1402
+ "as": "coalesce(\"title\", '') || ' ' || coalesce(\"url\", '') || ' ' || coalesce(\"quote_text\", '') || ' ' || coalesce(\"body_text\", '')",
1403
+ "type": "stored"
1404
+ }
1405
+ },
1406
+ "search_document": {
1407
+ "name": "search_document",
1408
+ "type": "tsvector",
1409
+ "primaryKey": false,
1410
+ "notNull": false,
1411
+ "generated": {
1412
+ "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')",
1413
+ "type": "stored"
1414
+ }
1415
+ },
1416
+ "rating": {
1417
+ "name": "rating",
1418
+ "type": "integer",
1419
+ "primaryKey": false,
1420
+ "notNull": false
1421
+ },
1422
+ "preview_image_key": {
1423
+ "name": "preview_image_key",
1424
+ "type": "text",
1425
+ "primaryKey": false,
1426
+ "notNull": false
1427
+ },
1428
+ "preview_kind": {
1429
+ "name": "preview_kind",
1430
+ "type": "text",
1431
+ "primaryKey": false,
1432
+ "notNull": false
1433
+ },
1434
+ "preview_provider": {
1435
+ "name": "preview_provider",
1436
+ "type": "text",
1437
+ "primaryKey": false,
1438
+ "notNull": false
1439
+ },
1440
+ "reply_to_id": {
1441
+ "name": "reply_to_id",
1442
+ "type": "text",
1443
+ "primaryKey": false,
1444
+ "notNull": false
1445
+ },
1446
+ "thread_id": {
1447
+ "name": "thread_id",
1448
+ "type": "text",
1449
+ "primaryKey": false,
1450
+ "notNull": true
1451
+ },
1452
+ "quiet_reply": {
1453
+ "name": "quiet_reply",
1454
+ "type": "boolean",
1455
+ "primaryKey": false,
1456
+ "notNull": true,
1457
+ "default": false
1458
+ },
1459
+ "published_at": {
1460
+ "name": "published_at",
1461
+ "type": "integer",
1462
+ "primaryKey": false,
1463
+ "notNull": false
1464
+ },
1465
+ "last_activity_at": {
1466
+ "name": "last_activity_at",
1467
+ "type": "integer",
1468
+ "primaryKey": false,
1469
+ "notNull": false
1470
+ },
1471
+ "thread_updated_at": {
1472
+ "name": "thread_updated_at",
1473
+ "type": "integer",
1474
+ "primaryKey": false,
1475
+ "notNull": false
1476
+ },
1477
+ "created_at": {
1478
+ "name": "created_at",
1479
+ "type": "integer",
1480
+ "primaryKey": false,
1481
+ "notNull": true
1482
+ },
1483
+ "updated_at": {
1484
+ "name": "updated_at",
1485
+ "type": "integer",
1486
+ "primaryKey": false,
1487
+ "notNull": true
1488
+ }
1489
+ },
1490
+ "indexes": {
1491
+ "idx_post_site_thread_id": {
1492
+ "name": "idx_post_site_thread_id",
1493
+ "columns": [
1494
+ {
1495
+ "expression": "site_id",
1496
+ "isExpression": false,
1497
+ "asc": true,
1498
+ "nulls": "last"
1499
+ },
1500
+ {
1501
+ "expression": "thread_id",
1502
+ "isExpression": false,
1503
+ "asc": true,
1504
+ "nulls": "last"
1505
+ }
1506
+ ],
1507
+ "isUnique": false,
1508
+ "concurrently": false,
1509
+ "method": "btree",
1510
+ "with": {}
1511
+ },
1512
+ "idx_post_site_thread_created": {
1513
+ "name": "idx_post_site_thread_created",
1514
+ "columns": [
1515
+ {
1516
+ "expression": "site_id",
1517
+ "isExpression": false,
1518
+ "asc": true,
1519
+ "nulls": "last"
1520
+ },
1521
+ {
1522
+ "expression": "thread_id",
1523
+ "isExpression": false,
1524
+ "asc": true,
1525
+ "nulls": "last"
1526
+ },
1527
+ {
1528
+ "expression": "created_at",
1529
+ "isExpression": false,
1530
+ "asc": true,
1531
+ "nulls": "last"
1532
+ },
1533
+ {
1534
+ "expression": "id",
1535
+ "isExpression": false,
1536
+ "asc": true,
1537
+ "nulls": "last"
1538
+ }
1539
+ ],
1540
+ "isUnique": false,
1541
+ "concurrently": false,
1542
+ "method": "btree",
1543
+ "with": {}
1544
+ },
1545
+ "idx_post_site_status_published": {
1546
+ "name": "idx_post_site_status_published",
1547
+ "columns": [
1548
+ {
1549
+ "expression": "site_id",
1550
+ "isExpression": false,
1551
+ "asc": true,
1552
+ "nulls": "last"
1553
+ },
1554
+ {
1555
+ "expression": "status",
1556
+ "isExpression": false,
1557
+ "asc": true,
1558
+ "nulls": "last"
1559
+ },
1560
+ {
1561
+ "expression": "published_at",
1562
+ "isExpression": false,
1563
+ "asc": true,
1564
+ "nulls": "last"
1565
+ }
1566
+ ],
1567
+ "isUnique": false,
1568
+ "concurrently": false,
1569
+ "method": "btree",
1570
+ "with": {}
1571
+ },
1572
+ "idx_post_site_status_activity": {
1573
+ "name": "idx_post_site_status_activity",
1574
+ "columns": [
1575
+ {
1576
+ "expression": "site_id",
1577
+ "isExpression": false,
1578
+ "asc": true,
1579
+ "nulls": "last"
1580
+ },
1581
+ {
1582
+ "expression": "status",
1583
+ "isExpression": false,
1584
+ "asc": true,
1585
+ "nulls": "last"
1586
+ },
1587
+ {
1588
+ "expression": "last_activity_at",
1589
+ "isExpression": false,
1590
+ "asc": true,
1591
+ "nulls": "last"
1592
+ }
1593
+ ],
1594
+ "isUnique": false,
1595
+ "concurrently": false,
1596
+ "method": "btree",
1597
+ "with": {}
1598
+ },
1599
+ "idx_post_site_root_published_activity": {
1600
+ "name": "idx_post_site_root_published_activity",
1601
+ "columns": [
1602
+ {
1603
+ "expression": "site_id",
1604
+ "isExpression": false,
1605
+ "asc": true,
1606
+ "nulls": "last"
1607
+ },
1608
+ {
1609
+ "expression": "last_activity_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
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'",
1623
+ "concurrently": false,
1624
+ "method": "btree",
1625
+ "with": {}
1626
+ },
1627
+ "idx_post_site_root_thread_updated": {
1628
+ "name": "idx_post_site_root_thread_updated",
1629
+ "columns": [
1630
+ {
1631
+ "expression": "site_id",
1632
+ "isExpression": false,
1633
+ "asc": true,
1634
+ "nulls": "last"
1635
+ },
1636
+ {
1637
+ "expression": "thread_updated_at",
1638
+ "isExpression": false,
1639
+ "asc": true,
1640
+ "nulls": "last"
1641
+ },
1642
+ {
1643
+ "expression": "id",
1644
+ "isExpression": false,
1645
+ "asc": true,
1646
+ "nulls": "last"
1647
+ }
1648
+ ],
1649
+ "isUnique": false,
1650
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'",
1651
+ "concurrently": false,
1652
+ "method": "btree",
1653
+ "with": {}
1654
+ },
1655
+ "idx_post_site_root_draft_updated": {
1656
+ "name": "idx_post_site_root_draft_updated",
1657
+ "columns": [
1658
+ {
1659
+ "expression": "site_id",
1660
+ "isExpression": false,
1661
+ "asc": true,
1662
+ "nulls": "last"
1663
+ },
1664
+ {
1665
+ "expression": "updated_at",
1666
+ "isExpression": false,
1667
+ "asc": true,
1668
+ "nulls": "last"
1669
+ },
1670
+ {
1671
+ "expression": "id",
1672
+ "isExpression": false,
1673
+ "asc": true,
1674
+ "nulls": "last"
1675
+ }
1676
+ ],
1677
+ "isUnique": false,
1678
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'draft'",
1679
+ "concurrently": false,
1680
+ "method": "btree",
1681
+ "with": {}
1682
+ },
1683
+ "idx_post_site_reply_thread_created": {
1684
+ "name": "idx_post_site_reply_thread_created",
1685
+ "columns": [
1686
+ {
1687
+ "expression": "site_id",
1688
+ "isExpression": false,
1689
+ "asc": true,
1690
+ "nulls": "last"
1691
+ },
1692
+ {
1693
+ "expression": "thread_id",
1694
+ "isExpression": false,
1695
+ "asc": true,
1696
+ "nulls": "last"
1697
+ },
1698
+ {
1699
+ "expression": "created_at",
1700
+ "isExpression": false,
1701
+ "asc": true,
1702
+ "nulls": "last"
1703
+ },
1704
+ {
1705
+ "expression": "id",
1706
+ "isExpression": false,
1707
+ "asc": true,
1708
+ "nulls": "last"
1709
+ }
1710
+ ],
1711
+ "isUnique": false,
1712
+ "where": "\"post\".\"reply_to_id\" IS NOT NULL AND \"post\".\"status\" = 'published'",
1713
+ "concurrently": false,
1714
+ "method": "btree",
1715
+ "with": {}
1716
+ },
1717
+ "idx_post_site_featured_thread_published": {
1718
+ "name": "idx_post_site_featured_thread_published",
1719
+ "columns": [
1720
+ {
1721
+ "expression": "site_id",
1722
+ "isExpression": false,
1723
+ "asc": true,
1724
+ "nulls": "last"
1725
+ },
1726
+ {
1727
+ "expression": "thread_id",
1728
+ "isExpression": false,
1729
+ "asc": true,
1730
+ "nulls": "last"
1731
+ },
1732
+ {
1733
+ "expression": "published_at",
1734
+ "isExpression": false,
1735
+ "asc": true,
1736
+ "nulls": "last"
1737
+ },
1738
+ {
1739
+ "expression": "id",
1740
+ "isExpression": false,
1741
+ "asc": true,
1742
+ "nulls": "last"
1743
+ }
1744
+ ],
1745
+ "isUnique": false,
1746
+ "where": "\"post\".\"status\" = 'published' AND \"post\".\"featured_at\" IS NOT NULL",
1747
+ "concurrently": false,
1748
+ "method": "btree",
1749
+ "with": {}
1750
+ },
1751
+ "idx_post_search_document": {
1752
+ "name": "idx_post_search_document",
1753
+ "columns": [
1754
+ {
1755
+ "expression": "search_document",
1756
+ "isExpression": false,
1757
+ "asc": true,
1758
+ "nulls": "last"
1759
+ }
1760
+ ],
1761
+ "isUnique": false,
1762
+ "concurrently": false,
1763
+ "method": "gin",
1764
+ "with": {}
1765
+ },
1766
+ "idx_post_search_text_trgm": {
1767
+ "name": "idx_post_search_text_trgm",
1768
+ "columns": [
1769
+ {
1770
+ "expression": "search_text",
1771
+ "isExpression": false,
1772
+ "asc": true,
1773
+ "nulls": "last",
1774
+ "opclass": "gin_trgm_ops"
1775
+ }
1776
+ ],
1777
+ "isUnique": false,
1778
+ "concurrently": false,
1779
+ "method": "gin",
1780
+ "with": {}
1781
+ }
1782
+ },
1783
+ "foreignKeys": {
1784
+ "post_site_id_site_id_fk": {
1785
+ "name": "post_site_id_site_id_fk",
1786
+ "tableFrom": "post",
1787
+ "tableTo": "site",
1788
+ "columnsFrom": ["site_id"],
1789
+ "columnsTo": ["id"],
1790
+ "onDelete": "cascade",
1791
+ "onUpdate": "no action"
1792
+ },
1793
+ "post_site_id_reply_to_id_post_site_id_id_fk": {
1794
+ "name": "post_site_id_reply_to_id_post_site_id_id_fk",
1795
+ "tableFrom": "post",
1796
+ "tableTo": "post",
1797
+ "columnsFrom": ["site_id", "reply_to_id"],
1798
+ "columnsTo": ["site_id", "id"],
1799
+ "onDelete": "no action",
1800
+ "onUpdate": "no action"
1801
+ },
1802
+ "post_site_id_thread_id_post_site_id_id_fk": {
1803
+ "name": "post_site_id_thread_id_post_site_id_id_fk",
1804
+ "tableFrom": "post",
1805
+ "tableTo": "post",
1806
+ "columnsFrom": ["site_id", "thread_id"],
1807
+ "columnsTo": ["site_id", "id"],
1808
+ "onDelete": "no action",
1809
+ "onUpdate": "no action"
1810
+ }
1811
+ },
1812
+ "compositePrimaryKeys": {},
1813
+ "uniqueConstraints": {
1814
+ "uq_post_site_id_id": {
1815
+ "name": "uq_post_site_id_id",
1816
+ "nullsNotDistinct": false,
1817
+ "columns": ["site_id", "id"]
1818
+ }
1819
+ },
1820
+ "policies": {},
1821
+ "checkConstraints": {
1822
+ "chk_post_reply_to_not_self": {
1823
+ "name": "chk_post_reply_to_not_self",
1824
+ "value": "\"post\".\"reply_to_id\" IS NULL OR \"post\".\"reply_to_id\" <> \"post\".\"id\""
1825
+ },
1826
+ "chk_post_thread_shape": {
1827
+ "name": "chk_post_thread_shape",
1828
+ "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 )"
1829
+ }
1830
+ },
1831
+ "isRLSEnabled": false
1832
+ },
1833
+ "public.rate_limit": {
1834
+ "name": "rate_limit",
1835
+ "schema": "",
1836
+ "columns": {
1837
+ "key": {
1838
+ "name": "key",
1839
+ "type": "text",
1840
+ "primaryKey": false,
1841
+ "notNull": true
1842
+ },
1843
+ "window_start": {
1844
+ "name": "window_start",
1845
+ "type": "integer",
1846
+ "primaryKey": false,
1847
+ "notNull": true
1848
+ },
1849
+ "count": {
1850
+ "name": "count",
1851
+ "type": "integer",
1852
+ "primaryKey": false,
1853
+ "notNull": true,
1854
+ "default": 0
1855
+ }
1856
+ },
1857
+ "indexes": {},
1858
+ "foreignKeys": {},
1859
+ "compositePrimaryKeys": {
1860
+ "rate_limit_key_window_start_pk": {
1861
+ "name": "rate_limit_key_window_start_pk",
1862
+ "columns": ["key", "window_start"]
1863
+ }
1864
+ },
1865
+ "uniqueConstraints": {},
1866
+ "policies": {},
1867
+ "checkConstraints": {},
1868
+ "isRLSEnabled": false
1869
+ },
1870
+ "public.session": {
1871
+ "name": "session",
1872
+ "schema": "",
1873
+ "columns": {
1874
+ "id": {
1875
+ "name": "id",
1876
+ "type": "text",
1877
+ "primaryKey": true,
1878
+ "notNull": true
1879
+ },
1880
+ "expires_at": {
1881
+ "name": "expires_at",
1882
+ "type": "timestamp with time zone",
1883
+ "primaryKey": false,
1884
+ "notNull": true
1885
+ },
1886
+ "token": {
1887
+ "name": "token",
1888
+ "type": "text",
1889
+ "primaryKey": false,
1890
+ "notNull": true
1891
+ },
1892
+ "created_at": {
1893
+ "name": "created_at",
1894
+ "type": "timestamp with time zone",
1895
+ "primaryKey": false,
1896
+ "notNull": true
1897
+ },
1898
+ "updated_at": {
1899
+ "name": "updated_at",
1900
+ "type": "timestamp with time zone",
1901
+ "primaryKey": false,
1902
+ "notNull": true
1903
+ },
1904
+ "ip_address": {
1905
+ "name": "ip_address",
1906
+ "type": "text",
1907
+ "primaryKey": false,
1908
+ "notNull": false
1909
+ },
1910
+ "user_agent": {
1911
+ "name": "user_agent",
1912
+ "type": "text",
1913
+ "primaryKey": false,
1914
+ "notNull": false
1915
+ },
1916
+ "user_id": {
1917
+ "name": "user_id",
1918
+ "type": "text",
1919
+ "primaryKey": false,
1920
+ "notNull": true
1921
+ }
1922
+ },
1923
+ "indexes": {
1924
+ "idx_session_user_id": {
1925
+ "name": "idx_session_user_id",
1926
+ "columns": [
1927
+ {
1928
+ "expression": "user_id",
1929
+ "isExpression": false,
1930
+ "asc": true,
1931
+ "nulls": "last"
1932
+ }
1933
+ ],
1934
+ "isUnique": false,
1935
+ "concurrently": false,
1936
+ "method": "btree",
1937
+ "with": {}
1938
+ }
1939
+ },
1940
+ "foreignKeys": {
1941
+ "session_user_id_user_id_fk": {
1942
+ "name": "session_user_id_user_id_fk",
1943
+ "tableFrom": "session",
1944
+ "tableTo": "user",
1945
+ "columnsFrom": ["user_id"],
1946
+ "columnsTo": ["id"],
1947
+ "onDelete": "no action",
1948
+ "onUpdate": "no action"
1949
+ }
1950
+ },
1951
+ "compositePrimaryKeys": {},
1952
+ "uniqueConstraints": {
1953
+ "session_token_unique": {
1954
+ "name": "session_token_unique",
1955
+ "nullsNotDistinct": false,
1956
+ "columns": ["token"]
1957
+ }
1958
+ },
1959
+ "policies": {},
1960
+ "checkConstraints": {},
1961
+ "isRLSEnabled": false
1962
+ },
1963
+ "public.site_setting": {
1964
+ "name": "site_setting",
1965
+ "schema": "",
1966
+ "columns": {
1967
+ "site_id": {
1968
+ "name": "site_id",
1969
+ "type": "text",
1970
+ "primaryKey": false,
1971
+ "notNull": true
1972
+ },
1973
+ "key": {
1974
+ "name": "key",
1975
+ "type": "text",
1976
+ "primaryKey": false,
1977
+ "notNull": true
1978
+ },
1979
+ "value": {
1980
+ "name": "value",
1981
+ "type": "text",
1982
+ "primaryKey": false,
1983
+ "notNull": true
1984
+ },
1985
+ "updated_at": {
1986
+ "name": "updated_at",
1987
+ "type": "integer",
1988
+ "primaryKey": false,
1989
+ "notNull": true
1990
+ }
1991
+ },
1992
+ "indexes": {
1993
+ "idx_site_setting_site_id": {
1994
+ "name": "idx_site_setting_site_id",
1995
+ "columns": [
1996
+ {
1997
+ "expression": "site_id",
1998
+ "isExpression": false,
1999
+ "asc": true,
2000
+ "nulls": "last"
2001
+ }
2002
+ ],
2003
+ "isUnique": false,
2004
+ "concurrently": false,
2005
+ "method": "btree",
2006
+ "with": {}
2007
+ }
2008
+ },
2009
+ "foreignKeys": {
2010
+ "site_setting_site_id_site_id_fk": {
2011
+ "name": "site_setting_site_id_site_id_fk",
2012
+ "tableFrom": "site_setting",
2013
+ "tableTo": "site",
2014
+ "columnsFrom": ["site_id"],
2015
+ "columnsTo": ["id"],
2016
+ "onDelete": "cascade",
2017
+ "onUpdate": "no action"
2018
+ }
2019
+ },
2020
+ "compositePrimaryKeys": {
2021
+ "site_setting_site_id_key_pk": {
2022
+ "name": "site_setting_site_id_key_pk",
2023
+ "columns": ["site_id", "key"]
2024
+ }
2025
+ },
2026
+ "uniqueConstraints": {},
2027
+ "policies": {},
2028
+ "checkConstraints": {},
2029
+ "isRLSEnabled": false
2030
+ },
2031
+ "public.site_domain": {
2032
+ "name": "site_domain",
2033
+ "schema": "",
2034
+ "columns": {
2035
+ "id": {
2036
+ "name": "id",
2037
+ "type": "text",
2038
+ "primaryKey": true,
2039
+ "notNull": true
2040
+ },
2041
+ "site_id": {
2042
+ "name": "site_id",
2043
+ "type": "text",
2044
+ "primaryKey": false,
2045
+ "notNull": true
2046
+ },
2047
+ "host": {
2048
+ "name": "host",
2049
+ "type": "text",
2050
+ "primaryKey": false,
2051
+ "notNull": true
2052
+ },
2053
+ "path_prefix": {
2054
+ "name": "path_prefix",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": false
2058
+ },
2059
+ "kind": {
2060
+ "name": "kind",
2061
+ "type": "text",
2062
+ "primaryKey": false,
2063
+ "notNull": true,
2064
+ "default": "'primary'"
2065
+ },
2066
+ "redirect_to_primary": {
2067
+ "name": "redirect_to_primary",
2068
+ "type": "boolean",
2069
+ "primaryKey": false,
2070
+ "notNull": true,
2071
+ "default": true
2072
+ },
2073
+ "created_at": {
2074
+ "name": "created_at",
2075
+ "type": "integer",
2076
+ "primaryKey": false,
2077
+ "notNull": true
2078
+ },
2079
+ "updated_at": {
2080
+ "name": "updated_at",
2081
+ "type": "integer",
2082
+ "primaryKey": false,
2083
+ "notNull": true
2084
+ }
2085
+ },
2086
+ "indexes": {
2087
+ "uq_site_domain_host": {
2088
+ "name": "uq_site_domain_host",
2089
+ "columns": [
2090
+ {
2091
+ "expression": "host",
2092
+ "isExpression": false,
2093
+ "asc": true,
2094
+ "nulls": "last"
2095
+ }
2096
+ ],
2097
+ "isUnique": true,
2098
+ "concurrently": false,
2099
+ "method": "btree",
2100
+ "with": {}
2101
+ },
2102
+ "idx_site_domain_site_id": {
2103
+ "name": "idx_site_domain_site_id",
2104
+ "columns": [
2105
+ {
2106
+ "expression": "site_id",
2107
+ "isExpression": false,
2108
+ "asc": true,
2109
+ "nulls": "last"
2110
+ }
2111
+ ],
2112
+ "isUnique": false,
2113
+ "concurrently": false,
2114
+ "method": "btree",
2115
+ "with": {}
2116
+ }
2117
+ },
2118
+ "foreignKeys": {
2119
+ "site_domain_site_id_site_id_fk": {
2120
+ "name": "site_domain_site_id_site_id_fk",
2121
+ "tableFrom": "site_domain",
2122
+ "tableTo": "site",
2123
+ "columnsFrom": ["site_id"],
2124
+ "columnsTo": ["id"],
2125
+ "onDelete": "cascade",
2126
+ "onUpdate": "no action"
2127
+ }
2128
+ },
2129
+ "compositePrimaryKeys": {},
2130
+ "uniqueConstraints": {},
2131
+ "policies": {},
2132
+ "checkConstraints": {
2133
+ "chk_site_domain_kind": {
2134
+ "name": "chk_site_domain_kind",
2135
+ "value": "\"site_domain\".\"kind\" IN ('primary', 'alias')"
2136
+ }
2137
+ },
2138
+ "isRLSEnabled": false
2139
+ },
2140
+ "public.site_member": {
2141
+ "name": "site_member",
2142
+ "schema": "",
2143
+ "columns": {
2144
+ "site_id": {
2145
+ "name": "site_id",
2146
+ "type": "text",
2147
+ "primaryKey": false,
2148
+ "notNull": true
2149
+ },
2150
+ "user_id": {
2151
+ "name": "user_id",
2152
+ "type": "text",
2153
+ "primaryKey": false,
2154
+ "notNull": true
2155
+ },
2156
+ "role": {
2157
+ "name": "role",
2158
+ "type": "text",
2159
+ "primaryKey": false,
2160
+ "notNull": true,
2161
+ "default": "'editor'"
2162
+ },
2163
+ "created_at": {
2164
+ "name": "created_at",
2165
+ "type": "integer",
2166
+ "primaryKey": false,
2167
+ "notNull": true
2168
+ },
2169
+ "updated_at": {
2170
+ "name": "updated_at",
2171
+ "type": "integer",
2172
+ "primaryKey": false,
2173
+ "notNull": true
2174
+ }
2175
+ },
2176
+ "indexes": {
2177
+ "idx_site_member_user_id": {
2178
+ "name": "idx_site_member_user_id",
2179
+ "columns": [
2180
+ {
2181
+ "expression": "user_id",
2182
+ "isExpression": false,
2183
+ "asc": true,
2184
+ "nulls": "last"
2185
+ }
2186
+ ],
2187
+ "isUnique": false,
2188
+ "concurrently": false,
2189
+ "method": "btree",
2190
+ "with": {}
2191
+ }
2192
+ },
2193
+ "foreignKeys": {
2194
+ "site_member_site_id_site_id_fk": {
2195
+ "name": "site_member_site_id_site_id_fk",
2196
+ "tableFrom": "site_member",
2197
+ "tableTo": "site",
2198
+ "columnsFrom": ["site_id"],
2199
+ "columnsTo": ["id"],
2200
+ "onDelete": "cascade",
2201
+ "onUpdate": "no action"
2202
+ }
2203
+ },
2204
+ "compositePrimaryKeys": {
2205
+ "site_member_site_id_user_id_pk": {
2206
+ "name": "site_member_site_id_user_id_pk",
2207
+ "columns": ["site_id", "user_id"]
2208
+ }
2209
+ },
2210
+ "uniqueConstraints": {},
2211
+ "policies": {},
2212
+ "checkConstraints": {
2213
+ "chk_site_member_role": {
2214
+ "name": "chk_site_member_role",
2215
+ "value": "\"site_member\".\"role\" IN ('owner', 'admin', 'editor')"
2216
+ }
2217
+ },
2218
+ "isRLSEnabled": false
2219
+ },
2220
+ "public.site": {
2221
+ "name": "site",
2222
+ "schema": "",
2223
+ "columns": {
2224
+ "id": {
2225
+ "name": "id",
2226
+ "type": "text",
2227
+ "primaryKey": true,
2228
+ "notNull": true
2229
+ },
2230
+ "key": {
2231
+ "name": "key",
2232
+ "type": "text",
2233
+ "primaryKey": false,
2234
+ "notNull": true
2235
+ },
2236
+ "status": {
2237
+ "name": "status",
2238
+ "type": "text",
2239
+ "primaryKey": false,
2240
+ "notNull": true,
2241
+ "default": "'active'"
2242
+ },
2243
+ "provisioning_idempotency_key": {
2244
+ "name": "provisioning_idempotency_key",
2245
+ "type": "text",
2246
+ "primaryKey": false,
2247
+ "notNull": false
2248
+ },
2249
+ "created_at": {
2250
+ "name": "created_at",
2251
+ "type": "integer",
2252
+ "primaryKey": false,
2253
+ "notNull": true
2254
+ },
2255
+ "updated_at": {
2256
+ "name": "updated_at",
2257
+ "type": "integer",
2258
+ "primaryKey": false,
2259
+ "notNull": true
2260
+ }
2261
+ },
2262
+ "indexes": {
2263
+ "uq_site_key": {
2264
+ "name": "uq_site_key",
2265
+ "columns": [
2266
+ {
2267
+ "expression": "key",
2268
+ "isExpression": false,
2269
+ "asc": true,
2270
+ "nulls": "last"
2271
+ }
2272
+ ],
2273
+ "isUnique": true,
2274
+ "concurrently": false,
2275
+ "method": "btree",
2276
+ "with": {}
2277
+ },
2278
+ "uq_site_provisioning_idempotency_key": {
2279
+ "name": "uq_site_provisioning_idempotency_key",
2280
+ "columns": [
2281
+ {
2282
+ "expression": "provisioning_idempotency_key",
2283
+ "isExpression": false,
2284
+ "asc": true,
2285
+ "nulls": "last"
2286
+ }
2287
+ ],
2288
+ "isUnique": true,
2289
+ "where": "\"site\".\"provisioning_idempotency_key\" IS NOT NULL",
2290
+ "concurrently": false,
2291
+ "method": "btree",
2292
+ "with": {}
2293
+ }
2294
+ },
2295
+ "foreignKeys": {},
2296
+ "compositePrimaryKeys": {},
2297
+ "uniqueConstraints": {},
2298
+ "policies": {},
2299
+ "checkConstraints": {
2300
+ "chk_site_status": {
2301
+ "name": "chk_site_status",
2302
+ "value": "\"site\".\"status\" IN ('active', 'suspended')"
2303
+ }
2304
+ },
2305
+ "isRLSEnabled": false
2306
+ },
2307
+ "public.storage_purge": {
2308
+ "name": "storage_purge",
2309
+ "schema": "",
2310
+ "columns": {
2311
+ "id": {
2312
+ "name": "id",
2313
+ "type": "text",
2314
+ "primaryKey": true,
2315
+ "notNull": true
2316
+ },
2317
+ "site_id": {
2318
+ "name": "site_id",
2319
+ "type": "text",
2320
+ "primaryKey": false,
2321
+ "notNull": true
2322
+ },
2323
+ "provider": {
2324
+ "name": "provider",
2325
+ "type": "text",
2326
+ "primaryKey": false,
2327
+ "notNull": true
2328
+ },
2329
+ "storage_key": {
2330
+ "name": "storage_key",
2331
+ "type": "text",
2332
+ "primaryKey": false,
2333
+ "notNull": true
2334
+ },
2335
+ "original_key": {
2336
+ "name": "original_key",
2337
+ "type": "text",
2338
+ "primaryKey": false,
2339
+ "notNull": true
2340
+ },
2341
+ "reason": {
2342
+ "name": "reason",
2343
+ "type": "text",
2344
+ "primaryKey": false,
2345
+ "notNull": false
2346
+ },
2347
+ "purge_after": {
2348
+ "name": "purge_after",
2349
+ "type": "integer",
2350
+ "primaryKey": false,
2351
+ "notNull": true
2352
+ },
2353
+ "created_at": {
2354
+ "name": "created_at",
2355
+ "type": "integer",
2356
+ "primaryKey": false,
2357
+ "notNull": true
2358
+ }
2359
+ },
2360
+ "indexes": {
2361
+ "uq_storage_purge_provider_key": {
2362
+ "name": "uq_storage_purge_provider_key",
2363
+ "columns": [
2364
+ {
2365
+ "expression": "provider",
2366
+ "isExpression": false,
2367
+ "asc": true,
2368
+ "nulls": "last"
2369
+ },
2370
+ {
2371
+ "expression": "storage_key",
2372
+ "isExpression": false,
2373
+ "asc": true,
2374
+ "nulls": "last"
2375
+ }
2376
+ ],
2377
+ "isUnique": true,
2378
+ "concurrently": false,
2379
+ "method": "btree",
2380
+ "with": {}
2381
+ },
2382
+ "idx_storage_purge_site_provider_due": {
2383
+ "name": "idx_storage_purge_site_provider_due",
2384
+ "columns": [
2385
+ {
2386
+ "expression": "site_id",
2387
+ "isExpression": false,
2388
+ "asc": true,
2389
+ "nulls": "last"
2390
+ },
2391
+ {
2392
+ "expression": "provider",
2393
+ "isExpression": false,
2394
+ "asc": true,
2395
+ "nulls": "last"
2396
+ },
2397
+ {
2398
+ "expression": "purge_after",
2399
+ "isExpression": false,
2400
+ "asc": true,
2401
+ "nulls": "last"
2402
+ }
2403
+ ],
2404
+ "isUnique": false,
2405
+ "concurrently": false,
2406
+ "method": "btree",
2407
+ "with": {}
2408
+ }
2409
+ },
2410
+ "foreignKeys": {
2411
+ "storage_purge_site_id_site_id_fk": {
2412
+ "name": "storage_purge_site_id_site_id_fk",
2413
+ "tableFrom": "storage_purge",
2414
+ "tableTo": "site",
2415
+ "columnsFrom": ["site_id"],
2416
+ "columnsTo": ["id"],
2417
+ "onDelete": "cascade",
2418
+ "onUpdate": "no action"
2419
+ }
2420
+ },
2421
+ "compositePrimaryKeys": {},
2422
+ "uniqueConstraints": {},
2423
+ "policies": {},
2424
+ "checkConstraints": {},
2425
+ "isRLSEnabled": false
2426
+ },
2427
+ "public.telegram_binding": {
2428
+ "name": "telegram_binding",
2429
+ "schema": "",
2430
+ "columns": {
2431
+ "id": {
2432
+ "name": "id",
2433
+ "type": "text",
2434
+ "primaryKey": true,
2435
+ "notNull": true
2436
+ },
2437
+ "site_id": {
2438
+ "name": "site_id",
2439
+ "type": "text",
2440
+ "primaryKey": false,
2441
+ "notNull": true
2442
+ },
2443
+ "bot_id": {
2444
+ "name": "bot_id",
2445
+ "type": "text",
2446
+ "primaryKey": false,
2447
+ "notNull": true
2448
+ },
2449
+ "telegram_user_id": {
2450
+ "name": "telegram_user_id",
2451
+ "type": "text",
2452
+ "primaryKey": false,
2453
+ "notNull": true
2454
+ },
2455
+ "telegram_username": {
2456
+ "name": "telegram_username",
2457
+ "type": "text",
2458
+ "primaryKey": false,
2459
+ "notNull": false
2460
+ },
2461
+ "last_update_id": {
2462
+ "name": "last_update_id",
2463
+ "type": "integer",
2464
+ "primaryKey": false,
2465
+ "notNull": false
2466
+ },
2467
+ "bound_at": {
2468
+ "name": "bound_at",
2469
+ "type": "integer",
2470
+ "primaryKey": false,
2471
+ "notNull": true
2472
+ }
2473
+ },
2474
+ "indexes": {
2475
+ "uq_telegram_binding_site_id": {
2476
+ "name": "uq_telegram_binding_site_id",
2477
+ "columns": [
2478
+ {
2479
+ "expression": "site_id",
2480
+ "isExpression": false,
2481
+ "asc": true,
2482
+ "nulls": "last"
2483
+ }
2484
+ ],
2485
+ "isUnique": true,
2486
+ "concurrently": false,
2487
+ "method": "btree",
2488
+ "with": {}
2489
+ },
2490
+ "uq_telegram_binding_bot_user": {
2491
+ "name": "uq_telegram_binding_bot_user",
2492
+ "columns": [
2493
+ {
2494
+ "expression": "bot_id",
2495
+ "isExpression": false,
2496
+ "asc": true,
2497
+ "nulls": "last"
2498
+ },
2499
+ {
2500
+ "expression": "telegram_user_id",
2501
+ "isExpression": false,
2502
+ "asc": true,
2503
+ "nulls": "last"
2504
+ }
2505
+ ],
2506
+ "isUnique": true,
2507
+ "concurrently": false,
2508
+ "method": "btree",
2509
+ "with": {}
2510
+ }
2511
+ },
2512
+ "foreignKeys": {
2513
+ "telegram_binding_site_id_site_id_fk": {
2514
+ "name": "telegram_binding_site_id_site_id_fk",
2515
+ "tableFrom": "telegram_binding",
2516
+ "tableTo": "site",
2517
+ "columnsFrom": ["site_id"],
2518
+ "columnsTo": ["id"],
2519
+ "onDelete": "cascade",
2520
+ "onUpdate": "no action"
2521
+ }
2522
+ },
2523
+ "compositePrimaryKeys": {},
2524
+ "uniqueConstraints": {},
2525
+ "policies": {},
2526
+ "checkConstraints": {},
2527
+ "isRLSEnabled": false
2528
+ },
2529
+ "public.telegram_media_group_item": {
2530
+ "name": "telegram_media_group_item",
2531
+ "schema": "",
2532
+ "columns": {
2533
+ "id": {
2534
+ "name": "id",
2535
+ "type": "text",
2536
+ "primaryKey": true,
2537
+ "notNull": true
2538
+ },
2539
+ "site_id": {
2540
+ "name": "site_id",
2541
+ "type": "text",
2542
+ "primaryKey": false,
2543
+ "notNull": true
2544
+ },
2545
+ "bot_id": {
2546
+ "name": "bot_id",
2547
+ "type": "text",
2548
+ "primaryKey": false,
2549
+ "notNull": true
2550
+ },
2551
+ "telegram_user_id": {
2552
+ "name": "telegram_user_id",
2553
+ "type": "text",
2554
+ "primaryKey": false,
2555
+ "notNull": true
2556
+ },
2557
+ "media_group_id": {
2558
+ "name": "media_group_id",
2559
+ "type": "text",
2560
+ "primaryKey": false,
2561
+ "notNull": true
2562
+ },
2563
+ "chat_id": {
2564
+ "name": "chat_id",
2565
+ "type": "integer",
2566
+ "primaryKey": false,
2567
+ "notNull": true
2568
+ },
2569
+ "message_id": {
2570
+ "name": "message_id",
2571
+ "type": "integer",
2572
+ "primaryKey": false,
2573
+ "notNull": true
2574
+ },
2575
+ "update_id": {
2576
+ "name": "update_id",
2577
+ "type": "integer",
2578
+ "primaryKey": false,
2579
+ "notNull": true
2580
+ },
2581
+ "file_id": {
2582
+ "name": "file_id",
2583
+ "type": "text",
2584
+ "primaryKey": false,
2585
+ "notNull": true
2586
+ },
2587
+ "media_kind": {
2588
+ "name": "media_kind",
2589
+ "type": "text",
2590
+ "primaryKey": false,
2591
+ "notNull": true
2592
+ },
2593
+ "mime_type": {
2594
+ "name": "mime_type",
2595
+ "type": "text",
2596
+ "primaryKey": false,
2597
+ "notNull": false
2598
+ },
2599
+ "original_name": {
2600
+ "name": "original_name",
2601
+ "type": "text",
2602
+ "primaryKey": false,
2603
+ "notNull": false
2604
+ },
2605
+ "caption_markdown": {
2606
+ "name": "caption_markdown",
2607
+ "type": "text",
2608
+ "primaryKey": false,
2609
+ "notNull": false
2610
+ },
2611
+ "width": {
2612
+ "name": "width",
2613
+ "type": "integer",
2614
+ "primaryKey": false,
2615
+ "notNull": false
2616
+ },
2617
+ "height": {
2618
+ "name": "height",
2619
+ "type": "integer",
2620
+ "primaryKey": false,
2621
+ "notNull": false
2622
+ },
2623
+ "duration_seconds": {
2624
+ "name": "duration_seconds",
2625
+ "type": "integer",
2626
+ "primaryKey": false,
2627
+ "notNull": false
2628
+ },
2629
+ "poster_file_id": {
2630
+ "name": "poster_file_id",
2631
+ "type": "text",
2632
+ "primaryKey": false,
2633
+ "notNull": false
2634
+ },
2635
+ "created_at": {
2636
+ "name": "created_at",
2637
+ "type": "integer",
2638
+ "primaryKey": false,
2639
+ "notNull": true
2640
+ }
2641
+ },
2642
+ "indexes": {
2643
+ "idx_telegram_media_group_item_group": {
2644
+ "name": "idx_telegram_media_group_item_group",
2645
+ "columns": [
2646
+ {
2647
+ "expression": "bot_id",
2648
+ "isExpression": false,
2649
+ "asc": true,
2650
+ "nulls": "last"
2651
+ },
2652
+ {
2653
+ "expression": "media_group_id",
2654
+ "isExpression": false,
2655
+ "asc": true,
2656
+ "nulls": "last"
2657
+ }
2658
+ ],
2659
+ "isUnique": false,
2660
+ "concurrently": false,
2661
+ "method": "btree",
2662
+ "with": {}
2663
+ },
2664
+ "uq_telegram_media_group_item_message": {
2665
+ "name": "uq_telegram_media_group_item_message",
2666
+ "columns": [
2667
+ {
2668
+ "expression": "bot_id",
2669
+ "isExpression": false,
2670
+ "asc": true,
2671
+ "nulls": "last"
2672
+ },
2673
+ {
2674
+ "expression": "media_group_id",
2675
+ "isExpression": false,
2676
+ "asc": true,
2677
+ "nulls": "last"
2678
+ },
2679
+ {
2680
+ "expression": "message_id",
2681
+ "isExpression": false,
2682
+ "asc": true,
2683
+ "nulls": "last"
2684
+ }
2685
+ ],
2686
+ "isUnique": true,
2687
+ "concurrently": false,
2688
+ "method": "btree",
2689
+ "with": {}
2690
+ }
2691
+ },
2692
+ "foreignKeys": {
2693
+ "telegram_media_group_item_site_id_site_id_fk": {
2694
+ "name": "telegram_media_group_item_site_id_site_id_fk",
2695
+ "tableFrom": "telegram_media_group_item",
2696
+ "tableTo": "site",
2697
+ "columnsFrom": ["site_id"],
2698
+ "columnsTo": ["id"],
2699
+ "onDelete": "cascade",
2700
+ "onUpdate": "no action"
2701
+ }
2702
+ },
2703
+ "compositePrimaryKeys": {},
2704
+ "uniqueConstraints": {},
2705
+ "policies": {},
2706
+ "checkConstraints": {},
2707
+ "isRLSEnabled": false
2708
+ },
2709
+ "public.telegram_pending_binding": {
2710
+ "name": "telegram_pending_binding",
2711
+ "schema": "",
2712
+ "columns": {
2713
+ "id": {
2714
+ "name": "id",
2715
+ "type": "text",
2716
+ "primaryKey": true,
2717
+ "notNull": true
2718
+ },
2719
+ "site_id": {
2720
+ "name": "site_id",
2721
+ "type": "text",
2722
+ "primaryKey": false,
2723
+ "notNull": true
2724
+ },
2725
+ "code": {
2726
+ "name": "code",
2727
+ "type": "text",
2728
+ "primaryKey": false,
2729
+ "notNull": true
2730
+ },
2731
+ "created_at": {
2732
+ "name": "created_at",
2733
+ "type": "integer",
2734
+ "primaryKey": false,
2735
+ "notNull": true
2736
+ },
2737
+ "expires_at": {
2738
+ "name": "expires_at",
2739
+ "type": "integer",
2740
+ "primaryKey": false,
2741
+ "notNull": true
2742
+ }
2743
+ },
2744
+ "indexes": {
2745
+ "uq_telegram_pending_binding_site_id": {
2746
+ "name": "uq_telegram_pending_binding_site_id",
2747
+ "columns": [
2748
+ {
2749
+ "expression": "site_id",
2750
+ "isExpression": false,
2751
+ "asc": true,
2752
+ "nulls": "last"
2753
+ }
2754
+ ],
2755
+ "isUnique": true,
2756
+ "concurrently": false,
2757
+ "method": "btree",
2758
+ "with": {}
2759
+ },
2760
+ "uq_telegram_pending_binding_code": {
2761
+ "name": "uq_telegram_pending_binding_code",
2762
+ "columns": [
2763
+ {
2764
+ "expression": "code",
2765
+ "isExpression": false,
2766
+ "asc": true,
2767
+ "nulls": "last"
2768
+ }
2769
+ ],
2770
+ "isUnique": true,
2771
+ "concurrently": false,
2772
+ "method": "btree",
2773
+ "with": {}
2774
+ }
2775
+ },
2776
+ "foreignKeys": {
2777
+ "telegram_pending_binding_site_id_site_id_fk": {
2778
+ "name": "telegram_pending_binding_site_id_site_id_fk",
2779
+ "tableFrom": "telegram_pending_binding",
2780
+ "tableTo": "site",
2781
+ "columnsFrom": ["site_id"],
2782
+ "columnsTo": ["id"],
2783
+ "onDelete": "cascade",
2784
+ "onUpdate": "no action"
2785
+ }
2786
+ },
2787
+ "compositePrimaryKeys": {},
2788
+ "uniqueConstraints": {},
2789
+ "policies": {},
2790
+ "checkConstraints": {},
2791
+ "isRLSEnabled": false
2792
+ },
2793
+ "public.thread_collection": {
2794
+ "name": "thread_collection",
2795
+ "schema": "",
2796
+ "columns": {
2797
+ "site_id": {
2798
+ "name": "site_id",
2799
+ "type": "text",
2800
+ "primaryKey": false,
2801
+ "notNull": true
2802
+ },
2803
+ "thread_id": {
2804
+ "name": "thread_id",
2805
+ "type": "text",
2806
+ "primaryKey": false,
2807
+ "notNull": true
2808
+ },
2809
+ "collection_id": {
2810
+ "name": "collection_id",
2811
+ "type": "text",
2812
+ "primaryKey": false,
2813
+ "notNull": true
2814
+ },
2815
+ "created_at": {
2816
+ "name": "created_at",
2817
+ "type": "integer",
2818
+ "primaryKey": false,
2819
+ "notNull": true
2820
+ },
2821
+ "position": {
2822
+ "name": "position",
2823
+ "type": "integer",
2824
+ "primaryKey": false,
2825
+ "notNull": true,
2826
+ "default": 0
2827
+ },
2828
+ "pinned_at": {
2829
+ "name": "pinned_at",
2830
+ "type": "integer",
2831
+ "primaryKey": false,
2832
+ "notNull": false
2833
+ }
2834
+ },
2835
+ "indexes": {
2836
+ "idx_thread_collection_site_collection_id": {
2837
+ "name": "idx_thread_collection_site_collection_id",
2838
+ "columns": [
2839
+ {
2840
+ "expression": "site_id",
2841
+ "isExpression": false,
2842
+ "asc": true,
2843
+ "nulls": "last"
2844
+ },
2845
+ {
2846
+ "expression": "collection_id",
2847
+ "isExpression": false,
2848
+ "asc": true,
2849
+ "nulls": "last"
2850
+ }
2851
+ ],
2852
+ "isUnique": false,
2853
+ "concurrently": false,
2854
+ "method": "btree",
2855
+ "with": {}
2856
+ },
2857
+ "idx_thread_collection_site_collection_created_thread": {
2858
+ "name": "idx_thread_collection_site_collection_created_thread",
2859
+ "columns": [
2860
+ {
2861
+ "expression": "site_id",
2862
+ "isExpression": false,
2863
+ "asc": true,
2864
+ "nulls": "last"
2865
+ },
2866
+ {
2867
+ "expression": "collection_id",
2868
+ "isExpression": false,
2869
+ "asc": true,
2870
+ "nulls": "last"
2871
+ },
2872
+ {
2873
+ "expression": "created_at",
2874
+ "isExpression": false,
2875
+ "asc": true,
2876
+ "nulls": "last"
2877
+ },
2878
+ {
2879
+ "expression": "thread_id",
2880
+ "isExpression": false,
2881
+ "asc": true,
2882
+ "nulls": "last"
2883
+ }
2884
+ ],
2885
+ "isUnique": false,
2886
+ "concurrently": false,
2887
+ "method": "btree",
2888
+ "with": {}
2889
+ }
2890
+ },
2891
+ "foreignKeys": {
2892
+ "thread_collection_site_id_site_id_fk": {
2893
+ "name": "thread_collection_site_id_site_id_fk",
2894
+ "tableFrom": "thread_collection",
2895
+ "tableTo": "site",
2896
+ "columnsFrom": ["site_id"],
2897
+ "columnsTo": ["id"],
2898
+ "onDelete": "cascade",
2899
+ "onUpdate": "no action"
2900
+ },
2901
+ "thread_collection_thread_id_post_id_fk": {
2902
+ "name": "thread_collection_thread_id_post_id_fk",
2903
+ "tableFrom": "thread_collection",
2904
+ "tableTo": "post",
2905
+ "columnsFrom": ["thread_id"],
2906
+ "columnsTo": ["id"],
2907
+ "onDelete": "cascade",
2908
+ "onUpdate": "no action"
2909
+ },
2910
+ "thread_collection_collection_id_collection_id_fk": {
2911
+ "name": "thread_collection_collection_id_collection_id_fk",
2912
+ "tableFrom": "thread_collection",
2913
+ "tableTo": "collection",
2914
+ "columnsFrom": ["collection_id"],
2915
+ "columnsTo": ["id"],
2916
+ "onDelete": "cascade",
2917
+ "onUpdate": "no action"
2918
+ }
2919
+ },
2920
+ "compositePrimaryKeys": {
2921
+ "thread_collection_site_id_thread_id_collection_id_pk": {
2922
+ "name": "thread_collection_site_id_thread_id_collection_id_pk",
2923
+ "columns": ["site_id", "thread_id", "collection_id"]
2924
+ }
2925
+ },
2926
+ "uniqueConstraints": {},
2927
+ "policies": {},
2928
+ "checkConstraints": {},
2929
+ "isRLSEnabled": false
2930
+ },
2931
+ "public.upload_session": {
2932
+ "name": "upload_session",
2933
+ "schema": "",
2934
+ "columns": {
2935
+ "id": {
2936
+ "name": "id",
2937
+ "type": "text",
2938
+ "primaryKey": true,
2939
+ "notNull": true
2940
+ },
2941
+ "site_id": {
2942
+ "name": "site_id",
2943
+ "type": "text",
2944
+ "primaryKey": false,
2945
+ "notNull": true
2946
+ },
2947
+ "media_id": {
2948
+ "name": "media_id",
2949
+ "type": "text",
2950
+ "primaryKey": false,
2951
+ "notNull": true
2952
+ },
2953
+ "original_name": {
2954
+ "name": "original_name",
2955
+ "type": "text",
2956
+ "primaryKey": false,
2957
+ "notNull": true
2958
+ },
2959
+ "filename": {
2960
+ "name": "filename",
2961
+ "type": "text",
2962
+ "primaryKey": false,
2963
+ "notNull": true
2964
+ },
2965
+ "provider": {
2966
+ "name": "provider",
2967
+ "type": "text",
2968
+ "primaryKey": false,
2969
+ "notNull": true
2970
+ },
2971
+ "expected_content_type": {
2972
+ "name": "expected_content_type",
2973
+ "type": "text",
2974
+ "primaryKey": false,
2975
+ "notNull": true
2976
+ },
2977
+ "expected_size": {
2978
+ "name": "expected_size",
2979
+ "type": "integer",
2980
+ "primaryKey": false,
2981
+ "notNull": true
2982
+ },
2983
+ "expected_checksum_sha256": {
2984
+ "name": "expected_checksum_sha256",
2985
+ "type": "text",
2986
+ "primaryKey": false,
2987
+ "notNull": false
2988
+ },
2989
+ "content_disposition": {
2990
+ "name": "content_disposition",
2991
+ "type": "text",
2992
+ "primaryKey": false,
2993
+ "notNull": true,
2994
+ "default": "'inline'"
2995
+ },
2996
+ "temp_storage_key": {
2997
+ "name": "temp_storage_key",
2998
+ "type": "text",
2999
+ "primaryKey": false,
3000
+ "notNull": true
3001
+ },
3002
+ "final_storage_key": {
3003
+ "name": "final_storage_key",
3004
+ "type": "text",
3005
+ "primaryKey": false,
3006
+ "notNull": true
3007
+ },
3008
+ "multipart_upload_id": {
3009
+ "name": "multipart_upload_id",
3010
+ "type": "text",
3011
+ "primaryKey": false,
3012
+ "notNull": false
3013
+ },
3014
+ "state": {
3015
+ "name": "state",
3016
+ "type": "text",
3017
+ "primaryKey": false,
3018
+ "notNull": true,
3019
+ "default": "'pending'"
3020
+ },
3021
+ "expires_at": {
3022
+ "name": "expires_at",
3023
+ "type": "integer",
3024
+ "primaryKey": false,
3025
+ "notNull": true
3026
+ },
3027
+ "created_at": {
3028
+ "name": "created_at",
3029
+ "type": "integer",
3030
+ "primaryKey": false,
3031
+ "notNull": true
3032
+ },
3033
+ "updated_at": {
3034
+ "name": "updated_at",
3035
+ "type": "integer",
3036
+ "primaryKey": false,
3037
+ "notNull": true
3038
+ }
3039
+ },
3040
+ "indexes": {
3041
+ "uq_upload_session_media_id": {
3042
+ "name": "uq_upload_session_media_id",
3043
+ "columns": [
3044
+ {
3045
+ "expression": "media_id",
3046
+ "isExpression": false,
3047
+ "asc": true,
3048
+ "nulls": "last"
3049
+ }
3050
+ ],
3051
+ "isUnique": true,
3052
+ "concurrently": false,
3053
+ "method": "btree",
3054
+ "with": {}
3055
+ },
3056
+ "uq_upload_session_temp_storage_key": {
3057
+ "name": "uq_upload_session_temp_storage_key",
3058
+ "columns": [
3059
+ {
3060
+ "expression": "temp_storage_key",
3061
+ "isExpression": false,
3062
+ "asc": true,
3063
+ "nulls": "last"
3064
+ }
3065
+ ],
3066
+ "isUnique": true,
3067
+ "concurrently": false,
3068
+ "method": "btree",
3069
+ "with": {}
3070
+ },
3071
+ "uq_upload_session_final_storage_key": {
3072
+ "name": "uq_upload_session_final_storage_key",
3073
+ "columns": [
3074
+ {
3075
+ "expression": "final_storage_key",
3076
+ "isExpression": false,
3077
+ "asc": true,
3078
+ "nulls": "last"
3079
+ }
3080
+ ],
3081
+ "isUnique": true,
3082
+ "concurrently": false,
3083
+ "method": "btree",
3084
+ "with": {}
3085
+ },
3086
+ "idx_upload_session_site_state": {
3087
+ "name": "idx_upload_session_site_state",
3088
+ "columns": [
3089
+ {
3090
+ "expression": "site_id",
3091
+ "isExpression": false,
3092
+ "asc": true,
3093
+ "nulls": "last"
3094
+ },
3095
+ {
3096
+ "expression": "state",
3097
+ "isExpression": false,
3098
+ "asc": true,
3099
+ "nulls": "last"
3100
+ }
3101
+ ],
3102
+ "isUnique": false,
3103
+ "concurrently": false,
3104
+ "method": "btree",
3105
+ "with": {}
3106
+ },
3107
+ "idx_upload_session_site_expires_at": {
3108
+ "name": "idx_upload_session_site_expires_at",
3109
+ "columns": [
3110
+ {
3111
+ "expression": "site_id",
3112
+ "isExpression": false,
3113
+ "asc": true,
3114
+ "nulls": "last"
3115
+ },
3116
+ {
3117
+ "expression": "expires_at",
3118
+ "isExpression": false,
3119
+ "asc": true,
3120
+ "nulls": "last"
3121
+ }
3122
+ ],
3123
+ "isUnique": false,
3124
+ "concurrently": false,
3125
+ "method": "btree",
3126
+ "with": {}
3127
+ }
3128
+ },
3129
+ "foreignKeys": {
3130
+ "upload_session_site_id_site_id_fk": {
3131
+ "name": "upload_session_site_id_site_id_fk",
3132
+ "tableFrom": "upload_session",
3133
+ "tableTo": "site",
3134
+ "columnsFrom": ["site_id"],
3135
+ "columnsTo": ["id"],
3136
+ "onDelete": "cascade",
3137
+ "onUpdate": "no action"
3138
+ }
3139
+ },
3140
+ "compositePrimaryKeys": {},
3141
+ "uniqueConstraints": {},
3142
+ "policies": {},
3143
+ "checkConstraints": {
3144
+ "chk_upload_session_expected_size_positive": {
3145
+ "name": "chk_upload_session_expected_size_positive",
3146
+ "value": "\"upload_session\".\"expected_size\" > 0"
3147
+ },
3148
+ "chk_upload_session_state": {
3149
+ "name": "chk_upload_session_state",
3150
+ "value": "\"upload_session\".\"state\" IN ('pending', 'uploaded', 'completed', 'aborted', 'failed')"
3151
+ },
3152
+ "chk_upload_session_content_disposition": {
3153
+ "name": "chk_upload_session_content_disposition",
3154
+ "value": "\"upload_session\".\"content_disposition\" IN ('inline', 'attachment')"
3155
+ }
3156
+ },
3157
+ "isRLSEnabled": false
3158
+ },
3159
+ "public.user": {
3160
+ "name": "user",
3161
+ "schema": "",
3162
+ "columns": {
3163
+ "id": {
3164
+ "name": "id",
3165
+ "type": "text",
3166
+ "primaryKey": true,
3167
+ "notNull": true
3168
+ },
3169
+ "name": {
3170
+ "name": "name",
3171
+ "type": "text",
3172
+ "primaryKey": false,
3173
+ "notNull": true
3174
+ },
3175
+ "email": {
3176
+ "name": "email",
3177
+ "type": "text",
3178
+ "primaryKey": false,
3179
+ "notNull": true
3180
+ },
3181
+ "email_verified": {
3182
+ "name": "email_verified",
3183
+ "type": "boolean",
3184
+ "primaryKey": false,
3185
+ "notNull": true,
3186
+ "default": false
3187
+ },
3188
+ "image": {
3189
+ "name": "image",
3190
+ "type": "text",
3191
+ "primaryKey": false,
3192
+ "notNull": false
3193
+ },
3194
+ "role": {
3195
+ "name": "role",
3196
+ "type": "text",
3197
+ "primaryKey": false,
3198
+ "notNull": false,
3199
+ "default": "'member'"
3200
+ },
3201
+ "created_at": {
3202
+ "name": "created_at",
3203
+ "type": "timestamp with time zone",
3204
+ "primaryKey": false,
3205
+ "notNull": true
3206
+ },
3207
+ "updated_at": {
3208
+ "name": "updated_at",
3209
+ "type": "timestamp with time zone",
3210
+ "primaryKey": false,
3211
+ "notNull": true
3212
+ }
3213
+ },
3214
+ "indexes": {},
3215
+ "foreignKeys": {},
3216
+ "compositePrimaryKeys": {},
3217
+ "uniqueConstraints": {
3218
+ "user_email_unique": {
3219
+ "name": "user_email_unique",
3220
+ "nullsNotDistinct": false,
3221
+ "columns": ["email"]
3222
+ }
3223
+ },
3224
+ "policies": {},
3225
+ "checkConstraints": {},
3226
+ "isRLSEnabled": false
3227
+ },
3228
+ "public.verification": {
3229
+ "name": "verification",
3230
+ "schema": "",
3231
+ "columns": {
3232
+ "id": {
3233
+ "name": "id",
3234
+ "type": "text",
3235
+ "primaryKey": true,
3236
+ "notNull": true
3237
+ },
3238
+ "identifier": {
3239
+ "name": "identifier",
3240
+ "type": "text",
3241
+ "primaryKey": false,
3242
+ "notNull": true
3243
+ },
3244
+ "value": {
3245
+ "name": "value",
3246
+ "type": "text",
3247
+ "primaryKey": false,
3248
+ "notNull": true
3249
+ },
3250
+ "expires_at": {
3251
+ "name": "expires_at",
3252
+ "type": "timestamp with time zone",
3253
+ "primaryKey": false,
3254
+ "notNull": true
3255
+ },
3256
+ "created_at": {
3257
+ "name": "created_at",
3258
+ "type": "timestamp with time zone",
3259
+ "primaryKey": false,
3260
+ "notNull": false
3261
+ },
3262
+ "updated_at": {
3263
+ "name": "updated_at",
3264
+ "type": "timestamp with time zone",
3265
+ "primaryKey": false,
3266
+ "notNull": false
3267
+ }
3268
+ },
3269
+ "indexes": {},
3270
+ "foreignKeys": {},
3271
+ "compositePrimaryKeys": {},
3272
+ "uniqueConstraints": {},
3273
+ "policies": {},
3274
+ "checkConstraints": {},
3275
+ "isRLSEnabled": false
3276
+ }
3277
+ },
3278
+ "enums": {},
3279
+ "schemas": {},
3280
+ "sequences": {},
3281
+ "roles": {},
3282
+ "policies": {},
3283
+ "views": {},
3284
+ "_meta": {
3285
+ "columns": {},
3286
+ "schemas": {},
3287
+ "tables": {}
3288
+ }
3289
+ }