@jant/core 0.6.14 → 0.6.15

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