@jant/core 1.1.0 → 1.3.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 (196) hide show
  1. package/bin/commands/site/import.js +2 -1
  2. package/bin/lib/site-snapshot.js +10 -0
  3. package/dist/{app-CKQ9PqAr.js → app-C8dETvgL.js} +9267 -5697
  4. package/dist/client/.vite/manifest.json +82 -93
  5. package/dist/client/_assets/chunks/{confirm-CMe01lne.js → confirm-BQebcuNB.js} +1 -1
  6. package/dist/client/_assets/chunks/{create-editor-BQkrw8Ax.js → create-editor-B8KuszlS.js} +38 -38
  7. package/dist/client/_assets/chunks/footnote-rail-DUrqz0Py.js +2 -0
  8. package/dist/client/_assets/chunks/{jant-locale-picker-2L4rkDaz.js → jant-locale-picker-CLq0iKDH.js} +1 -1
  9. package/dist/client/_assets/chunks/lit-BN4mrI3j.js +2 -0
  10. package/dist/client/_assets/chunks/{settings-paths-B0bNUaih.js → settings-paths-_fry4yWW.js} +1 -1
  11. package/dist/client/_assets/chunks/{slug-format-CYmQE5ln.js → slug-format-bcJ2ozr4.js} +1 -1
  12. package/dist/client/_assets/chunks/sortable-list-Bz2Na2E9.js +2 -0
  13. package/dist/client/_assets/chunks/types-DrYFqJH2.js +1 -0
  14. package/dist/client/_assets/chunks/{unsafe-html-CWos3v6N.js → unsafe-html-OJ9m154w.js} +1 -1
  15. package/dist/client/_assets/chunks/unsafe-svg-DVJ4NPcb.js +1 -0
  16. package/dist/client/_assets/client-CoNHvipV.css +2 -0
  17. package/dist/client/_assets/{client-auth-CG55rWb5.js → client-auth-CbnZkLJ6.js} +99 -129
  18. package/dist/client/_assets/{client-author-CGVvrNZ8.css → client-author-2WYBkgni.css} +1 -1
  19. package/dist/client/_assets/client-compose-DYtDlYm-.js +2008 -0
  20. package/dist/client/_assets/{client-manage-DnYdQAhf.js → client-manage-BODyYP5Z.js} +157 -157
  21. package/dist/client/_assets/client-pq6sVS7y.js +354 -0
  22. package/dist/client/_assets/{client-settings-CHgsIqXJ.js → client-settings-DDpe_tXJ.js} +166 -166
  23. package/dist/client/_assets/client-share-B9OsXx9p.js +149 -0
  24. package/dist/{constants-DEgyqWDl.js → constants-C2CdWAqt.js} +55 -5
  25. package/dist/index.js +1 -1
  26. package/dist/node.js +3 -2
  27. package/package.json +2 -1
  28. package/src/app.tsx +9 -0
  29. package/src/client/components/compose-types.ts +6 -1
  30. package/src/client/components/jant-compose-dialog.ts +26 -4
  31. package/src/client/components/jant-compose-editor.ts +30 -0
  32. package/src/client/components/jant-compose-fullscreen.ts +1 -0
  33. package/src/client/components/jant-media-lightbox.ts +18 -3
  34. package/src/client/components/jant-nav-manager.ts +2 -0
  35. package/src/client/components/jant-post-menu.ts +42 -89
  36. package/src/client/components/nav-manager-types.ts +2 -0
  37. package/src/client/components/settings-types.ts +1 -1
  38. package/src/client/compose-bridge.ts +61 -1
  39. package/src/client/feed-video-player.ts +6 -0
  40. package/src/client/list-views.ts +382 -0
  41. package/src/client/media-lightbox-events.ts +12 -0
  42. package/src/client/runtime-paths.ts +12 -0
  43. package/src/client/share-capture.ts +63 -0
  44. package/src/client/share-launch.ts +36 -9
  45. package/src/client/tiptap/bubble-menu.ts +25 -2
  46. package/src/client/tiptap/create-editor.ts +6 -0
  47. package/src/client/tiptap/embed-node.ts +3 -1
  48. package/src/client/tiptap/extensions.ts +4 -0
  49. package/src/client/tiptap/html-block-node.ts +3 -1
  50. package/src/client/tiptap/image-node.ts +3 -1
  51. package/src/client/video-processor.ts +106 -52
  52. package/src/client/view-confirm.ts +136 -0
  53. package/src/client.ts +2 -0
  54. package/src/db/migrations/0035_brainy_next_avengers.sql +9 -0
  55. package/src/db/migrations/0036_gorgeous_smasher.sql +7 -0
  56. package/src/db/migrations/0037_round_post.sql +16 -0
  57. package/src/db/migrations/0038_flashy_changeling.sql +15 -0
  58. package/src/db/migrations/0039_mixed_sister_grimm.sql +1 -0
  59. package/src/db/migrations/meta/0035_snapshot.json +2877 -0
  60. package/src/db/migrations/meta/0036_snapshot.json +2924 -0
  61. package/src/db/migrations/meta/0037_snapshot.json +2932 -0
  62. package/src/db/migrations/meta/0038_snapshot.json +2924 -0
  63. package/src/db/migrations/meta/0039_snapshot.json +2931 -0
  64. package/src/db/migrations/meta/_journal.json +35 -0
  65. package/src/db/migrations/pg/0033_cute_magdalene.sql +10 -0
  66. package/src/db/migrations/pg/0034_material_agent_brand.sql +8 -0
  67. package/src/db/migrations/pg/0035_flimsy_outlaw_kid.sql +3 -0
  68. package/src/db/migrations/pg/0036_milky_wolverine.sql +5 -0
  69. package/src/db/migrations/pg/0037_fuzzy_hammerhead.sql +1 -0
  70. package/src/db/migrations/pg/meta/0033_snapshot.json +3719 -0
  71. package/src/db/migrations/pg/meta/0034_snapshot.json +3766 -0
  72. package/src/db/migrations/pg/meta/0035_snapshot.json +3773 -0
  73. package/src/db/migrations/pg/meta/0036_snapshot.json +3766 -0
  74. package/src/db/migrations/pg/meta/0037_snapshot.json +3772 -0
  75. package/src/db/migrations/pg/meta/_journal.json +35 -0
  76. package/src/db/pg/schema.ts +41 -0
  77. package/src/db/post-visibility.ts +37 -6
  78. package/src/db/schema.ts +64 -0
  79. package/src/i18n/locales/glossary.zh-Hans.yml +4 -0
  80. package/src/i18n/locales/glossary.zh-Hant.yml +4 -0
  81. package/src/i18n/locales/public/en.po +26 -7
  82. package/src/i18n/locales/public/en.ts +1 -1
  83. package/src/i18n/locales/public/zh-Hans.po +25 -6
  84. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  85. package/src/i18n/locales/public/zh-Hant.po +25 -6
  86. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  87. package/src/i18n/locales/settings/en.po +159 -0
  88. package/src/i18n/locales/settings/en.ts +1 -1
  89. package/src/i18n/locales/settings/zh-Hans.po +159 -0
  90. package/src/i18n/locales/settings/zh-Hans.ts +1 -1
  91. package/src/i18n/locales/settings/zh-Hant.po +159 -0
  92. package/src/i18n/locales/settings/zh-Hant.ts +1 -1
  93. package/src/lib/api-public-posts.ts +10 -0
  94. package/src/lib/env.ts +20 -0
  95. package/src/lib/feed-policy.ts +2 -2
  96. package/src/lib/filter-dimensions.ts +11 -4
  97. package/src/lib/github-app-state.ts +1 -1
  98. package/src/lib/github-app.ts +183 -1
  99. package/src/lib/hugo-markdown.ts +7 -0
  100. package/src/lib/icons.ts +2 -0
  101. package/src/lib/link-preview.ts +499 -0
  102. package/src/lib/list-views.ts +117 -0
  103. package/src/lib/markdown-manager.ts +169 -2
  104. package/src/lib/navigation.ts +1 -1
  105. package/src/lib/post-meta.ts +13 -3
  106. package/src/lib/referrer-aliases.ts +311 -0
  107. package/src/lib/render.tsx +10 -0
  108. package/src/lib/resolve-config.ts +14 -0
  109. package/src/lib/share-card.ts +4 -3
  110. package/src/lib/summary.ts +152 -54
  111. package/src/lib/thread-query.ts +6 -2
  112. package/src/lib/timeline.ts +12 -11
  113. package/src/lib/tiptap-render.ts +1 -0
  114. package/src/lib/upload.ts +21 -1
  115. package/src/lib/url-fetch.ts +291 -74
  116. package/src/lib/video-playback.ts +55 -0
  117. package/src/lib/view-buffer.ts +201 -0
  118. package/src/lib/view-counting.ts +540 -0
  119. package/src/lib/view-token.ts +199 -0
  120. package/src/lib/view.ts +30 -1
  121. package/src/middleware/view-counter.ts +145 -0
  122. package/src/node/runtime.ts +4 -0
  123. package/src/preset.css +36 -17
  124. package/src/routes/api/media.ts +21 -3
  125. package/src/routes/api/search.ts +1 -1
  126. package/src/routes/dash/settings.tsx +434 -169
  127. package/src/routes/feed/sitemap.ts +1 -1
  128. package/src/routes/pages/archive.tsx +26 -19
  129. package/src/routes/pages/collection.tsx +9 -3
  130. package/src/routes/pages/collections.tsx +1 -0
  131. package/src/routes/pages/featured.tsx +1 -0
  132. package/src/routes/pages/home.tsx +1 -0
  133. package/src/routes/pages/page.tsx +18 -3
  134. package/src/routes/pages/search.tsx +3 -3
  135. package/src/routes/pages/smart-collection.tsx +2 -0
  136. package/src/routes/pages/subscribe.tsx +1 -0
  137. package/src/routes/view-confirm.ts +71 -0
  138. package/src/services/collection.ts +1 -1
  139. package/src/services/export-theme/assets/client-site.js +19 -19
  140. package/src/services/export-theme/layouts/archive/list.html +4 -2
  141. package/src/services/export-theme/layouts/partials/collection-members.html +4 -3
  142. package/src/services/export-theme/layouts/partials/featured-members.html +3 -3
  143. package/src/services/export-theme/layouts/partials/head.html +2 -0
  144. package/src/services/export-theme/layouts/partials/latest-members.html +4 -4
  145. package/src/services/export-theme/layouts/partials/post-card.html +1 -9
  146. package/src/services/export-theme/layouts/partials/reply.html +1 -9
  147. package/src/services/export-theme/layouts/partials/smart-collection-members.html +4 -3
  148. package/src/services/export-theme/layouts/post/list.html +1 -9
  149. package/src/services/export-theme/styles/main.css +41 -47
  150. package/src/services/export.ts +12 -3
  151. package/src/services/index.ts +17 -0
  152. package/src/services/mcp.ts +36 -6
  153. package/src/services/media.ts +63 -0
  154. package/src/services/navigation.ts +9 -4
  155. package/src/services/post.ts +102 -112
  156. package/src/services/search.ts +22 -7
  157. package/src/services/smart-collection.ts +3 -3
  158. package/src/services/stats.ts +1137 -0
  159. package/src/services/thread.ts +6 -2
  160. package/src/styles/components-author.css +242 -3
  161. package/src/styles/components.css +11 -3
  162. package/src/styles/tokens.css +89 -55
  163. package/src/styles/ui-author.css +140 -353
  164. package/src/styles/ui.css +90 -45
  165. package/src/types/app-context.ts +9 -0
  166. package/src/types/bindings.ts +5 -0
  167. package/src/types/config.ts +54 -0
  168. package/src/types/constants.ts +68 -4
  169. package/src/types/entities.ts +1 -0
  170. package/src/types/views.ts +8 -0
  171. package/src/ui/compose/ComposeDialog.tsx +26 -1
  172. package/src/ui/dash/StatusBadge.tsx +11 -0
  173. package/src/ui/dash/appearance/FontThemeContent.tsx +1 -1
  174. package/src/ui/dash/appearance/NavigationContent.tsx +8 -0
  175. package/src/ui/dash/settings/SettingsRootContent.tsx +24 -6
  176. package/src/ui/dash/settings/StatsContent.tsx +855 -0
  177. package/src/ui/feed/LinkCard.tsx +19 -2
  178. package/src/ui/feed/PostStatusBadges.tsx +19 -3
  179. package/src/ui/feed/TimelineFeed.tsx +3 -0
  180. package/src/ui/font-themes.ts +56 -6
  181. package/src/ui/layouts/BaseLayout.tsx +4 -2
  182. package/src/ui/layouts/SiteLayout.tsx +8 -3
  183. package/src/ui/pages/ArchivePage.tsx +1 -0
  184. package/src/ui/shared/MediaGallery.tsx +19 -3
  185. package/src/ui/shared/PostFooter.tsx +1 -22
  186. package/src/ui/shared/custom-icons.ts +5 -5
  187. package/dist/client/_assets/chunks/footnote-rail-B08scyhW.js +0 -2
  188. package/dist/client/_assets/chunks/lit-Bw_voPoW.js +0 -2
  189. package/dist/client/_assets/chunks/runtime-paths-y0_gHowM.js +0 -1
  190. package/dist/client/_assets/chunks/sortable-list-t11Ma1Ek.js +0 -2
  191. package/dist/client/_assets/chunks/types-D5iF3H1a.js +0 -1
  192. package/dist/client/_assets/chunks/unsafe-svg-DZl-yjas.js +0 -1
  193. package/dist/client/_assets/client-B0-s9sqx.css +0 -2
  194. package/dist/client/_assets/client-Dp46QSht.js +0 -354
  195. package/dist/client/_assets/client-compose-DkUTuavR.js +0 -2004
  196. package/dist/client/_assets/client-share-C59mOLJ1.js +0 -149
