@jant/core 1.2.0 → 1.4.0

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