@jant/core 0.3.44 → 0.3.45

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 (59) hide show
  1. package/dist/{app-CtJDxZBb.js → app-C-L7wL6o.js} +147 -203
  2. package/dist/app-Hvqe7Ks_.js +5 -0
  3. package/dist/client/.vite/manifest.json +3 -3
  4. package/dist/client/_assets/client-DDs6NzB3.css +2 -0
  5. package/dist/client/_assets/{client-auth-CXILhW1b.js → client-auth-Dcon89Av.js} +30 -11
  6. package/dist/client/_assets/{client-D95FNDg5.js → client-dSfWfMe9.js} +7 -7
  7. package/dist/{github-sync-7y_nTXx1.js → github-sync-CQ1x271f.js} +3 -0
  8. package/dist/index.js +4 -87
  9. package/dist/node.js +3 -3
  10. package/package.json +1 -1
  11. package/src/client/components/jant-compose-dialog.ts +87 -9
  12. package/src/client/components/jant-compose-editor.ts +5 -1
  13. package/src/client/components/jant-post-menu.ts +23 -5
  14. package/src/client/compose-bridge.ts +2 -1
  15. package/src/client/toast.ts +29 -2
  16. package/src/client/upload-session.ts +1 -1
  17. package/src/db/migrations/0020_free_zaladane.sql +1 -0
  18. package/src/db/migrations/meta/0020_snapshot.json +2129 -0
  19. package/src/db/migrations/meta/_journal.json +7 -0
  20. package/src/db/migrations/pg/0018_red_warlock.sql +1 -0
  21. package/src/db/migrations/pg/meta/0018_snapshot.json +2739 -0
  22. package/src/db/migrations/pg/meta/_journal.json +7 -0
  23. package/src/db/pg/schema.ts +0 -30
  24. package/src/db/schema.ts +0 -39
  25. package/src/i18n/locales/public/en.po +10 -5
  26. package/src/i18n/locales/public/en.ts +1 -1
  27. package/src/i18n/locales/public/zh-Hans.po +10 -5
  28. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  29. package/src/i18n/locales/public/zh-Hant.po +10 -5
  30. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  31. package/src/index.ts +0 -3
  32. package/src/lib/__tests__/resolve-config.test.ts +4 -4
  33. package/src/lib/__tests__/startup-config.test.ts +27 -2
  34. package/src/lib/constants.ts +1 -0
  35. package/src/lib/github-sync-trigger.ts +7 -51
  36. package/src/lib/startup-config.ts +53 -6
  37. package/src/routes/api/github-sync.tsx +36 -14
  38. package/src/routes/pages/home.tsx +2 -0
  39. package/src/routes/pages/latest.tsx +2 -0
  40. package/src/runtime/__tests__/readiness.test.ts +34 -0
  41. package/src/runtime/readiness.ts +8 -4
  42. package/src/services/__tests__/collection.test.ts +13 -11
  43. package/src/services/github-sync.ts +6 -0
  44. package/src/styles/components.css +14 -0
  45. package/src/styles/ui.css +97 -0
  46. package/src/types/bindings.ts +0 -2
  47. package/src/types/config.ts +1 -1
  48. package/src/types/props.ts +2 -0
  49. package/src/ui/__tests__/font-themes.test.ts +2 -2
  50. package/src/ui/dash/settings/SettingsRootContent.tsx +17 -17
  51. package/src/ui/font-themes.ts +17 -17
  52. package/src/ui/pages/HomePage.tsx +21 -5
  53. package/dist/app-BI9bnCkO.js +0 -5
  54. package/dist/client/_assets/client-BQH7AQ24.css +0 -2
  55. package/src/lib/github-sync-queue-handler.ts +0 -69
  56. package/src/lib/github-sync-worker.ts +0 -72
  57. package/src/lib/job-queue-cf.ts +0 -18
  58. package/src/lib/job-queue-db.ts +0 -149
  59. package/src/lib/job-queue.ts +0 -35
