@jant/core 0.5.4 → 0.6.1

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