@@ -0,0 +1,2931 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "27f6ff7d-0003-4364-bda0-c80268662dda",
5
+ "prevId": "4f03c680-15f8-4fdc-9357-4706ea4a7d4f",
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
+ "preview_icon_key": {
1259
+ "name": "preview_icon_key",
1260
+ "type": "text",
1261
+ "primaryKey": false,
1262
+ "notNull": false,
1263
+ "autoincrement": false
1264
+ },
1265
+ "reply_to_id": {
1266
+ "name": "reply_to_id",
1267
+ "type": "text",
1268
+ "primaryKey": false,
1269
+ "notNull": false,
1270
+ "autoincrement": false
1271
+ },
1272
+ "thread_id": {
1273
+ "name": "thread_id",
1274
+ "type": "text",
1275
+ "primaryKey": false,
1276
+ "notNull": true,
1277
+ "autoincrement": false
1278
+ },
1279
+ "language": {
1280
+ "name": "language",
1281
+ "type": "text",
1282
+ "primaryKey": false,
1283
+ "notNull": false,
1284
+ "autoincrement": false
1285
+ },
1286
+ "translation_group_id": {
1287
+ "name": "translation_group_id",
1288
+ "type": "text",
1289
+ "primaryKey": false,
1290
+ "notNull": false,
1291
+ "autoincrement": false
1292
+ },
1293
+ "quiet_reply": {
1294
+ "name": "quiet_reply",
1295
+ "type": "integer",
1296
+ "primaryKey": false,
1297
+ "notNull": true,
1298
+ "autoincrement": false,
1299
+ "default": false
1300
+ },
1301
+ "published_at": {
1302
+ "name": "published_at",
1303
+ "type": "integer",
1304
+ "primaryKey": false,
1305
+ "notNull": false,
1306
+ "autoincrement": false
1307
+ },
1308
+ "last_activity_at": {
1309
+ "name": "last_activity_at",
1310
+ "type": "integer",
1311
+ "primaryKey": false,
1312
+ "notNull": false,
1313
+ "autoincrement": false
1314
+ },
1315
+ "thread_updated_at": {
1316
+ "name": "thread_updated_at",
1317
+ "type": "integer",
1318
+ "primaryKey": false,
1319
+ "notNull": false,
1320
+ "autoincrement": false
1321
+ },
1322
+ "created_at": {
1323
+ "name": "created_at",
1324
+ "type": "integer",
1325
+ "primaryKey": false,
1326
+ "notNull": true,
1327
+ "autoincrement": false
1328
+ },
1329
+ "updated_at": {
1330
+ "name": "updated_at",
1331
+ "type": "integer",
1332
+ "primaryKey": false,
1333
+ "notNull": true,
1334
+ "autoincrement": false
1335
+ }
1336
+ },
1337
+ "indexes": {
1338
+ "uq_post_site_id_id": {
1339
+ "name": "uq_post_site_id_id",
1340
+ "columns": ["site_id", "id"],
1341
+ "isUnique": true
1342
+ },
1343
+ "idx_post_site_thread_id": {
1344
+ "name": "idx_post_site_thread_id",
1345
+ "columns": ["site_id", "thread_id"],
1346
+ "isUnique": false
1347
+ },
1348
+ "idx_post_site_thread_created": {
1349
+ "name": "idx_post_site_thread_created",
1350
+ "columns": ["site_id", "thread_id", "created_at", "id"],
1351
+ "isUnique": false
1352
+ },
1353
+ "idx_post_site_status_published": {
1354
+ "name": "idx_post_site_status_published",
1355
+ "columns": ["site_id", "status", "published_at"],
1356
+ "isUnique": false
1357
+ },
1358
+ "idx_post_site_status_activity": {
1359
+ "name": "idx_post_site_status_activity",
1360
+ "columns": ["site_id", "status", "last_activity_at"],
1361
+ "isUnique": false
1362
+ },
1363
+ "idx_post_site_root_published_activity": {
1364
+ "name": "idx_post_site_root_published_activity",
1365
+ "columns": ["site_id", "last_activity_at", "id"],
1366
+ "isUnique": false,
1367
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'"
1368
+ },
1369
+ "idx_post_site_root_thread_updated": {
1370
+ "name": "idx_post_site_root_thread_updated",
1371
+ "columns": ["site_id", "thread_updated_at", "id"],
1372
+ "isUnique": false,
1373
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'"
1374
+ },
1375
+ "idx_post_site_root_draft_updated": {
1376
+ "name": "idx_post_site_root_draft_updated",
1377
+ "columns": ["site_id", "updated_at", "id"],
1378
+ "isUnique": false,
1379
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'draft'"
1380
+ },
1381
+ "idx_post_site_reply_thread_created": {
1382
+ "name": "idx_post_site_reply_thread_created",
1383
+ "columns": ["site_id", "thread_id", "created_at", "id"],
1384
+ "isUnique": false,
1385
+ "where": "\"post\".\"reply_to_id\" IS NOT NULL AND \"post\".\"status\" = 'published'"
1386
+ },
1387
+ "idx_post_site_featured_thread_published": {
1388
+ "name": "idx_post_site_featured_thread_published",
1389
+ "columns": ["site_id", "thread_id", "published_at", "id"],
1390
+ "isUnique": false,
1391
+ "where": "\"post\".\"status\" = 'published' AND \"post\".\"featured_at\" IS NOT NULL"
1392
+ },
1393
+ "uq_post_site_translation_group_language": {
1394
+ "name": "uq_post_site_translation_group_language",
1395
+ "columns": ["site_id", "translation_group_id", "language"],
1396
+ "isUnique": true,
1397
+ "where": "\"post\".\"translation_group_id\" IS NOT NULL"
1398
+ }
1399
+ },
1400
+ "foreignKeys": {
1401
+ "post_site_id_site_id_fk": {
1402
+ "name": "post_site_id_site_id_fk",
1403
+ "tableFrom": "post",
1404
+ "tableTo": "site",
1405
+ "columnsFrom": ["site_id"],
1406
+ "columnsTo": ["id"],
1407
+ "onDelete": "cascade",
1408
+ "onUpdate": "no action"
1409
+ },
1410
+ "post_site_id_reply_to_id_post_site_id_id_fk": {
1411
+ "name": "post_site_id_reply_to_id_post_site_id_id_fk",
1412
+ "tableFrom": "post",
1413
+ "tableTo": "post",
1414
+ "columnsFrom": ["site_id", "reply_to_id"],
1415
+ "columnsTo": ["site_id", "id"],
1416
+ "onDelete": "no action",
1417
+ "onUpdate": "no action"
1418
+ },
1419
+ "post_site_id_thread_id_post_site_id_id_fk": {
1420
+ "name": "post_site_id_thread_id_post_site_id_id_fk",
1421
+ "tableFrom": "post",
1422
+ "tableTo": "post",
1423
+ "columnsFrom": ["site_id", "thread_id"],
1424
+ "columnsTo": ["site_id", "id"],
1425
+ "onDelete": "no action",
1426
+ "onUpdate": "no action"
1427
+ }
1428
+ },
1429
+ "compositePrimaryKeys": {},
1430
+ "uniqueConstraints": {},
1431
+ "checkConstraints": {
1432
+ "chk_post_reply_to_not_self": {
1433
+ "name": "chk_post_reply_to_not_self",
1434
+ "value": "\"post\".\"reply_to_id\" IS NULL OR \"post\".\"reply_to_id\" <> \"post\".\"id\""
1435
+ },
1436
+ "chk_post_thread_shape": {
1437
+ "name": "chk_post_thread_shape",
1438
+ "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 )"
1439
+ }
1440
+ }
1441
+ },
1442
+ "rate_limit": {
1443
+ "name": "rate_limit",
1444
+ "columns": {
1445
+ "key": {
1446
+ "name": "key",
1447
+ "type": "text",
1448
+ "primaryKey": false,
1449
+ "notNull": true,
1450
+ "autoincrement": false
1451
+ },
1452
+ "window_start": {
1453
+ "name": "window_start",
1454
+ "type": "integer",
1455
+ "primaryKey": false,
1456
+ "notNull": true,
1457
+ "autoincrement": false
1458
+ },
1459
+ "count": {
1460
+ "name": "count",
1461
+ "type": "integer",
1462
+ "primaryKey": false,
1463
+ "notNull": true,
1464
+ "autoincrement": false,
1465
+ "default": 0
1466
+ }
1467
+ },
1468
+ "indexes": {},
1469
+ "foreignKeys": {},
1470
+ "compositePrimaryKeys": {
1471
+ "rate_limit_key_window_start_pk": {
1472
+ "columns": ["key", "window_start"],
1473
+ "name": "rate_limit_key_window_start_pk"
1474
+ }
1475
+ },
1476
+ "uniqueConstraints": {},
1477
+ "checkConstraints": {}
1478
+ },
1479
+ "session": {
1480
+ "name": "session",
1481
+ "columns": {
1482
+ "id": {
1483
+ "name": "id",
1484
+ "type": "text",
1485
+ "primaryKey": true,
1486
+ "notNull": true,
1487
+ "autoincrement": false
1488
+ },
1489
+ "expires_at": {
1490
+ "name": "expires_at",
1491
+ "type": "integer",
1492
+ "primaryKey": false,
1493
+ "notNull": true,
1494
+ "autoincrement": false
1495
+ },
1496
+ "token": {
1497
+ "name": "token",
1498
+ "type": "text",
1499
+ "primaryKey": false,
1500
+ "notNull": true,
1501
+ "autoincrement": false
1502
+ },
1503
+ "created_at": {
1504
+ "name": "created_at",
1505
+ "type": "integer",
1506
+ "primaryKey": false,
1507
+ "notNull": true,
1508
+ "autoincrement": false
1509
+ },
1510
+ "updated_at": {
1511
+ "name": "updated_at",
1512
+ "type": "integer",
1513
+ "primaryKey": false,
1514
+ "notNull": true,
1515
+ "autoincrement": false
1516
+ },
1517
+ "ip_address": {
1518
+ "name": "ip_address",
1519
+ "type": "text",
1520
+ "primaryKey": false,
1521
+ "notNull": false,
1522
+ "autoincrement": false
1523
+ },
1524
+ "user_agent": {
1525
+ "name": "user_agent",
1526
+ "type": "text",
1527
+ "primaryKey": false,
1528
+ "notNull": false,
1529
+ "autoincrement": false
1530
+ },
1531
+ "user_id": {
1532
+ "name": "user_id",
1533
+ "type": "text",
1534
+ "primaryKey": false,
1535
+ "notNull": true,
1536
+ "autoincrement": false
1537
+ }
1538
+ },
1539
+ "indexes": {
1540
+ "session_token_unique": {
1541
+ "name": "session_token_unique",
1542
+ "columns": ["token"],
1543
+ "isUnique": true
1544
+ },
1545
+ "idx_session_user_id": {
1546
+ "name": "idx_session_user_id",
1547
+ "columns": ["user_id"],
1548
+ "isUnique": false
1549
+ }
1550
+ },
1551
+ "foreignKeys": {
1552
+ "session_user_id_user_id_fk": {
1553
+ "name": "session_user_id_user_id_fk",
1554
+ "tableFrom": "session",
1555
+ "tableTo": "user",
1556
+ "columnsFrom": ["user_id"],
1557
+ "columnsTo": ["id"],
1558
+ "onDelete": "no action",
1559
+ "onUpdate": "no action"
1560
+ }
1561
+ },
1562
+ "compositePrimaryKeys": {},
1563
+ "uniqueConstraints": {},
1564
+ "checkConstraints": {}
1565
+ },
1566
+ "site_setting": {
1567
+ "name": "site_setting",
1568
+ "columns": {
1569
+ "site_id": {
1570
+ "name": "site_id",
1571
+ "type": "text",
1572
+ "primaryKey": false,
1573
+ "notNull": true,
1574
+ "autoincrement": false
1575
+ },
1576
+ "key": {
1577
+ "name": "key",
1578
+ "type": "text",
1579
+ "primaryKey": false,
1580
+ "notNull": true,
1581
+ "autoincrement": false
1582
+ },
1583
+ "value": {
1584
+ "name": "value",
1585
+ "type": "text",
1586
+ "primaryKey": false,
1587
+ "notNull": true,
1588
+ "autoincrement": false
1589
+ },
1590
+ "updated_at": {
1591
+ "name": "updated_at",
1592
+ "type": "integer",
1593
+ "primaryKey": false,
1594
+ "notNull": true,
1595
+ "autoincrement": false
1596
+ }
1597
+ },
1598
+ "indexes": {
1599
+ "idx_site_setting_site_id": {
1600
+ "name": "idx_site_setting_site_id",
1601
+ "columns": ["site_id"],
1602
+ "isUnique": false
1603
+ }
1604
+ },
1605
+ "foreignKeys": {
1606
+ "site_setting_site_id_site_id_fk": {
1607
+ "name": "site_setting_site_id_site_id_fk",
1608
+ "tableFrom": "site_setting",
1609
+ "tableTo": "site",
1610
+ "columnsFrom": ["site_id"],
1611
+ "columnsTo": ["id"],
1612
+ "onDelete": "cascade",
1613
+ "onUpdate": "no action"
1614
+ }
1615
+ },
1616
+ "compositePrimaryKeys": {
1617
+ "site_setting_site_id_key_pk": {
1618
+ "columns": ["site_id", "key"],
1619
+ "name": "site_setting_site_id_key_pk"
1620
+ }
1621
+ },
1622
+ "uniqueConstraints": {},
1623
+ "checkConstraints": {}
1624
+ },
1625
+ "site_domain": {
1626
+ "name": "site_domain",
1627
+ "columns": {
1628
+ "id": {
1629
+ "name": "id",
1630
+ "type": "text",
1631
+ "primaryKey": true,
1632
+ "notNull": true,
1633
+ "autoincrement": false
1634
+ },
1635
+ "site_id": {
1636
+ "name": "site_id",
1637
+ "type": "text",
1638
+ "primaryKey": false,
1639
+ "notNull": true,
1640
+ "autoincrement": false
1641
+ },
1642
+ "host": {
1643
+ "name": "host",
1644
+ "type": "text",
1645
+ "primaryKey": false,
1646
+ "notNull": true,
1647
+ "autoincrement": false
1648
+ },
1649
+ "path_prefix": {
1650
+ "name": "path_prefix",
1651
+ "type": "text",
1652
+ "primaryKey": false,
1653
+ "notNull": false,
1654
+ "autoincrement": false
1655
+ },
1656
+ "kind": {
1657
+ "name": "kind",
1658
+ "type": "text",
1659
+ "primaryKey": false,
1660
+ "notNull": true,
1661
+ "autoincrement": false,
1662
+ "default": "'primary'"
1663
+ },
1664
+ "redirect_to_primary": {
1665
+ "name": "redirect_to_primary",
1666
+ "type": "integer",
1667
+ "primaryKey": false,
1668
+ "notNull": true,
1669
+ "autoincrement": false,
1670
+ "default": true
1671
+ },
1672
+ "created_at": {
1673
+ "name": "created_at",
1674
+ "type": "integer",
1675
+ "primaryKey": false,
1676
+ "notNull": true,
1677
+ "autoincrement": false
1678
+ },
1679
+ "updated_at": {
1680
+ "name": "updated_at",
1681
+ "type": "integer",
1682
+ "primaryKey": false,
1683
+ "notNull": true,
1684
+ "autoincrement": false
1685
+ }
1686
+ },
1687
+ "indexes": {
1688
+ "uq_site_domain_host": {
1689
+ "name": "uq_site_domain_host",
1690
+ "columns": ["host"],
1691
+ "isUnique": true
1692
+ },
1693
+ "idx_site_domain_site_id": {
1694
+ "name": "idx_site_domain_site_id",
1695
+ "columns": ["site_id"],
1696
+ "isUnique": false
1697
+ }
1698
+ },
1699
+ "foreignKeys": {
1700
+ "site_domain_site_id_site_id_fk": {
1701
+ "name": "site_domain_site_id_site_id_fk",
1702
+ "tableFrom": "site_domain",
1703
+ "tableTo": "site",
1704
+ "columnsFrom": ["site_id"],
1705
+ "columnsTo": ["id"],
1706
+ "onDelete": "cascade",
1707
+ "onUpdate": "no action"
1708
+ }
1709
+ },
1710
+ "compositePrimaryKeys": {},
1711
+ "uniqueConstraints": {},
1712
+ "checkConstraints": {
1713
+ "chk_site_domain_kind": {
1714
+ "name": "chk_site_domain_kind",
1715
+ "value": "\"site_domain\".\"kind\" IN ('primary', 'alias')"
1716
+ }
1717
+ }
1718
+ },
1719
+ "site_member": {
1720
+ "name": "site_member",
1721
+ "columns": {
1722
+ "site_id": {
1723
+ "name": "site_id",
1724
+ "type": "text",
1725
+ "primaryKey": false,
1726
+ "notNull": true,
1727
+ "autoincrement": false
1728
+ },
1729
+ "user_id": {
1730
+ "name": "user_id",
1731
+ "type": "text",
1732
+ "primaryKey": false,
1733
+ "notNull": true,
1734
+ "autoincrement": false
1735
+ },
1736
+ "role": {
1737
+ "name": "role",
1738
+ "type": "text",
1739
+ "primaryKey": false,
1740
+ "notNull": true,
1741
+ "autoincrement": false,
1742
+ "default": "'editor'"
1743
+ },
1744
+ "created_at": {
1745
+ "name": "created_at",
1746
+ "type": "integer",
1747
+ "primaryKey": false,
1748
+ "notNull": true,
1749
+ "autoincrement": false
1750
+ },
1751
+ "updated_at": {
1752
+ "name": "updated_at",
1753
+ "type": "integer",
1754
+ "primaryKey": false,
1755
+ "notNull": true,
1756
+ "autoincrement": false
1757
+ }
1758
+ },
1759
+ "indexes": {
1760
+ "idx_site_member_user_id": {
1761
+ "name": "idx_site_member_user_id",
1762
+ "columns": ["user_id"],
1763
+ "isUnique": false
1764
+ }
1765
+ },
1766
+ "foreignKeys": {
1767
+ "site_member_site_id_site_id_fk": {
1768
+ "name": "site_member_site_id_site_id_fk",
1769
+ "tableFrom": "site_member",
1770
+ "tableTo": "site",
1771
+ "columnsFrom": ["site_id"],
1772
+ "columnsTo": ["id"],
1773
+ "onDelete": "cascade",
1774
+ "onUpdate": "no action"
1775
+ }
1776
+ },
1777
+ "compositePrimaryKeys": {
1778
+ "site_member_site_id_user_id_pk": {
1779
+ "columns": ["site_id", "user_id"],
1780
+ "name": "site_member_site_id_user_id_pk"
1781
+ }
1782
+ },
1783
+ "uniqueConstraints": {},
1784
+ "checkConstraints": {
1785
+ "chk_site_member_role": {
1786
+ "name": "chk_site_member_role",
1787
+ "value": "\"site_member\".\"role\" IN ('owner', 'admin', 'editor')"
1788
+ }
1789
+ }
1790
+ },
1791
+ "site": {
1792
+ "name": "site",
1793
+ "columns": {
1794
+ "id": {
1795
+ "name": "id",
1796
+ "type": "text",
1797
+ "primaryKey": true,
1798
+ "notNull": true,
1799
+ "autoincrement": false
1800
+ },
1801
+ "key": {
1802
+ "name": "key",
1803
+ "type": "text",
1804
+ "primaryKey": false,
1805
+ "notNull": true,
1806
+ "autoincrement": false
1807
+ },
1808
+ "status": {
1809
+ "name": "status",
1810
+ "type": "text",
1811
+ "primaryKey": false,
1812
+ "notNull": true,
1813
+ "autoincrement": false,
1814
+ "default": "'active'"
1815
+ },
1816
+ "provisioning_idempotency_key": {
1817
+ "name": "provisioning_idempotency_key",
1818
+ "type": "text",
1819
+ "primaryKey": false,
1820
+ "notNull": false,
1821
+ "autoincrement": false
1822
+ },
1823
+ "created_at": {
1824
+ "name": "created_at",
1825
+ "type": "integer",
1826
+ "primaryKey": false,
1827
+ "notNull": true,
1828
+ "autoincrement": false
1829
+ },
1830
+ "updated_at": {
1831
+ "name": "updated_at",
1832
+ "type": "integer",
1833
+ "primaryKey": false,
1834
+ "notNull": true,
1835
+ "autoincrement": false
1836
+ }
1837
+ },
1838
+ "indexes": {
1839
+ "uq_site_key": {
1840
+ "name": "uq_site_key",
1841
+ "columns": ["key"],
1842
+ "isUnique": true
1843
+ },
1844
+ "uq_site_provisioning_idempotency_key": {
1845
+ "name": "uq_site_provisioning_idempotency_key",
1846
+ "columns": ["provisioning_idempotency_key"],
1847
+ "isUnique": true,
1848
+ "where": "\"site\".\"provisioning_idempotency_key\" IS NOT NULL"
1849
+ }
1850
+ },
1851
+ "foreignKeys": {},
1852
+ "compositePrimaryKeys": {},
1853
+ "uniqueConstraints": {},
1854
+ "checkConstraints": {
1855
+ "chk_site_status": {
1856
+ "name": "chk_site_status",
1857
+ "value": "\"site\".\"status\" IN ('active', 'suspended')"
1858
+ }
1859
+ }
1860
+ },
1861
+ "smart_collection": {
1862
+ "name": "smart_collection",
1863
+ "columns": {
1864
+ "id": {
1865
+ "name": "id",
1866
+ "type": "text",
1867
+ "primaryKey": true,
1868
+ "notNull": true,
1869
+ "autoincrement": false
1870
+ },
1871
+ "site_id": {
1872
+ "name": "site_id",
1873
+ "type": "text",
1874
+ "primaryKey": false,
1875
+ "notNull": true,
1876
+ "autoincrement": false
1877
+ },
1878
+ "title": {
1879
+ "name": "title",
1880
+ "type": "text",
1881
+ "primaryKey": false,
1882
+ "notNull": true,
1883
+ "autoincrement": false
1884
+ },
1885
+ "description": {
1886
+ "name": "description",
1887
+ "type": "text",
1888
+ "primaryKey": false,
1889
+ "notNull": false,
1890
+ "autoincrement": false
1891
+ },
1892
+ "format": {
1893
+ "name": "format",
1894
+ "type": "text",
1895
+ "primaryKey": false,
1896
+ "notNull": false,
1897
+ "autoincrement": false
1898
+ },
1899
+ "year": {
1900
+ "name": "year",
1901
+ "type": "integer",
1902
+ "primaryKey": false,
1903
+ "notNull": false,
1904
+ "autoincrement": false
1905
+ },
1906
+ "collection_id": {
1907
+ "name": "collection_id",
1908
+ "type": "text",
1909
+ "primaryKey": false,
1910
+ "notNull": false,
1911
+ "autoincrement": false
1912
+ },
1913
+ "media": {
1914
+ "name": "media",
1915
+ "type": "text",
1916
+ "primaryKey": false,
1917
+ "notNull": false,
1918
+ "autoincrement": false
1919
+ },
1920
+ "has_title": {
1921
+ "name": "has_title",
1922
+ "type": "integer",
1923
+ "primaryKey": false,
1924
+ "notNull": false,
1925
+ "autoincrement": false
1926
+ },
1927
+ "has_replies": {
1928
+ "name": "has_replies",
1929
+ "type": "integer",
1930
+ "primaryKey": false,
1931
+ "notNull": false,
1932
+ "autoincrement": false
1933
+ },
1934
+ "visibility": {
1935
+ "name": "visibility",
1936
+ "type": "text",
1937
+ "primaryKey": false,
1938
+ "notNull": false,
1939
+ "autoincrement": false
1940
+ },
1941
+ "sort": {
1942
+ "name": "sort",
1943
+ "type": "text",
1944
+ "primaryKey": false,
1945
+ "notNull": true,
1946
+ "autoincrement": false,
1947
+ "default": "'newest'"
1948
+ },
1949
+ "layout": {
1950
+ "name": "layout",
1951
+ "type": "text",
1952
+ "primaryKey": false,
1953
+ "notNull": false,
1954
+ "autoincrement": false
1955
+ },
1956
+ "created_at": {
1957
+ "name": "created_at",
1958
+ "type": "integer",
1959
+ "primaryKey": false,
1960
+ "notNull": true,
1961
+ "autoincrement": false
1962
+ },
1963
+ "updated_at": {
1964
+ "name": "updated_at",
1965
+ "type": "integer",
1966
+ "primaryKey": false,
1967
+ "notNull": true,
1968
+ "autoincrement": false
1969
+ }
1970
+ },
1971
+ "indexes": {
1972
+ "idx_smart_collection_site_created_at": {
1973
+ "name": "idx_smart_collection_site_created_at",
1974
+ "columns": ["site_id", "created_at"],
1975
+ "isUnique": false
1976
+ },
1977
+ "idx_smart_collection_site_collection_id": {
1978
+ "name": "idx_smart_collection_site_collection_id",
1979
+ "columns": ["site_id", "collection_id"],
1980
+ "isUnique": false
1981
+ }
1982
+ },
1983
+ "foreignKeys": {
1984
+ "smart_collection_site_id_site_id_fk": {
1985
+ "name": "smart_collection_site_id_site_id_fk",
1986
+ "tableFrom": "smart_collection",
1987
+ "tableTo": "site",
1988
+ "columnsFrom": ["site_id"],
1989
+ "columnsTo": ["id"],
1990
+ "onDelete": "cascade",
1991
+ "onUpdate": "no action"
1992
+ }
1993
+ },
1994
+ "compositePrimaryKeys": {},
1995
+ "uniqueConstraints": {},
1996
+ "checkConstraints": {
1997
+ "chk_smart_collection_format": {
1998
+ "name": "chk_smart_collection_format",
1999
+ "value": "\"smart_collection\".\"format\" IS NULL OR \"smart_collection\".\"format\" IN ('note', 'link', 'quote')"
2000
+ },
2001
+ "chk_smart_collection_visibility": {
2002
+ "name": "chk_smart_collection_visibility",
2003
+ "value": "\"smart_collection\".\"visibility\" IS NULL OR \"smart_collection\".\"visibility\" IN ('public', 'featured', 'latest_hidden')"
2004
+ },
2005
+ "chk_smart_collection_sort": {
2006
+ "name": "chk_smart_collection_sort",
2007
+ "value": "\"smart_collection\".\"sort\" IN ('newest', 'oldest', 'rating_desc')"
2008
+ },
2009
+ "chk_smart_collection_layout": {
2010
+ "name": "chk_smart_collection_layout",
2011
+ "value": "\"smart_collection\".\"layout\" IS NULL OR \"smart_collection\".\"layout\" IN ('list', 'grid')"
2012
+ },
2013
+ "chk_smart_collection_year": {
2014
+ "name": "chk_smart_collection_year",
2015
+ "value": "\"smart_collection\".\"year\" IS NULL OR \"smart_collection\".\"year\" BETWEEN 1971 AND 9999"
2016
+ }
2017
+ }
2018
+ },
2019
+ "storage_purge": {
2020
+ "name": "storage_purge",
2021
+ "columns": {
2022
+ "id": {
2023
+ "name": "id",
2024
+ "type": "text",
2025
+ "primaryKey": true,
2026
+ "notNull": true,
2027
+ "autoincrement": false
2028
+ },
2029
+ "site_id": {
2030
+ "name": "site_id",
2031
+ "type": "text",
2032
+ "primaryKey": false,
2033
+ "notNull": true,
2034
+ "autoincrement": false
2035
+ },
2036
+ "provider": {
2037
+ "name": "provider",
2038
+ "type": "text",
2039
+ "primaryKey": false,
2040
+ "notNull": true,
2041
+ "autoincrement": false
2042
+ },
2043
+ "storage_key": {
2044
+ "name": "storage_key",
2045
+ "type": "text",
2046
+ "primaryKey": false,
2047
+ "notNull": true,
2048
+ "autoincrement": false
2049
+ },
2050
+ "original_key": {
2051
+ "name": "original_key",
2052
+ "type": "text",
2053
+ "primaryKey": false,
2054
+ "notNull": true,
2055
+ "autoincrement": false
2056
+ },
2057
+ "reason": {
2058
+ "name": "reason",
2059
+ "type": "text",
2060
+ "primaryKey": false,
2061
+ "notNull": false,
2062
+ "autoincrement": false
2063
+ },
2064
+ "purge_after": {
2065
+ "name": "purge_after",
2066
+ "type": "integer",
2067
+ "primaryKey": false,
2068
+ "notNull": true,
2069
+ "autoincrement": false
2070
+ },
2071
+ "created_at": {
2072
+ "name": "created_at",
2073
+ "type": "integer",
2074
+ "primaryKey": false,
2075
+ "notNull": true,
2076
+ "autoincrement": false
2077
+ }
2078
+ },
2079
+ "indexes": {
2080
+ "uq_storage_purge_provider_key": {
2081
+ "name": "uq_storage_purge_provider_key",
2082
+ "columns": ["provider", "storage_key"],
2083
+ "isUnique": true
2084
+ },
2085
+ "idx_storage_purge_site_provider_due": {
2086
+ "name": "idx_storage_purge_site_provider_due",
2087
+ "columns": ["site_id", "provider", "purge_after"],
2088
+ "isUnique": false
2089
+ }
2090
+ },
2091
+ "foreignKeys": {
2092
+ "storage_purge_site_id_site_id_fk": {
2093
+ "name": "storage_purge_site_id_site_id_fk",
2094
+ "tableFrom": "storage_purge",
2095
+ "tableTo": "site",
2096
+ "columnsFrom": ["site_id"],
2097
+ "columnsTo": ["id"],
2098
+ "onDelete": "cascade",
2099
+ "onUpdate": "no action"
2100
+ }
2101
+ },
2102
+ "compositePrimaryKeys": {},
2103
+ "uniqueConstraints": {},
2104
+ "checkConstraints": {}
2105
+ },
2106
+ "telegram_binding": {
2107
+ "name": "telegram_binding",
2108
+ "columns": {
2109
+ "id": {
2110
+ "name": "id",
2111
+ "type": "text",
2112
+ "primaryKey": true,
2113
+ "notNull": true,
2114
+ "autoincrement": false
2115
+ },
2116
+ "site_id": {
2117
+ "name": "site_id",
2118
+ "type": "text",
2119
+ "primaryKey": false,
2120
+ "notNull": true,
2121
+ "autoincrement": false
2122
+ },
2123
+ "bot_id": {
2124
+ "name": "bot_id",
2125
+ "type": "text",
2126
+ "primaryKey": false,
2127
+ "notNull": true,
2128
+ "autoincrement": false
2129
+ },
2130
+ "telegram_user_id": {
2131
+ "name": "telegram_user_id",
2132
+ "type": "text",
2133
+ "primaryKey": false,
2134
+ "notNull": true,
2135
+ "autoincrement": false
2136
+ },
2137
+ "telegram_username": {
2138
+ "name": "telegram_username",
2139
+ "type": "text",
2140
+ "primaryKey": false,
2141
+ "notNull": false,
2142
+ "autoincrement": false
2143
+ },
2144
+ "last_update_id": {
2145
+ "name": "last_update_id",
2146
+ "type": "integer",
2147
+ "primaryKey": false,
2148
+ "notNull": false,
2149
+ "autoincrement": false
2150
+ },
2151
+ "bound_at": {
2152
+ "name": "bound_at",
2153
+ "type": "integer",
2154
+ "primaryKey": false,
2155
+ "notNull": true,
2156
+ "autoincrement": false
2157
+ }
2158
+ },
2159
+ "indexes": {
2160
+ "uq_telegram_binding_site_id": {
2161
+ "name": "uq_telegram_binding_site_id",
2162
+ "columns": ["site_id"],
2163
+ "isUnique": true
2164
+ },
2165
+ "uq_telegram_binding_bot_user": {
2166
+ "name": "uq_telegram_binding_bot_user",
2167
+ "columns": ["bot_id", "telegram_user_id"],
2168
+ "isUnique": true
2169
+ }
2170
+ },
2171
+ "foreignKeys": {
2172
+ "telegram_binding_site_id_site_id_fk": {
2173
+ "name": "telegram_binding_site_id_site_id_fk",
2174
+ "tableFrom": "telegram_binding",
2175
+ "tableTo": "site",
2176
+ "columnsFrom": ["site_id"],
2177
+ "columnsTo": ["id"],
2178
+ "onDelete": "cascade",
2179
+ "onUpdate": "no action"
2180
+ }
2181
+ },
2182
+ "compositePrimaryKeys": {},
2183
+ "uniqueConstraints": {},
2184
+ "checkConstraints": {}
2185
+ },
2186
+ "telegram_media_group_item": {
2187
+ "name": "telegram_media_group_item",
2188
+ "columns": {
2189
+ "id": {
2190
+ "name": "id",
2191
+ "type": "text",
2192
+ "primaryKey": true,
2193
+ "notNull": true,
2194
+ "autoincrement": false
2195
+ },
2196
+ "site_id": {
2197
+ "name": "site_id",
2198
+ "type": "text",
2199
+ "primaryKey": false,
2200
+ "notNull": true,
2201
+ "autoincrement": false
2202
+ },
2203
+ "bot_id": {
2204
+ "name": "bot_id",
2205
+ "type": "text",
2206
+ "primaryKey": false,
2207
+ "notNull": true,
2208
+ "autoincrement": false
2209
+ },
2210
+ "telegram_user_id": {
2211
+ "name": "telegram_user_id",
2212
+ "type": "text",
2213
+ "primaryKey": false,
2214
+ "notNull": true,
2215
+ "autoincrement": false
2216
+ },
2217
+ "media_group_id": {
2218
+ "name": "media_group_id",
2219
+ "type": "text",
2220
+ "primaryKey": false,
2221
+ "notNull": true,
2222
+ "autoincrement": false
2223
+ },
2224
+ "chat_id": {
2225
+ "name": "chat_id",
2226
+ "type": "integer",
2227
+ "primaryKey": false,
2228
+ "notNull": true,
2229
+ "autoincrement": false
2230
+ },
2231
+ "message_id": {
2232
+ "name": "message_id",
2233
+ "type": "integer",
2234
+ "primaryKey": false,
2235
+ "notNull": true,
2236
+ "autoincrement": false
2237
+ },
2238
+ "update_id": {
2239
+ "name": "update_id",
2240
+ "type": "integer",
2241
+ "primaryKey": false,
2242
+ "notNull": true,
2243
+ "autoincrement": false
2244
+ },
2245
+ "file_id": {
2246
+ "name": "file_id",
2247
+ "type": "text",
2248
+ "primaryKey": false,
2249
+ "notNull": true,
2250
+ "autoincrement": false
2251
+ },
2252
+ "media_kind": {
2253
+ "name": "media_kind",
2254
+ "type": "text",
2255
+ "primaryKey": false,
2256
+ "notNull": true,
2257
+ "autoincrement": false
2258
+ },
2259
+ "mime_type": {
2260
+ "name": "mime_type",
2261
+ "type": "text",
2262
+ "primaryKey": false,
2263
+ "notNull": false,
2264
+ "autoincrement": false
2265
+ },
2266
+ "original_name": {
2267
+ "name": "original_name",
2268
+ "type": "text",
2269
+ "primaryKey": false,
2270
+ "notNull": false,
2271
+ "autoincrement": false
2272
+ },
2273
+ "caption_markdown": {
2274
+ "name": "caption_markdown",
2275
+ "type": "text",
2276
+ "primaryKey": false,
2277
+ "notNull": false,
2278
+ "autoincrement": false
2279
+ },
2280
+ "width": {
2281
+ "name": "width",
2282
+ "type": "integer",
2283
+ "primaryKey": false,
2284
+ "notNull": false,
2285
+ "autoincrement": false
2286
+ },
2287
+ "height": {
2288
+ "name": "height",
2289
+ "type": "integer",
2290
+ "primaryKey": false,
2291
+ "notNull": false,
2292
+ "autoincrement": false
2293
+ },
2294
+ "duration_seconds": {
2295
+ "name": "duration_seconds",
2296
+ "type": "integer",
2297
+ "primaryKey": false,
2298
+ "notNull": false,
2299
+ "autoincrement": false
2300
+ },
2301
+ "poster_file_id": {
2302
+ "name": "poster_file_id",
2303
+ "type": "text",
2304
+ "primaryKey": false,
2305
+ "notNull": false,
2306
+ "autoincrement": false
2307
+ },
2308
+ "created_at": {
2309
+ "name": "created_at",
2310
+ "type": "integer",
2311
+ "primaryKey": false,
2312
+ "notNull": true,
2313
+ "autoincrement": false
2314
+ }
2315
+ },
2316
+ "indexes": {
2317
+ "idx_telegram_media_group_item_group": {
2318
+ "name": "idx_telegram_media_group_item_group",
2319
+ "columns": ["bot_id", "media_group_id"],
2320
+ "isUnique": false
2321
+ },
2322
+ "uq_telegram_media_group_item_message": {
2323
+ "name": "uq_telegram_media_group_item_message",
2324
+ "columns": ["bot_id", "media_group_id", "message_id"],
2325
+ "isUnique": true
2326
+ }
2327
+ },
2328
+ "foreignKeys": {
2329
+ "telegram_media_group_item_site_id_site_id_fk": {
2330
+ "name": "telegram_media_group_item_site_id_site_id_fk",
2331
+ "tableFrom": "telegram_media_group_item",
2332
+ "tableTo": "site",
2333
+ "columnsFrom": ["site_id"],
2334
+ "columnsTo": ["id"],
2335
+ "onDelete": "cascade",
2336
+ "onUpdate": "no action"
2337
+ }
2338
+ },
2339
+ "compositePrimaryKeys": {},
2340
+ "uniqueConstraints": {},
2341
+ "checkConstraints": {}
2342
+ },
2343
+ "telegram_pending_binding": {
2344
+ "name": "telegram_pending_binding",
2345
+ "columns": {
2346
+ "id": {
2347
+ "name": "id",
2348
+ "type": "text",
2349
+ "primaryKey": true,
2350
+ "notNull": true,
2351
+ "autoincrement": false
2352
+ },
2353
+ "site_id": {
2354
+ "name": "site_id",
2355
+ "type": "text",
2356
+ "primaryKey": false,
2357
+ "notNull": true,
2358
+ "autoincrement": false
2359
+ },
2360
+ "code": {
2361
+ "name": "code",
2362
+ "type": "text",
2363
+ "primaryKey": false,
2364
+ "notNull": true,
2365
+ "autoincrement": false
2366
+ },
2367
+ "created_at": {
2368
+ "name": "created_at",
2369
+ "type": "integer",
2370
+ "primaryKey": false,
2371
+ "notNull": true,
2372
+ "autoincrement": false
2373
+ },
2374
+ "expires_at": {
2375
+ "name": "expires_at",
2376
+ "type": "integer",
2377
+ "primaryKey": false,
2378
+ "notNull": true,
2379
+ "autoincrement": false
2380
+ }
2381
+ },
2382
+ "indexes": {
2383
+ "uq_telegram_pending_binding_site_id": {
2384
+ "name": "uq_telegram_pending_binding_site_id",
2385
+ "columns": ["site_id"],
2386
+ "isUnique": true
2387
+ },
2388
+ "uq_telegram_pending_binding_code": {
2389
+ "name": "uq_telegram_pending_binding_code",
2390
+ "columns": ["code"],
2391
+ "isUnique": true
2392
+ }
2393
+ },
2394
+ "foreignKeys": {
2395
+ "telegram_pending_binding_site_id_site_id_fk": {
2396
+ "name": "telegram_pending_binding_site_id_site_id_fk",
2397
+ "tableFrom": "telegram_pending_binding",
2398
+ "tableTo": "site",
2399
+ "columnsFrom": ["site_id"],
2400
+ "columnsTo": ["id"],
2401
+ "onDelete": "cascade",
2402
+ "onUpdate": "no action"
2403
+ }
2404
+ },
2405
+ "compositePrimaryKeys": {},
2406
+ "uniqueConstraints": {},
2407
+ "checkConstraints": {}
2408
+ },
2409
+ "thread_collection": {
2410
+ "name": "thread_collection",
2411
+ "columns": {
2412
+ "site_id": {
2413
+ "name": "site_id",
2414
+ "type": "text",
2415
+ "primaryKey": false,
2416
+ "notNull": true,
2417
+ "autoincrement": false
2418
+ },
2419
+ "thread_id": {
2420
+ "name": "thread_id",
2421
+ "type": "text",
2422
+ "primaryKey": false,
2423
+ "notNull": true,
2424
+ "autoincrement": false
2425
+ },
2426
+ "collection_id": {
2427
+ "name": "collection_id",
2428
+ "type": "text",
2429
+ "primaryKey": false,
2430
+ "notNull": true,
2431
+ "autoincrement": false
2432
+ },
2433
+ "created_at": {
2434
+ "name": "created_at",
2435
+ "type": "integer",
2436
+ "primaryKey": false,
2437
+ "notNull": true,
2438
+ "autoincrement": false
2439
+ },
2440
+ "position": {
2441
+ "name": "position",
2442
+ "type": "integer",
2443
+ "primaryKey": false,
2444
+ "notNull": true,
2445
+ "autoincrement": false,
2446
+ "default": 0
2447
+ },
2448
+ "pinned_at": {
2449
+ "name": "pinned_at",
2450
+ "type": "integer",
2451
+ "primaryKey": false,
2452
+ "notNull": false,
2453
+ "autoincrement": false
2454
+ }
2455
+ },
2456
+ "indexes": {
2457
+ "idx_thread_collection_site_collection_id": {
2458
+ "name": "idx_thread_collection_site_collection_id",
2459
+ "columns": ["site_id", "collection_id"],
2460
+ "isUnique": false
2461
+ },
2462
+ "idx_thread_collection_site_collection_created_thread": {
2463
+ "name": "idx_thread_collection_site_collection_created_thread",
2464
+ "columns": ["site_id", "collection_id", "created_at", "thread_id"],
2465
+ "isUnique": false
2466
+ }
2467
+ },
2468
+ "foreignKeys": {
2469
+ "thread_collection_site_id_site_id_fk": {
2470
+ "name": "thread_collection_site_id_site_id_fk",
2471
+ "tableFrom": "thread_collection",
2472
+ "tableTo": "site",
2473
+ "columnsFrom": ["site_id"],
2474
+ "columnsTo": ["id"],
2475
+ "onDelete": "cascade",
2476
+ "onUpdate": "no action"
2477
+ },
2478
+ "thread_collection_thread_id_post_id_fk": {
2479
+ "name": "thread_collection_thread_id_post_id_fk",
2480
+ "tableFrom": "thread_collection",
2481
+ "tableTo": "post",
2482
+ "columnsFrom": ["thread_id"],
2483
+ "columnsTo": ["id"],
2484
+ "onDelete": "cascade",
2485
+ "onUpdate": "no action"
2486
+ },
2487
+ "thread_collection_collection_id_collection_id_fk": {
2488
+ "name": "thread_collection_collection_id_collection_id_fk",
2489
+ "tableFrom": "thread_collection",
2490
+ "tableTo": "collection",
2491
+ "columnsFrom": ["collection_id"],
2492
+ "columnsTo": ["id"],
2493
+ "onDelete": "cascade",
2494
+ "onUpdate": "no action"
2495
+ }
2496
+ },
2497
+ "compositePrimaryKeys": {
2498
+ "thread_collection_site_id_thread_id_collection_id_pk": {
2499
+ "columns": ["site_id", "thread_id", "collection_id"],
2500
+ "name": "thread_collection_site_id_thread_id_collection_id_pk"
2501
+ }
2502
+ },
2503
+ "uniqueConstraints": {},
2504
+ "checkConstraints": {}
2505
+ },
2506
+ "upload_session": {
2507
+ "name": "upload_session",
2508
+ "columns": {
2509
+ "id": {
2510
+ "name": "id",
2511
+ "type": "text",
2512
+ "primaryKey": true,
2513
+ "notNull": true,
2514
+ "autoincrement": false
2515
+ },
2516
+ "site_id": {
2517
+ "name": "site_id",
2518
+ "type": "text",
2519
+ "primaryKey": false,
2520
+ "notNull": true,
2521
+ "autoincrement": false
2522
+ },
2523
+ "media_id": {
2524
+ "name": "media_id",
2525
+ "type": "text",
2526
+ "primaryKey": false,
2527
+ "notNull": true,
2528
+ "autoincrement": false
2529
+ },
2530
+ "original_name": {
2531
+ "name": "original_name",
2532
+ "type": "text",
2533
+ "primaryKey": false,
2534
+ "notNull": true,
2535
+ "autoincrement": false
2536
+ },
2537
+ "filename": {
2538
+ "name": "filename",
2539
+ "type": "text",
2540
+ "primaryKey": false,
2541
+ "notNull": true,
2542
+ "autoincrement": false
2543
+ },
2544
+ "provider": {
2545
+ "name": "provider",
2546
+ "type": "text",
2547
+ "primaryKey": false,
2548
+ "notNull": true,
2549
+ "autoincrement": false
2550
+ },
2551
+ "expected_content_type": {
2552
+ "name": "expected_content_type",
2553
+ "type": "text",
2554
+ "primaryKey": false,
2555
+ "notNull": true,
2556
+ "autoincrement": false
2557
+ },
2558
+ "expected_size": {
2559
+ "name": "expected_size",
2560
+ "type": "integer",
2561
+ "primaryKey": false,
2562
+ "notNull": true,
2563
+ "autoincrement": false
2564
+ },
2565
+ "expected_checksum_sha256": {
2566
+ "name": "expected_checksum_sha256",
2567
+ "type": "text",
2568
+ "primaryKey": false,
2569
+ "notNull": false,
2570
+ "autoincrement": false
2571
+ },
2572
+ "content_disposition": {
2573
+ "name": "content_disposition",
2574
+ "type": "text",
2575
+ "primaryKey": false,
2576
+ "notNull": true,
2577
+ "autoincrement": false,
2578
+ "default": "'inline'"
2579
+ },
2580
+ "temp_storage_key": {
2581
+ "name": "temp_storage_key",
2582
+ "type": "text",
2583
+ "primaryKey": false,
2584
+ "notNull": true,
2585
+ "autoincrement": false
2586
+ },
2587
+ "final_storage_key": {
2588
+ "name": "final_storage_key",
2589
+ "type": "text",
2590
+ "primaryKey": false,
2591
+ "notNull": true,
2592
+ "autoincrement": false
2593
+ },
2594
+ "multipart_upload_id": {
2595
+ "name": "multipart_upload_id",
2596
+ "type": "text",
2597
+ "primaryKey": false,
2598
+ "notNull": false,
2599
+ "autoincrement": false
2600
+ },
2601
+ "state": {
2602
+ "name": "state",
2603
+ "type": "text",
2604
+ "primaryKey": false,
2605
+ "notNull": true,
2606
+ "autoincrement": false,
2607
+ "default": "'pending'"
2608
+ },
2609
+ "expires_at": {
2610
+ "name": "expires_at",
2611
+ "type": "integer",
2612
+ "primaryKey": false,
2613
+ "notNull": true,
2614
+ "autoincrement": false
2615
+ },
2616
+ "created_at": {
2617
+ "name": "created_at",
2618
+ "type": "integer",
2619
+ "primaryKey": false,
2620
+ "notNull": true,
2621
+ "autoincrement": false
2622
+ },
2623
+ "updated_at": {
2624
+ "name": "updated_at",
2625
+ "type": "integer",
2626
+ "primaryKey": false,
2627
+ "notNull": true,
2628
+ "autoincrement": false
2629
+ }
2630
+ },
2631
+ "indexes": {
2632
+ "uq_upload_session_media_id": {
2633
+ "name": "uq_upload_session_media_id",
2634
+ "columns": ["media_id"],
2635
+ "isUnique": true
2636
+ },
2637
+ "uq_upload_session_temp_storage_key": {
2638
+ "name": "uq_upload_session_temp_storage_key",
2639
+ "columns": ["temp_storage_key"],
2640
+ "isUnique": true
2641
+ },
2642
+ "uq_upload_session_final_storage_key": {
2643
+ "name": "uq_upload_session_final_storage_key",
2644
+ "columns": ["final_storage_key"],
2645
+ "isUnique": true
2646
+ },
2647
+ "idx_upload_session_site_state": {
2648
+ "name": "idx_upload_session_site_state",
2649
+ "columns": ["site_id", "state"],
2650
+ "isUnique": false
2651
+ },
2652
+ "idx_upload_session_site_expires_at": {
2653
+ "name": "idx_upload_session_site_expires_at",
2654
+ "columns": ["site_id", "expires_at"],
2655
+ "isUnique": false
2656
+ }
2657
+ },
2658
+ "foreignKeys": {
2659
+ "upload_session_site_id_site_id_fk": {
2660
+ "name": "upload_session_site_id_site_id_fk",
2661
+ "tableFrom": "upload_session",
2662
+ "tableTo": "site",
2663
+ "columnsFrom": ["site_id"],
2664
+ "columnsTo": ["id"],
2665
+ "onDelete": "cascade",
2666
+ "onUpdate": "no action"
2667
+ }
2668
+ },
2669
+ "compositePrimaryKeys": {},
2670
+ "uniqueConstraints": {},
2671
+ "checkConstraints": {
2672
+ "chk_upload_session_expected_size_positive": {
2673
+ "name": "chk_upload_session_expected_size_positive",
2674
+ "value": "\"upload_session\".\"expected_size\" > 0"
2675
+ },
2676
+ "chk_upload_session_state": {
2677
+ "name": "chk_upload_session_state",
2678
+ "value": "\"upload_session\".\"state\" IN ('pending', 'uploaded', 'completed', 'aborted', 'failed')"
2679
+ },
2680
+ "chk_upload_session_content_disposition": {
2681
+ "name": "chk_upload_session_content_disposition",
2682
+ "value": "\"upload_session\".\"content_disposition\" IN ('inline', 'attachment')"
2683
+ }
2684
+ }
2685
+ },
2686
+ "user": {
2687
+ "name": "user",
2688
+ "columns": {
2689
+ "id": {
2690
+ "name": "id",
2691
+ "type": "text",
2692
+ "primaryKey": true,
2693
+ "notNull": true,
2694
+ "autoincrement": false
2695
+ },
2696
+ "name": {
2697
+ "name": "name",
2698
+ "type": "text",
2699
+ "primaryKey": false,
2700
+ "notNull": true,
2701
+ "autoincrement": false
2702
+ },
2703
+ "email": {
2704
+ "name": "email",
2705
+ "type": "text",
2706
+ "primaryKey": false,
2707
+ "notNull": true,
2708
+ "autoincrement": false
2709
+ },
2710
+ "email_verified": {
2711
+ "name": "email_verified",
2712
+ "type": "integer",
2713
+ "primaryKey": false,
2714
+ "notNull": true,
2715
+ "autoincrement": false,
2716
+ "default": false
2717
+ },
2718
+ "image": {
2719
+ "name": "image",
2720
+ "type": "text",
2721
+ "primaryKey": false,
2722
+ "notNull": false,
2723
+ "autoincrement": false
2724
+ },
2725
+ "role": {
2726
+ "name": "role",
2727
+ "type": "text",
2728
+ "primaryKey": false,
2729
+ "notNull": false,
2730
+ "autoincrement": false,
2731
+ "default": "'member'"
2732
+ },
2733
+ "created_at": {
2734
+ "name": "created_at",
2735
+ "type": "integer",
2736
+ "primaryKey": false,
2737
+ "notNull": true,
2738
+ "autoincrement": false
2739
+ },
2740
+ "updated_at": {
2741
+ "name": "updated_at",
2742
+ "type": "integer",
2743
+ "primaryKey": false,
2744
+ "notNull": true,
2745
+ "autoincrement": false
2746
+ }
2747
+ },
2748
+ "indexes": {
2749
+ "user_email_unique": {
2750
+ "name": "user_email_unique",
2751
+ "columns": ["email"],
2752
+ "isUnique": true
2753
+ }
2754
+ },
2755
+ "foreignKeys": {},
2756
+ "compositePrimaryKeys": {},
2757
+ "uniqueConstraints": {},
2758
+ "checkConstraints": {}
2759
+ },
2760
+ "verification": {
2761
+ "name": "verification",
2762
+ "columns": {
2763
+ "id": {
2764
+ "name": "id",
2765
+ "type": "text",
2766
+ "primaryKey": true,
2767
+ "notNull": true,
2768
+ "autoincrement": false
2769
+ },
2770
+ "identifier": {
2771
+ "name": "identifier",
2772
+ "type": "text",
2773
+ "primaryKey": false,
2774
+ "notNull": true,
2775
+ "autoincrement": false
2776
+ },
2777
+ "value": {
2778
+ "name": "value",
2779
+ "type": "text",
2780
+ "primaryKey": false,
2781
+ "notNull": true,
2782
+ "autoincrement": false
2783
+ },
2784
+ "expires_at": {
2785
+ "name": "expires_at",
2786
+ "type": "integer",
2787
+ "primaryKey": false,
2788
+ "notNull": true,
2789
+ "autoincrement": false
2790
+ },
2791
+ "created_at": {
2792
+ "name": "created_at",
2793
+ "type": "integer",
2794
+ "primaryKey": false,
2795
+ "notNull": false,
2796
+ "autoincrement": false
2797
+ },
2798
+ "updated_at": {
2799
+ "name": "updated_at",
2800
+ "type": "integer",
2801
+ "primaryKey": false,
2802
+ "notNull": false,
2803
+ "autoincrement": false
2804
+ }
2805
+ },
2806
+ "indexes": {},
2807
+ "foreignKeys": {},
2808
+ "compositePrimaryKeys": {},
2809
+ "uniqueConstraints": {},
2810
+ "checkConstraints": {}
2811
+ },
2812
+ "view_count": {
2813
+ "name": "view_count",
2814
+ "columns": {
2815
+ "site_id": {
2816
+ "name": "site_id",
2817
+ "type": "text",
2818
+ "primaryKey": false,
2819
+ "notNull": true,
2820
+ "autoincrement": false
2821
+ },
2822
+ "day": {
2823
+ "name": "day",
2824
+ "type": "text",
2825
+ "primaryKey": false,
2826
+ "notNull": true,
2827
+ "autoincrement": false
2828
+ },
2829
+ "page": {
2830
+ "name": "page",
2831
+ "type": "text",
2832
+ "primaryKey": false,
2833
+ "notNull": true,
2834
+ "autoincrement": false
2835
+ },
2836
+ "referrer": {
2837
+ "name": "referrer",
2838
+ "type": "text",
2839
+ "primaryKey": false,
2840
+ "notNull": true,
2841
+ "autoincrement": false
2842
+ },
2843
+ "count": {
2844
+ "name": "count",
2845
+ "type": "integer",
2846
+ "primaryKey": false,
2847
+ "notNull": true,
2848
+ "autoincrement": false,
2849
+ "default": 0
2850
+ }
2851
+ },
2852
+ "indexes": {},
2853
+ "foreignKeys": {
2854
+ "view_count_site_id_site_id_fk": {
2855
+ "name": "view_count_site_id_site_id_fk",
2856
+ "tableFrom": "view_count",
2857
+ "tableTo": "site",
2858
+ "columnsFrom": ["site_id"],
2859
+ "columnsTo": ["id"],
2860
+ "onDelete": "cascade",
2861
+ "onUpdate": "no action"
2862
+ }
2863
+ },
2864
+ "compositePrimaryKeys": {
2865
+ "view_count_site_id_day_page_referrer_pk": {
2866
+ "columns": ["site_id", "day", "page", "referrer"],
2867
+ "name": "view_count_site_id_day_page_referrer_pk"
2868
+ }
2869
+ },
2870
+ "uniqueConstraints": {},
2871
+ "checkConstraints": {}
2872
+ },
2873
+ "view_hour": {
2874
+ "name": "view_hour",
2875
+ "columns": {
2876
+ "site_id": {
2877
+ "name": "site_id",
2878
+ "type": "text",
2879
+ "primaryKey": false,
2880
+ "notNull": true,
2881
+ "autoincrement": false
2882
+ },
2883
+ "hour": {
2884
+ "name": "hour",
2885
+ "type": "text",
2886
+ "primaryKey": false,
2887
+ "notNull": true,
2888
+ "autoincrement": false
2889
+ },
2890
+ "count": {
2891
+ "name": "count",
2892
+ "type": "integer",
2893
+ "primaryKey": false,
2894
+ "notNull": true,
2895
+ "autoincrement": false,
2896
+ "default": 0
2897
+ }
2898
+ },
2899
+ "indexes": {},
2900
+ "foreignKeys": {
2901
+ "view_hour_site_id_site_id_fk": {
2902
+ "name": "view_hour_site_id_site_id_fk",
2903
+ "tableFrom": "view_hour",
2904
+ "tableTo": "site",
2905
+ "columnsFrom": ["site_id"],
2906
+ "columnsTo": ["id"],
2907
+ "onDelete": "cascade",
2908
+ "onUpdate": "no action"
2909
+ }
2910
+ },
2911
+ "compositePrimaryKeys": {
2912
+ "view_hour_site_id_hour_pk": {
2913
+ "columns": ["site_id", "hour"],
2914
+ "name": "view_hour_site_id_hour_pk"
2915
+ }
2916
+ },
2917
+ "uniqueConstraints": {},
2918
+ "checkConstraints": {}
2919
+ }
2920
+ },
2921
+ "views": {},
2922
+ "enums": {},
2923
+ "_meta": {
2924
+ "schemas": {},
2925
+ "tables": {},
2926
+ "columns": {}
2927
+ },
2928
+ "internal": {
2929
+ "indexes": {}
2930
+ }
2931
+ }