@@ -0,0 +1,2739 @@
1
+ {
2
+ "id": "bb4b8e68-8e9b-4c2f-ad80-cb1807235945",
3
+ "prevId": "6c0da51d-9f59-4677-978a-c1cc4a360e35",
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
+ "deleted_at": {
1547
+ "name": "deleted_at",
1548
+ "type": "integer",
1549
+ "primaryKey": false,
1550
+ "notNull": false
1551
+ },
1552
+ "published_at": {
1553
+ "name": "published_at",
1554
+ "type": "integer",
1555
+ "primaryKey": false,
1556
+ "notNull": false
1557
+ },
1558
+ "last_activity_at": {
1559
+ "name": "last_activity_at",
1560
+ "type": "integer",
1561
+ "primaryKey": false,
1562
+ "notNull": false
1563
+ },
1564
+ "created_at": {
1565
+ "name": "created_at",
1566
+ "type": "integer",
1567
+ "primaryKey": false,
1568
+ "notNull": true
1569
+ },
1570
+ "updated_at": {
1571
+ "name": "updated_at",
1572
+ "type": "integer",
1573
+ "primaryKey": false,
1574
+ "notNull": true
1575
+ }
1576
+ },
1577
+ "indexes": {
1578
+ "idx_post_site_thread_id": {
1579
+ "name": "idx_post_site_thread_id",
1580
+ "columns": [
1581
+ {
1582
+ "expression": "site_id",
1583
+ "isExpression": false,
1584
+ "asc": true,
1585
+ "nulls": "last"
1586
+ },
1587
+ {
1588
+ "expression": "thread_id",
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_thread_live_created": {
1600
+ "name": "idx_post_site_thread_live_created",
1601
+ "columns": [
1602
+ {
1603
+ "expression": "site_id",
1604
+ "isExpression": false,
1605
+ "asc": true,
1606
+ "nulls": "last"
1607
+ },
1608
+ {
1609
+ "expression": "thread_id",
1610
+ "isExpression": false,
1611
+ "asc": true,
1612
+ "nulls": "last"
1613
+ },
1614
+ {
1615
+ "expression": "created_at",
1616
+ "isExpression": false,
1617
+ "asc": true,
1618
+ "nulls": "last"
1619
+ },
1620
+ {
1621
+ "expression": "id",
1622
+ "isExpression": false,
1623
+ "asc": true,
1624
+ "nulls": "last"
1625
+ }
1626
+ ],
1627
+ "isUnique": false,
1628
+ "where": "\"post\".\"deleted_at\" IS NULL",
1629
+ "concurrently": false,
1630
+ "method": "btree",
1631
+ "with": {}
1632
+ },
1633
+ "idx_post_site_status_deleted_published": {
1634
+ "name": "idx_post_site_status_deleted_published",
1635
+ "columns": [
1636
+ {
1637
+ "expression": "site_id",
1638
+ "isExpression": false,
1639
+ "asc": true,
1640
+ "nulls": "last"
1641
+ },
1642
+ {
1643
+ "expression": "status",
1644
+ "isExpression": false,
1645
+ "asc": true,
1646
+ "nulls": "last"
1647
+ },
1648
+ {
1649
+ "expression": "deleted_at",
1650
+ "isExpression": false,
1651
+ "asc": true,
1652
+ "nulls": "last"
1653
+ },
1654
+ {
1655
+ "expression": "published_at",
1656
+ "isExpression": false,
1657
+ "asc": true,
1658
+ "nulls": "last"
1659
+ }
1660
+ ],
1661
+ "isUnique": false,
1662
+ "concurrently": false,
1663
+ "method": "btree",
1664
+ "with": {}
1665
+ },
1666
+ "idx_post_site_status_deleted_activity": {
1667
+ "name": "idx_post_site_status_deleted_activity",
1668
+ "columns": [
1669
+ {
1670
+ "expression": "site_id",
1671
+ "isExpression": false,
1672
+ "asc": true,
1673
+ "nulls": "last"
1674
+ },
1675
+ {
1676
+ "expression": "status",
1677
+ "isExpression": false,
1678
+ "asc": true,
1679
+ "nulls": "last"
1680
+ },
1681
+ {
1682
+ "expression": "deleted_at",
1683
+ "isExpression": false,
1684
+ "asc": true,
1685
+ "nulls": "last"
1686
+ },
1687
+ {
1688
+ "expression": "last_activity_at",
1689
+ "isExpression": false,
1690
+ "asc": true,
1691
+ "nulls": "last"
1692
+ }
1693
+ ],
1694
+ "isUnique": false,
1695
+ "concurrently": false,
1696
+ "method": "btree",
1697
+ "with": {}
1698
+ },
1699
+ "idx_post_site_root_live_published_activity": {
1700
+ "name": "idx_post_site_root_live_published_activity",
1701
+ "columns": [
1702
+ {
1703
+ "expression": "site_id",
1704
+ "isExpression": false,
1705
+ "asc": true,
1706
+ "nulls": "last"
1707
+ },
1708
+ {
1709
+ "expression": "last_activity_at",
1710
+ "isExpression": false,
1711
+ "asc": true,
1712
+ "nulls": "last"
1713
+ },
1714
+ {
1715
+ "expression": "id",
1716
+ "isExpression": false,
1717
+ "asc": true,
1718
+ "nulls": "last"
1719
+ }
1720
+ ],
1721
+ "isUnique": false,
1722
+ "where": "\"post\".\"deleted_at\" IS NULL AND \"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'",
1723
+ "concurrently": false,
1724
+ "method": "btree",
1725
+ "with": {}
1726
+ },
1727
+ "idx_post_site_root_live_draft_updated": {
1728
+ "name": "idx_post_site_root_live_draft_updated",
1729
+ "columns": [
1730
+ {
1731
+ "expression": "site_id",
1732
+ "isExpression": false,
1733
+ "asc": true,
1734
+ "nulls": "last"
1735
+ },
1736
+ {
1737
+ "expression": "updated_at",
1738
+ "isExpression": false,
1739
+ "asc": true,
1740
+ "nulls": "last"
1741
+ },
1742
+ {
1743
+ "expression": "id",
1744
+ "isExpression": false,
1745
+ "asc": true,
1746
+ "nulls": "last"
1747
+ }
1748
+ ],
1749
+ "isUnique": false,
1750
+ "where": "\"post\".\"deleted_at\" IS NULL AND \"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'draft'",
1751
+ "concurrently": false,
1752
+ "method": "btree",
1753
+ "with": {}
1754
+ },
1755
+ "idx_post_site_reply_live_thread_created": {
1756
+ "name": "idx_post_site_reply_live_thread_created",
1757
+ "columns": [
1758
+ {
1759
+ "expression": "site_id",
1760
+ "isExpression": false,
1761
+ "asc": true,
1762
+ "nulls": "last"
1763
+ },
1764
+ {
1765
+ "expression": "thread_id",
1766
+ "isExpression": false,
1767
+ "asc": true,
1768
+ "nulls": "last"
1769
+ },
1770
+ {
1771
+ "expression": "created_at",
1772
+ "isExpression": false,
1773
+ "asc": true,
1774
+ "nulls": "last"
1775
+ },
1776
+ {
1777
+ "expression": "id",
1778
+ "isExpression": false,
1779
+ "asc": true,
1780
+ "nulls": "last"
1781
+ }
1782
+ ],
1783
+ "isUnique": false,
1784
+ "where": "\"post\".\"deleted_at\" IS NULL AND \"post\".\"reply_to_id\" IS NOT NULL AND \"post\".\"status\" = 'published'",
1785
+ "concurrently": false,
1786
+ "method": "btree",
1787
+ "with": {}
1788
+ },
1789
+ "idx_post_site_featured_live_featured_at": {
1790
+ "name": "idx_post_site_featured_live_featured_at",
1791
+ "columns": [
1792
+ {
1793
+ "expression": "site_id",
1794
+ "isExpression": false,
1795
+ "asc": true,
1796
+ "nulls": "last"
1797
+ },
1798
+ {
1799
+ "expression": "featured_at",
1800
+ "isExpression": false,
1801
+ "asc": true,
1802
+ "nulls": "last"
1803
+ },
1804
+ {
1805
+ "expression": "thread_id",
1806
+ "isExpression": false,
1807
+ "asc": true,
1808
+ "nulls": "last"
1809
+ },
1810
+ {
1811
+ "expression": "id",
1812
+ "isExpression": false,
1813
+ "asc": true,
1814
+ "nulls": "last"
1815
+ }
1816
+ ],
1817
+ "isUnique": false,
1818
+ "where": "\"post\".\"deleted_at\" IS NULL AND \"post\".\"status\" = 'published' AND \"post\".\"featured_at\" IS NOT NULL",
1819
+ "concurrently": false,
1820
+ "method": "btree",
1821
+ "with": {}
1822
+ },
1823
+ "idx_post_search_document_live": {
1824
+ "name": "idx_post_search_document_live",
1825
+ "columns": [
1826
+ {
1827
+ "expression": "search_document",
1828
+ "isExpression": false,
1829
+ "asc": true,
1830
+ "nulls": "last"
1831
+ }
1832
+ ],
1833
+ "isUnique": false,
1834
+ "where": "\"post\".\"deleted_at\" IS NULL",
1835
+ "concurrently": false,
1836
+ "method": "gin",
1837
+ "with": {}
1838
+ },
1839
+ "idx_post_search_text_trgm_live": {
1840
+ "name": "idx_post_search_text_trgm_live",
1841
+ "columns": [
1842
+ {
1843
+ "expression": "search_text",
1844
+ "isExpression": false,
1845
+ "asc": true,
1846
+ "nulls": "last",
1847
+ "opclass": "gin_trgm_ops"
1848
+ }
1849
+ ],
1850
+ "isUnique": false,
1851
+ "where": "\"post\".\"deleted_at\" IS NULL",
1852
+ "concurrently": false,
1853
+ "method": "gin",
1854
+ "with": {}
1855
+ }
1856
+ },
1857
+ "foreignKeys": {
1858
+ "post_site_id_site_id_fk": {
1859
+ "name": "post_site_id_site_id_fk",
1860
+ "tableFrom": "post",
1861
+ "tableTo": "site",
1862
+ "columnsFrom": ["site_id"],
1863
+ "columnsTo": ["id"],
1864
+ "onDelete": "cascade",
1865
+ "onUpdate": "no action"
1866
+ },
1867
+ "post_site_id_reply_to_id_post_site_id_id_fk": {
1868
+ "name": "post_site_id_reply_to_id_post_site_id_id_fk",
1869
+ "tableFrom": "post",
1870
+ "tableTo": "post",
1871
+ "columnsFrom": ["site_id", "reply_to_id"],
1872
+ "columnsTo": ["site_id", "id"],
1873
+ "onDelete": "no action",
1874
+ "onUpdate": "no action"
1875
+ },
1876
+ "post_site_id_thread_id_post_site_id_id_fk": {
1877
+ "name": "post_site_id_thread_id_post_site_id_id_fk",
1878
+ "tableFrom": "post",
1879
+ "tableTo": "post",
1880
+ "columnsFrom": ["site_id", "thread_id"],
1881
+ "columnsTo": ["site_id", "id"],
1882
+ "onDelete": "no action",
1883
+ "onUpdate": "no action"
1884
+ }
1885
+ },
1886
+ "compositePrimaryKeys": {},
1887
+ "uniqueConstraints": {
1888
+ "uq_post_site_id_id": {
1889
+ "name": "uq_post_site_id_id",
1890
+ "nullsNotDistinct": false,
1891
+ "columns": ["site_id", "id"]
1892
+ }
1893
+ },
1894
+ "policies": {},
1895
+ "checkConstraints": {
1896
+ "chk_post_reply_to_not_self": {
1897
+ "name": "chk_post_reply_to_not_self",
1898
+ "value": "\"post\".\"reply_to_id\" IS NULL OR \"post\".\"reply_to_id\" <> \"post\".\"id\""
1899
+ },
1900
+ "chk_post_thread_shape": {
1901
+ "name": "chk_post_thread_shape",
1902
+ "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 )"
1903
+ }
1904
+ },
1905
+ "isRLSEnabled": false
1906
+ },
1907
+ "public.rate_limit": {
1908
+ "name": "rate_limit",
1909
+ "schema": "",
1910
+ "columns": {
1911
+ "key": {
1912
+ "name": "key",
1913
+ "type": "text",
1914
+ "primaryKey": false,
1915
+ "notNull": true
1916
+ },
1917
+ "window_start": {
1918
+ "name": "window_start",
1919
+ "type": "integer",
1920
+ "primaryKey": false,
1921
+ "notNull": true
1922
+ },
1923
+ "count": {
1924
+ "name": "count",
1925
+ "type": "integer",
1926
+ "primaryKey": false,
1927
+ "notNull": true,
1928
+ "default": 0
1929
+ }
1930
+ },
1931
+ "indexes": {},
1932
+ "foreignKeys": {},
1933
+ "compositePrimaryKeys": {
1934
+ "rate_limit_key_window_start_pk": {
1935
+ "name": "rate_limit_key_window_start_pk",
1936
+ "columns": ["key", "window_start"]
1937
+ }
1938
+ },
1939
+ "uniqueConstraints": {},
1940
+ "policies": {},
1941
+ "checkConstraints": {},
1942
+ "isRLSEnabled": false
1943
+ },
1944
+ "public.session": {
1945
+ "name": "session",
1946
+ "schema": "",
1947
+ "columns": {
1948
+ "id": {
1949
+ "name": "id",
1950
+ "type": "text",
1951
+ "primaryKey": true,
1952
+ "notNull": true
1953
+ },
1954
+ "expires_at": {
1955
+ "name": "expires_at",
1956
+ "type": "timestamp with time zone",
1957
+ "primaryKey": false,
1958
+ "notNull": true
1959
+ },
1960
+ "token": {
1961
+ "name": "token",
1962
+ "type": "text",
1963
+ "primaryKey": false,
1964
+ "notNull": true
1965
+ },
1966
+ "created_at": {
1967
+ "name": "created_at",
1968
+ "type": "timestamp with time zone",
1969
+ "primaryKey": false,
1970
+ "notNull": true
1971
+ },
1972
+ "updated_at": {
1973
+ "name": "updated_at",
1974
+ "type": "timestamp with time zone",
1975
+ "primaryKey": false,
1976
+ "notNull": true
1977
+ },
1978
+ "ip_address": {
1979
+ "name": "ip_address",
1980
+ "type": "text",
1981
+ "primaryKey": false,
1982
+ "notNull": false
1983
+ },
1984
+ "user_agent": {
1985
+ "name": "user_agent",
1986
+ "type": "text",
1987
+ "primaryKey": false,
1988
+ "notNull": false
1989
+ },
1990
+ "user_id": {
1991
+ "name": "user_id",
1992
+ "type": "text",
1993
+ "primaryKey": false,
1994
+ "notNull": true
1995
+ }
1996
+ },
1997
+ "indexes": {
1998
+ "idx_session_user_id": {
1999
+ "name": "idx_session_user_id",
2000
+ "columns": [
2001
+ {
2002
+ "expression": "user_id",
2003
+ "isExpression": false,
2004
+ "asc": true,
2005
+ "nulls": "last"
2006
+ }
2007
+ ],
2008
+ "isUnique": false,
2009
+ "concurrently": false,
2010
+ "method": "btree",
2011
+ "with": {}
2012
+ }
2013
+ },
2014
+ "foreignKeys": {
2015
+ "session_user_id_user_id_fk": {
2016
+ "name": "session_user_id_user_id_fk",
2017
+ "tableFrom": "session",
2018
+ "tableTo": "user",
2019
+ "columnsFrom": ["user_id"],
2020
+ "columnsTo": ["id"],
2021
+ "onDelete": "no action",
2022
+ "onUpdate": "no action"
2023
+ }
2024
+ },
2025
+ "compositePrimaryKeys": {},
2026
+ "uniqueConstraints": {
2027
+ "session_token_unique": {
2028
+ "name": "session_token_unique",
2029
+ "nullsNotDistinct": false,
2030
+ "columns": ["token"]
2031
+ }
2032
+ },
2033
+ "policies": {},
2034
+ "checkConstraints": {},
2035
+ "isRLSEnabled": false
2036
+ },
2037
+ "public.site_setting": {
2038
+ "name": "site_setting",
2039
+ "schema": "",
2040
+ "columns": {
2041
+ "site_id": {
2042
+ "name": "site_id",
2043
+ "type": "text",
2044
+ "primaryKey": false,
2045
+ "notNull": true
2046
+ },
2047
+ "key": {
2048
+ "name": "key",
2049
+ "type": "text",
2050
+ "primaryKey": false,
2051
+ "notNull": true
2052
+ },
2053
+ "value": {
2054
+ "name": "value",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": true
2058
+ },
2059
+ "updated_at": {
2060
+ "name": "updated_at",
2061
+ "type": "integer",
2062
+ "primaryKey": false,
2063
+ "notNull": true
2064
+ }
2065
+ },
2066
+ "indexes": {
2067
+ "idx_site_setting_site_id": {
2068
+ "name": "idx_site_setting_site_id",
2069
+ "columns": [
2070
+ {
2071
+ "expression": "site_id",
2072
+ "isExpression": false,
2073
+ "asc": true,
2074
+ "nulls": "last"
2075
+ }
2076
+ ],
2077
+ "isUnique": false,
2078
+ "concurrently": false,
2079
+ "method": "btree",
2080
+ "with": {}
2081
+ }
2082
+ },
2083
+ "foreignKeys": {
2084
+ "site_setting_site_id_site_id_fk": {
2085
+ "name": "site_setting_site_id_site_id_fk",
2086
+ "tableFrom": "site_setting",
2087
+ "tableTo": "site",
2088
+ "columnsFrom": ["site_id"],
2089
+ "columnsTo": ["id"],
2090
+ "onDelete": "cascade",
2091
+ "onUpdate": "no action"
2092
+ }
2093
+ },
2094
+ "compositePrimaryKeys": {
2095
+ "site_setting_site_id_key_pk": {
2096
+ "name": "site_setting_site_id_key_pk",
2097
+ "columns": ["site_id", "key"]
2098
+ }
2099
+ },
2100
+ "uniqueConstraints": {},
2101
+ "policies": {},
2102
+ "checkConstraints": {},
2103
+ "isRLSEnabled": false
2104
+ },
2105
+ "public.site_domain": {
2106
+ "name": "site_domain",
2107
+ "schema": "",
2108
+ "columns": {
2109
+ "id": {
2110
+ "name": "id",
2111
+ "type": "text",
2112
+ "primaryKey": true,
2113
+ "notNull": true
2114
+ },
2115
+ "site_id": {
2116
+ "name": "site_id",
2117
+ "type": "text",
2118
+ "primaryKey": false,
2119
+ "notNull": true
2120
+ },
2121
+ "host": {
2122
+ "name": "host",
2123
+ "type": "text",
2124
+ "primaryKey": false,
2125
+ "notNull": true
2126
+ },
2127
+ "path_prefix": {
2128
+ "name": "path_prefix",
2129
+ "type": "text",
2130
+ "primaryKey": false,
2131
+ "notNull": false
2132
+ },
2133
+ "kind": {
2134
+ "name": "kind",
2135
+ "type": "text",
2136
+ "primaryKey": false,
2137
+ "notNull": true,
2138
+ "default": "'primary'"
2139
+ },
2140
+ "redirect_to_primary": {
2141
+ "name": "redirect_to_primary",
2142
+ "type": "boolean",
2143
+ "primaryKey": false,
2144
+ "notNull": true,
2145
+ "default": true
2146
+ },
2147
+ "created_at": {
2148
+ "name": "created_at",
2149
+ "type": "integer",
2150
+ "primaryKey": false,
2151
+ "notNull": true
2152
+ },
2153
+ "updated_at": {
2154
+ "name": "updated_at",
2155
+ "type": "integer",
2156
+ "primaryKey": false,
2157
+ "notNull": true
2158
+ }
2159
+ },
2160
+ "indexes": {
2161
+ "uq_site_domain_host": {
2162
+ "name": "uq_site_domain_host",
2163
+ "columns": [
2164
+ {
2165
+ "expression": "host",
2166
+ "isExpression": false,
2167
+ "asc": true,
2168
+ "nulls": "last"
2169
+ }
2170
+ ],
2171
+ "isUnique": true,
2172
+ "concurrently": false,
2173
+ "method": "btree",
2174
+ "with": {}
2175
+ },
2176
+ "idx_site_domain_site_id": {
2177
+ "name": "idx_site_domain_site_id",
2178
+ "columns": [
2179
+ {
2180
+ "expression": "site_id",
2181
+ "isExpression": false,
2182
+ "asc": true,
2183
+ "nulls": "last"
2184
+ }
2185
+ ],
2186
+ "isUnique": false,
2187
+ "concurrently": false,
2188
+ "method": "btree",
2189
+ "with": {}
2190
+ }
2191
+ },
2192
+ "foreignKeys": {
2193
+ "site_domain_site_id_site_id_fk": {
2194
+ "name": "site_domain_site_id_site_id_fk",
2195
+ "tableFrom": "site_domain",
2196
+ "tableTo": "site",
2197
+ "columnsFrom": ["site_id"],
2198
+ "columnsTo": ["id"],
2199
+ "onDelete": "cascade",
2200
+ "onUpdate": "no action"
2201
+ }
2202
+ },
2203
+ "compositePrimaryKeys": {},
2204
+ "uniqueConstraints": {},
2205
+ "policies": {},
2206
+ "checkConstraints": {
2207
+ "chk_site_domain_kind": {
2208
+ "name": "chk_site_domain_kind",
2209
+ "value": "\"site_domain\".\"kind\" IN ('primary', 'alias')"
2210
+ }
2211
+ },
2212
+ "isRLSEnabled": false
2213
+ },
2214
+ "public.site_member": {
2215
+ "name": "site_member",
2216
+ "schema": "",
2217
+ "columns": {
2218
+ "site_id": {
2219
+ "name": "site_id",
2220
+ "type": "text",
2221
+ "primaryKey": false,
2222
+ "notNull": true
2223
+ },
2224
+ "user_id": {
2225
+ "name": "user_id",
2226
+ "type": "text",
2227
+ "primaryKey": false,
2228
+ "notNull": true
2229
+ },
2230
+ "role": {
2231
+ "name": "role",
2232
+ "type": "text",
2233
+ "primaryKey": false,
2234
+ "notNull": true,
2235
+ "default": "'editor'"
2236
+ },
2237
+ "created_at": {
2238
+ "name": "created_at",
2239
+ "type": "integer",
2240
+ "primaryKey": false,
2241
+ "notNull": true
2242
+ },
2243
+ "updated_at": {
2244
+ "name": "updated_at",
2245
+ "type": "integer",
2246
+ "primaryKey": false,
2247
+ "notNull": true
2248
+ }
2249
+ },
2250
+ "indexes": {
2251
+ "idx_site_member_user_id": {
2252
+ "name": "idx_site_member_user_id",
2253
+ "columns": [
2254
+ {
2255
+ "expression": "user_id",
2256
+ "isExpression": false,
2257
+ "asc": true,
2258
+ "nulls": "last"
2259
+ }
2260
+ ],
2261
+ "isUnique": false,
2262
+ "concurrently": false,
2263
+ "method": "btree",
2264
+ "with": {}
2265
+ }
2266
+ },
2267
+ "foreignKeys": {
2268
+ "site_member_site_id_site_id_fk": {
2269
+ "name": "site_member_site_id_site_id_fk",
2270
+ "tableFrom": "site_member",
2271
+ "tableTo": "site",
2272
+ "columnsFrom": ["site_id"],
2273
+ "columnsTo": ["id"],
2274
+ "onDelete": "cascade",
2275
+ "onUpdate": "no action"
2276
+ }
2277
+ },
2278
+ "compositePrimaryKeys": {
2279
+ "site_member_site_id_user_id_pk": {
2280
+ "name": "site_member_site_id_user_id_pk",
2281
+ "columns": ["site_id", "user_id"]
2282
+ }
2283
+ },
2284
+ "uniqueConstraints": {},
2285
+ "policies": {},
2286
+ "checkConstraints": {
2287
+ "chk_site_member_role": {
2288
+ "name": "chk_site_member_role",
2289
+ "value": "\"site_member\".\"role\" IN ('owner', 'admin', 'editor')"
2290
+ }
2291
+ },
2292
+ "isRLSEnabled": false
2293
+ },
2294
+ "public.site": {
2295
+ "name": "site",
2296
+ "schema": "",
2297
+ "columns": {
2298
+ "id": {
2299
+ "name": "id",
2300
+ "type": "text",
2301
+ "primaryKey": true,
2302
+ "notNull": true
2303
+ },
2304
+ "key": {
2305
+ "name": "key",
2306
+ "type": "text",
2307
+ "primaryKey": false,
2308
+ "notNull": true
2309
+ },
2310
+ "status": {
2311
+ "name": "status",
2312
+ "type": "text",
2313
+ "primaryKey": false,
2314
+ "notNull": true,
2315
+ "default": "'active'"
2316
+ },
2317
+ "provisioning_idempotency_key": {
2318
+ "name": "provisioning_idempotency_key",
2319
+ "type": "text",
2320
+ "primaryKey": false,
2321
+ "notNull": false
2322
+ },
2323
+ "created_at": {
2324
+ "name": "created_at",
2325
+ "type": "integer",
2326
+ "primaryKey": false,
2327
+ "notNull": true
2328
+ },
2329
+ "updated_at": {
2330
+ "name": "updated_at",
2331
+ "type": "integer",
2332
+ "primaryKey": false,
2333
+ "notNull": true
2334
+ }
2335
+ },
2336
+ "indexes": {
2337
+ "uq_site_key": {
2338
+ "name": "uq_site_key",
2339
+ "columns": [
2340
+ {
2341
+ "expression": "key",
2342
+ "isExpression": false,
2343
+ "asc": true,
2344
+ "nulls": "last"
2345
+ }
2346
+ ],
2347
+ "isUnique": true,
2348
+ "concurrently": false,
2349
+ "method": "btree",
2350
+ "with": {}
2351
+ },
2352
+ "uq_site_provisioning_idempotency_key": {
2353
+ "name": "uq_site_provisioning_idempotency_key",
2354
+ "columns": [
2355
+ {
2356
+ "expression": "provisioning_idempotency_key",
2357
+ "isExpression": false,
2358
+ "asc": true,
2359
+ "nulls": "last"
2360
+ }
2361
+ ],
2362
+ "isUnique": true,
2363
+ "where": "\"site\".\"provisioning_idempotency_key\" IS NOT NULL",
2364
+ "concurrently": false,
2365
+ "method": "btree",
2366
+ "with": {}
2367
+ }
2368
+ },
2369
+ "foreignKeys": {},
2370
+ "compositePrimaryKeys": {},
2371
+ "uniqueConstraints": {},
2372
+ "policies": {},
2373
+ "checkConstraints": {
2374
+ "chk_site_status": {
2375
+ "name": "chk_site_status",
2376
+ "value": "\"site\".\"status\" IN ('active', 'suspended')"
2377
+ }
2378
+ },
2379
+ "isRLSEnabled": false
2380
+ },
2381
+ "public.upload_session": {
2382
+ "name": "upload_session",
2383
+ "schema": "",
2384
+ "columns": {
2385
+ "id": {
2386
+ "name": "id",
2387
+ "type": "text",
2388
+ "primaryKey": true,
2389
+ "notNull": true
2390
+ },
2391
+ "site_id": {
2392
+ "name": "site_id",
2393
+ "type": "text",
2394
+ "primaryKey": false,
2395
+ "notNull": true
2396
+ },
2397
+ "media_id": {
2398
+ "name": "media_id",
2399
+ "type": "text",
2400
+ "primaryKey": false,
2401
+ "notNull": true
2402
+ },
2403
+ "original_name": {
2404
+ "name": "original_name",
2405
+ "type": "text",
2406
+ "primaryKey": false,
2407
+ "notNull": true
2408
+ },
2409
+ "filename": {
2410
+ "name": "filename",
2411
+ "type": "text",
2412
+ "primaryKey": false,
2413
+ "notNull": true
2414
+ },
2415
+ "provider": {
2416
+ "name": "provider",
2417
+ "type": "text",
2418
+ "primaryKey": false,
2419
+ "notNull": true
2420
+ },
2421
+ "expected_content_type": {
2422
+ "name": "expected_content_type",
2423
+ "type": "text",
2424
+ "primaryKey": false,
2425
+ "notNull": true
2426
+ },
2427
+ "expected_size": {
2428
+ "name": "expected_size",
2429
+ "type": "integer",
2430
+ "primaryKey": false,
2431
+ "notNull": true
2432
+ },
2433
+ "expected_checksum_sha256": {
2434
+ "name": "expected_checksum_sha256",
2435
+ "type": "text",
2436
+ "primaryKey": false,
2437
+ "notNull": false
2438
+ },
2439
+ "content_disposition": {
2440
+ "name": "content_disposition",
2441
+ "type": "text",
2442
+ "primaryKey": false,
2443
+ "notNull": true,
2444
+ "default": "'inline'"
2445
+ },
2446
+ "temp_storage_key": {
2447
+ "name": "temp_storage_key",
2448
+ "type": "text",
2449
+ "primaryKey": false,
2450
+ "notNull": true
2451
+ },
2452
+ "final_storage_key": {
2453
+ "name": "final_storage_key",
2454
+ "type": "text",
2455
+ "primaryKey": false,
2456
+ "notNull": true
2457
+ },
2458
+ "multipart_upload_id": {
2459
+ "name": "multipart_upload_id",
2460
+ "type": "text",
2461
+ "primaryKey": false,
2462
+ "notNull": false
2463
+ },
2464
+ "state": {
2465
+ "name": "state",
2466
+ "type": "text",
2467
+ "primaryKey": false,
2468
+ "notNull": true,
2469
+ "default": "'pending'"
2470
+ },
2471
+ "expires_at": {
2472
+ "name": "expires_at",
2473
+ "type": "integer",
2474
+ "primaryKey": false,
2475
+ "notNull": true
2476
+ },
2477
+ "created_at": {
2478
+ "name": "created_at",
2479
+ "type": "integer",
2480
+ "primaryKey": false,
2481
+ "notNull": true
2482
+ },
2483
+ "updated_at": {
2484
+ "name": "updated_at",
2485
+ "type": "integer",
2486
+ "primaryKey": false,
2487
+ "notNull": true
2488
+ }
2489
+ },
2490
+ "indexes": {
2491
+ "uq_upload_session_media_id": {
2492
+ "name": "uq_upload_session_media_id",
2493
+ "columns": [
2494
+ {
2495
+ "expression": "media_id",
2496
+ "isExpression": false,
2497
+ "asc": true,
2498
+ "nulls": "last"
2499
+ }
2500
+ ],
2501
+ "isUnique": true,
2502
+ "concurrently": false,
2503
+ "method": "btree",
2504
+ "with": {}
2505
+ },
2506
+ "uq_upload_session_temp_storage_key": {
2507
+ "name": "uq_upload_session_temp_storage_key",
2508
+ "columns": [
2509
+ {
2510
+ "expression": "temp_storage_key",
2511
+ "isExpression": false,
2512
+ "asc": true,
2513
+ "nulls": "last"
2514
+ }
2515
+ ],
2516
+ "isUnique": true,
2517
+ "concurrently": false,
2518
+ "method": "btree",
2519
+ "with": {}
2520
+ },
2521
+ "uq_upload_session_final_storage_key": {
2522
+ "name": "uq_upload_session_final_storage_key",
2523
+ "columns": [
2524
+ {
2525
+ "expression": "final_storage_key",
2526
+ "isExpression": false,
2527
+ "asc": true,
2528
+ "nulls": "last"
2529
+ }
2530
+ ],
2531
+ "isUnique": true,
2532
+ "concurrently": false,
2533
+ "method": "btree",
2534
+ "with": {}
2535
+ },
2536
+ "idx_upload_session_site_state": {
2537
+ "name": "idx_upload_session_site_state",
2538
+ "columns": [
2539
+ {
2540
+ "expression": "site_id",
2541
+ "isExpression": false,
2542
+ "asc": true,
2543
+ "nulls": "last"
2544
+ },
2545
+ {
2546
+ "expression": "state",
2547
+ "isExpression": false,
2548
+ "asc": true,
2549
+ "nulls": "last"
2550
+ }
2551
+ ],
2552
+ "isUnique": false,
2553
+ "concurrently": false,
2554
+ "method": "btree",
2555
+ "with": {}
2556
+ },
2557
+ "idx_upload_session_site_expires_at": {
2558
+ "name": "idx_upload_session_site_expires_at",
2559
+ "columns": [
2560
+ {
2561
+ "expression": "site_id",
2562
+ "isExpression": false,
2563
+ "asc": true,
2564
+ "nulls": "last"
2565
+ },
2566
+ {
2567
+ "expression": "expires_at",
2568
+ "isExpression": false,
2569
+ "asc": true,
2570
+ "nulls": "last"
2571
+ }
2572
+ ],
2573
+ "isUnique": false,
2574
+ "concurrently": false,
2575
+ "method": "btree",
2576
+ "with": {}
2577
+ }
2578
+ },
2579
+ "foreignKeys": {
2580
+ "upload_session_site_id_site_id_fk": {
2581
+ "name": "upload_session_site_id_site_id_fk",
2582
+ "tableFrom": "upload_session",
2583
+ "tableTo": "site",
2584
+ "columnsFrom": ["site_id"],
2585
+ "columnsTo": ["id"],
2586
+ "onDelete": "cascade",
2587
+ "onUpdate": "no action"
2588
+ }
2589
+ },
2590
+ "compositePrimaryKeys": {},
2591
+ "uniqueConstraints": {},
2592
+ "policies": {},
2593
+ "checkConstraints": {
2594
+ "chk_upload_session_expected_size_positive": {
2595
+ "name": "chk_upload_session_expected_size_positive",
2596
+ "value": "\"upload_session\".\"expected_size\" > 0"
2597
+ },
2598
+ "chk_upload_session_state": {
2599
+ "name": "chk_upload_session_state",
2600
+ "value": "\"upload_session\".\"state\" IN ('pending', 'uploaded', 'completed', 'aborted', 'failed')"
2601
+ },
2602
+ "chk_upload_session_content_disposition": {
2603
+ "name": "chk_upload_session_content_disposition",
2604
+ "value": "\"upload_session\".\"content_disposition\" IN ('inline', 'attachment')"
2605
+ }
2606
+ },
2607
+ "isRLSEnabled": false
2608
+ },
2609
+ "public.user": {
2610
+ "name": "user",
2611
+ "schema": "",
2612
+ "columns": {
2613
+ "id": {
2614
+ "name": "id",
2615
+ "type": "text",
2616
+ "primaryKey": true,
2617
+ "notNull": true
2618
+ },
2619
+ "name": {
2620
+ "name": "name",
2621
+ "type": "text",
2622
+ "primaryKey": false,
2623
+ "notNull": true
2624
+ },
2625
+ "email": {
2626
+ "name": "email",
2627
+ "type": "text",
2628
+ "primaryKey": false,
2629
+ "notNull": true
2630
+ },
2631
+ "email_verified": {
2632
+ "name": "email_verified",
2633
+ "type": "boolean",
2634
+ "primaryKey": false,
2635
+ "notNull": true,
2636
+ "default": false
2637
+ },
2638
+ "image": {
2639
+ "name": "image",
2640
+ "type": "text",
2641
+ "primaryKey": false,
2642
+ "notNull": false
2643
+ },
2644
+ "role": {
2645
+ "name": "role",
2646
+ "type": "text",
2647
+ "primaryKey": false,
2648
+ "notNull": false,
2649
+ "default": "'member'"
2650
+ },
2651
+ "created_at": {
2652
+ "name": "created_at",
2653
+ "type": "timestamp with time zone",
2654
+ "primaryKey": false,
2655
+ "notNull": true
2656
+ },
2657
+ "updated_at": {
2658
+ "name": "updated_at",
2659
+ "type": "timestamp with time zone",
2660
+ "primaryKey": false,
2661
+ "notNull": true
2662
+ }
2663
+ },
2664
+ "indexes": {},
2665
+ "foreignKeys": {},
2666
+ "compositePrimaryKeys": {},
2667
+ "uniqueConstraints": {
2668
+ "user_email_unique": {
2669
+ "name": "user_email_unique",
2670
+ "nullsNotDistinct": false,
2671
+ "columns": ["email"]
2672
+ }
2673
+ },
2674
+ "policies": {},
2675
+ "checkConstraints": {},
2676
+ "isRLSEnabled": false
2677
+ },
2678
+ "public.verification": {
2679
+ "name": "verification",
2680
+ "schema": "",
2681
+ "columns": {
2682
+ "id": {
2683
+ "name": "id",
2684
+ "type": "text",
2685
+ "primaryKey": true,
2686
+ "notNull": true
2687
+ },
2688
+ "identifier": {
2689
+ "name": "identifier",
2690
+ "type": "text",
2691
+ "primaryKey": false,
2692
+ "notNull": true
2693
+ },
2694
+ "value": {
2695
+ "name": "value",
2696
+ "type": "text",
2697
+ "primaryKey": false,
2698
+ "notNull": true
2699
+ },
2700
+ "expires_at": {
2701
+ "name": "expires_at",
2702
+ "type": "timestamp with time zone",
2703
+ "primaryKey": false,
2704
+ "notNull": true
2705
+ },
2706
+ "created_at": {
2707
+ "name": "created_at",
2708
+ "type": "timestamp with time zone",
2709
+ "primaryKey": false,
2710
+ "notNull": false
2711
+ },
2712
+ "updated_at": {
2713
+ "name": "updated_at",
2714
+ "type": "timestamp with time zone",
2715
+ "primaryKey": false,
2716
+ "notNull": false
2717
+ }
2718
+ },
2719
+ "indexes": {},
2720
+ "foreignKeys": {},
2721
+ "compositePrimaryKeys": {},
2722
+ "uniqueConstraints": {},
2723
+ "policies": {},
2724
+ "checkConstraints": {},
2725
+ "isRLSEnabled": false
2726
+ }
2727
+ },
2728
+ "enums": {},
2729
+ "schemas": {},
2730
+ "sequences": {},
2731
+ "roles": {},
2732
+ "policies": {},
2733
+ "views": {},
2734
+ "_meta": {
2735
+ "columns": {},
2736
+ "schemas": {},
2737
+ "tables": {}
2738
+ }
2739
+ }