@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,2541 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "ee7d9e29-c2de-4a6b-9857-2bb8f834c66b",
5
+ "prevId": "20536b53-d253-4f34-a2bf-ea95dce9a64e",
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
+ "post_id": {
769
+ "name": "post_id",
770
+ "type": "text",
771
+ "primaryKey": false,
772
+ "notNull": false,
773
+ "autoincrement": false
774
+ },
775
+ "label": {
776
+ "name": "label",
777
+ "type": "text",
778
+ "primaryKey": false,
779
+ "notNull": true,
780
+ "autoincrement": false
781
+ },
782
+ "url": {
783
+ "name": "url",
784
+ "type": "text",
785
+ "primaryKey": false,
786
+ "notNull": true,
787
+ "autoincrement": false
788
+ },
789
+ "placement": {
790
+ "name": "placement",
791
+ "type": "text",
792
+ "primaryKey": false,
793
+ "notNull": true,
794
+ "autoincrement": false,
795
+ "default": "'header'"
796
+ },
797
+ "position": {
798
+ "name": "position",
799
+ "type": "text",
800
+ "primaryKey": false,
801
+ "notNull": true,
802
+ "autoincrement": false,
803
+ "default": "'a0'"
804
+ },
805
+ "created_at": {
806
+ "name": "created_at",
807
+ "type": "integer",
808
+ "primaryKey": false,
809
+ "notNull": true,
810
+ "autoincrement": false
811
+ },
812
+ "updated_at": {
813
+ "name": "updated_at",
814
+ "type": "integer",
815
+ "primaryKey": false,
816
+ "notNull": true,
817
+ "autoincrement": false
818
+ }
819
+ },
820
+ "indexes": {
821
+ "uq_nav_item_site_position": {
822
+ "name": "uq_nav_item_site_position",
823
+ "columns": ["site_id", "position"],
824
+ "isUnique": true
825
+ },
826
+ "uq_nav_item_site_system_key": {
827
+ "name": "uq_nav_item_site_system_key",
828
+ "columns": ["site_id", "system_key"],
829
+ "isUnique": true,
830
+ "where": "\"nav_item\".\"system_key\" IS NOT NULL"
831
+ },
832
+ "uq_nav_item_site_collection_id": {
833
+ "name": "uq_nav_item_site_collection_id",
834
+ "columns": ["site_id", "collection_id"],
835
+ "isUnique": true,
836
+ "where": "\"nav_item\".\"collection_id\" IS NOT NULL"
837
+ },
838
+ "uq_nav_item_site_post_id": {
839
+ "name": "uq_nav_item_site_post_id",
840
+ "columns": ["site_id", "post_id"],
841
+ "isUnique": true,
842
+ "where": "\"nav_item\".\"post_id\" IS NOT NULL"
843
+ }
844
+ },
845
+ "foreignKeys": {
846
+ "nav_item_site_id_site_id_fk": {
847
+ "name": "nav_item_site_id_site_id_fk",
848
+ "tableFrom": "nav_item",
849
+ "tableTo": "site",
850
+ "columnsFrom": ["site_id"],
851
+ "columnsTo": ["id"],
852
+ "onDelete": "cascade",
853
+ "onUpdate": "no action"
854
+ },
855
+ "nav_item_collection_id_collection_id_fk": {
856
+ "name": "nav_item_collection_id_collection_id_fk",
857
+ "tableFrom": "nav_item",
858
+ "tableTo": "collection",
859
+ "columnsFrom": ["collection_id"],
860
+ "columnsTo": ["id"],
861
+ "onDelete": "cascade",
862
+ "onUpdate": "no action"
863
+ },
864
+ "nav_item_post_id_post_id_fk": {
865
+ "name": "nav_item_post_id_post_id_fk",
866
+ "tableFrom": "nav_item",
867
+ "tableTo": "post",
868
+ "columnsFrom": ["post_id"],
869
+ "columnsTo": ["id"],
870
+ "onDelete": "cascade",
871
+ "onUpdate": "no action"
872
+ }
873
+ },
874
+ "compositePrimaryKeys": {},
875
+ "uniqueConstraints": {},
876
+ "checkConstraints": {
877
+ "chk_nav_item_type": {
878
+ "name": "chk_nav_item_type",
879
+ "value": "\"nav_item\".\"type\" IN ('link', 'system', 'collection', 'page')"
880
+ },
881
+ "chk_nav_item_placement": {
882
+ "name": "chk_nav_item_placement",
883
+ "value": "\"nav_item\".\"placement\" IN ('header', 'more')"
884
+ },
885
+ "chk_nav_item_shape": {
886
+ "name": "chk_nav_item_shape",
887
+ "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\".\"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\".\"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\".\"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\".\"post_id\" IS NOT NULL\n )"
888
+ }
889
+ }
890
+ },
891
+ "path_registry": {
892
+ "name": "path_registry",
893
+ "columns": {
894
+ "id": {
895
+ "name": "id",
896
+ "type": "text",
897
+ "primaryKey": true,
898
+ "notNull": true,
899
+ "autoincrement": false
900
+ },
901
+ "site_id": {
902
+ "name": "site_id",
903
+ "type": "text",
904
+ "primaryKey": false,
905
+ "notNull": true,
906
+ "autoincrement": false
907
+ },
908
+ "path": {
909
+ "name": "path",
910
+ "type": "text",
911
+ "primaryKey": false,
912
+ "notNull": true,
913
+ "autoincrement": false
914
+ },
915
+ "kind": {
916
+ "name": "kind",
917
+ "type": "text",
918
+ "primaryKey": false,
919
+ "notNull": true,
920
+ "autoincrement": false
921
+ },
922
+ "post_id": {
923
+ "name": "post_id",
924
+ "type": "text",
925
+ "primaryKey": false,
926
+ "notNull": false,
927
+ "autoincrement": false
928
+ },
929
+ "collection_id": {
930
+ "name": "collection_id",
931
+ "type": "text",
932
+ "primaryKey": false,
933
+ "notNull": false,
934
+ "autoincrement": false
935
+ },
936
+ "redirect_to_path": {
937
+ "name": "redirect_to_path",
938
+ "type": "text",
939
+ "primaryKey": false,
940
+ "notNull": false,
941
+ "autoincrement": false
942
+ },
943
+ "redirect_type": {
944
+ "name": "redirect_type",
945
+ "type": "integer",
946
+ "primaryKey": false,
947
+ "notNull": false,
948
+ "autoincrement": false
949
+ },
950
+ "archive_query": {
951
+ "name": "archive_query",
952
+ "type": "text",
953
+ "primaryKey": false,
954
+ "notNull": false,
955
+ "autoincrement": false
956
+ },
957
+ "created_at": {
958
+ "name": "created_at",
959
+ "type": "integer",
960
+ "primaryKey": false,
961
+ "notNull": true,
962
+ "autoincrement": false
963
+ },
964
+ "updated_at": {
965
+ "name": "updated_at",
966
+ "type": "integer",
967
+ "primaryKey": false,
968
+ "notNull": true,
969
+ "autoincrement": false
970
+ }
971
+ },
972
+ "indexes": {
973
+ "uq_path_registry_site_path": {
974
+ "name": "uq_path_registry_site_path",
975
+ "columns": ["site_id", "path"],
976
+ "isUnique": true
977
+ },
978
+ "uq_path_registry_site_post_slug": {
979
+ "name": "uq_path_registry_site_post_slug",
980
+ "columns": ["site_id", "post_id"],
981
+ "isUnique": true,
982
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"post_id\" IS NOT NULL"
983
+ },
984
+ "uq_path_registry_site_collection_slug": {
985
+ "name": "uq_path_registry_site_collection_slug",
986
+ "columns": ["site_id", "collection_id"],
987
+ "isUnique": true,
988
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"collection_id\" IS NOT NULL"
989
+ },
990
+ "idx_path_registry_site_post_id": {
991
+ "name": "idx_path_registry_site_post_id",
992
+ "columns": ["site_id", "post_id"],
993
+ "isUnique": false
994
+ },
995
+ "idx_path_registry_site_collection_id": {
996
+ "name": "idx_path_registry_site_collection_id",
997
+ "columns": ["site_id", "collection_id"],
998
+ "isUnique": false
999
+ }
1000
+ },
1001
+ "foreignKeys": {
1002
+ "path_registry_site_id_site_id_fk": {
1003
+ "name": "path_registry_site_id_site_id_fk",
1004
+ "tableFrom": "path_registry",
1005
+ "tableTo": "site",
1006
+ "columnsFrom": ["site_id"],
1007
+ "columnsTo": ["id"],
1008
+ "onDelete": "cascade",
1009
+ "onUpdate": "no action"
1010
+ },
1011
+ "path_registry_post_id_post_id_fk": {
1012
+ "name": "path_registry_post_id_post_id_fk",
1013
+ "tableFrom": "path_registry",
1014
+ "tableTo": "post",
1015
+ "columnsFrom": ["post_id"],
1016
+ "columnsTo": ["id"],
1017
+ "onDelete": "cascade",
1018
+ "onUpdate": "no action"
1019
+ },
1020
+ "path_registry_collection_id_collection_id_fk": {
1021
+ "name": "path_registry_collection_id_collection_id_fk",
1022
+ "tableFrom": "path_registry",
1023
+ "tableTo": "collection",
1024
+ "columnsFrom": ["collection_id"],
1025
+ "columnsTo": ["id"],
1026
+ "onDelete": "cascade",
1027
+ "onUpdate": "no action"
1028
+ }
1029
+ },
1030
+ "compositePrimaryKeys": {},
1031
+ "uniqueConstraints": {},
1032
+ "checkConstraints": {
1033
+ "chk_path_registry_kind": {
1034
+ "name": "chk_path_registry_kind",
1035
+ "value": "\"path_registry\".\"kind\" IN ('slug', 'alias', 'redirect', 'archive')"
1036
+ },
1037
+ "chk_path_registry_shape": {
1038
+ "name": "chk_path_registry_shape",
1039
+ "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 )"
1040
+ }
1041
+ }
1042
+ },
1043
+ "post": {
1044
+ "name": "post",
1045
+ "columns": {
1046
+ "id": {
1047
+ "name": "id",
1048
+ "type": "text",
1049
+ "primaryKey": true,
1050
+ "notNull": true,
1051
+ "autoincrement": false
1052
+ },
1053
+ "site_id": {
1054
+ "name": "site_id",
1055
+ "type": "text",
1056
+ "primaryKey": false,
1057
+ "notNull": true,
1058
+ "autoincrement": false
1059
+ },
1060
+ "format": {
1061
+ "name": "format",
1062
+ "type": "text",
1063
+ "primaryKey": false,
1064
+ "notNull": true,
1065
+ "autoincrement": false
1066
+ },
1067
+ "status": {
1068
+ "name": "status",
1069
+ "type": "text",
1070
+ "primaryKey": false,
1071
+ "notNull": true,
1072
+ "autoincrement": false,
1073
+ "default": "'published'"
1074
+ },
1075
+ "visibility": {
1076
+ "name": "visibility",
1077
+ "type": "text",
1078
+ "primaryKey": false,
1079
+ "notNull": false,
1080
+ "autoincrement": false,
1081
+ "default": "'public'"
1082
+ },
1083
+ "pinned_at": {
1084
+ "name": "pinned_at",
1085
+ "type": "integer",
1086
+ "primaryKey": false,
1087
+ "notNull": false,
1088
+ "autoincrement": false
1089
+ },
1090
+ "featured_at": {
1091
+ "name": "featured_at",
1092
+ "type": "integer",
1093
+ "primaryKey": false,
1094
+ "notNull": false,
1095
+ "autoincrement": false
1096
+ },
1097
+ "title": {
1098
+ "name": "title",
1099
+ "type": "text",
1100
+ "primaryKey": false,
1101
+ "notNull": false,
1102
+ "autoincrement": false
1103
+ },
1104
+ "url": {
1105
+ "name": "url",
1106
+ "type": "text",
1107
+ "primaryKey": false,
1108
+ "notNull": false,
1109
+ "autoincrement": false
1110
+ },
1111
+ "body": {
1112
+ "name": "body",
1113
+ "type": "text",
1114
+ "primaryKey": false,
1115
+ "notNull": false,
1116
+ "autoincrement": false
1117
+ },
1118
+ "body_html": {
1119
+ "name": "body_html",
1120
+ "type": "text",
1121
+ "primaryKey": false,
1122
+ "notNull": false,
1123
+ "autoincrement": false
1124
+ },
1125
+ "body_html_version": {
1126
+ "name": "body_html_version",
1127
+ "type": "integer",
1128
+ "primaryKey": false,
1129
+ "notNull": true,
1130
+ "autoincrement": false,
1131
+ "default": 1
1132
+ },
1133
+ "body_text": {
1134
+ "name": "body_text",
1135
+ "type": "text",
1136
+ "primaryKey": false,
1137
+ "notNull": false,
1138
+ "autoincrement": false
1139
+ },
1140
+ "quote_text": {
1141
+ "name": "quote_text",
1142
+ "type": "text",
1143
+ "primaryKey": false,
1144
+ "notNull": false,
1145
+ "autoincrement": false
1146
+ },
1147
+ "summary": {
1148
+ "name": "summary",
1149
+ "type": "text",
1150
+ "primaryKey": false,
1151
+ "notNull": false,
1152
+ "autoincrement": false
1153
+ },
1154
+ "rating": {
1155
+ "name": "rating",
1156
+ "type": "integer",
1157
+ "primaryKey": false,
1158
+ "notNull": false,
1159
+ "autoincrement": false
1160
+ },
1161
+ "preview_image_key": {
1162
+ "name": "preview_image_key",
1163
+ "type": "text",
1164
+ "primaryKey": false,
1165
+ "notNull": false,
1166
+ "autoincrement": false
1167
+ },
1168
+ "preview_kind": {
1169
+ "name": "preview_kind",
1170
+ "type": "text",
1171
+ "primaryKey": false,
1172
+ "notNull": false,
1173
+ "autoincrement": false
1174
+ },
1175
+ "preview_provider": {
1176
+ "name": "preview_provider",
1177
+ "type": "text",
1178
+ "primaryKey": false,
1179
+ "notNull": false,
1180
+ "autoincrement": false
1181
+ },
1182
+ "reply_to_id": {
1183
+ "name": "reply_to_id",
1184
+ "type": "text",
1185
+ "primaryKey": false,
1186
+ "notNull": false,
1187
+ "autoincrement": false
1188
+ },
1189
+ "thread_id": {
1190
+ "name": "thread_id",
1191
+ "type": "text",
1192
+ "primaryKey": false,
1193
+ "notNull": true,
1194
+ "autoincrement": false
1195
+ },
1196
+ "published_at": {
1197
+ "name": "published_at",
1198
+ "type": "integer",
1199
+ "primaryKey": false,
1200
+ "notNull": false,
1201
+ "autoincrement": false
1202
+ },
1203
+ "last_activity_at": {
1204
+ "name": "last_activity_at",
1205
+ "type": "integer",
1206
+ "primaryKey": false,
1207
+ "notNull": false,
1208
+ "autoincrement": false
1209
+ },
1210
+ "created_at": {
1211
+ "name": "created_at",
1212
+ "type": "integer",
1213
+ "primaryKey": false,
1214
+ "notNull": true,
1215
+ "autoincrement": false
1216
+ },
1217
+ "updated_at": {
1218
+ "name": "updated_at",
1219
+ "type": "integer",
1220
+ "primaryKey": false,
1221
+ "notNull": true,
1222
+ "autoincrement": false
1223
+ }
1224
+ },
1225
+ "indexes": {
1226
+ "uq_post_site_id_id": {
1227
+ "name": "uq_post_site_id_id",
1228
+ "columns": ["site_id", "id"],
1229
+ "isUnique": true
1230
+ },
1231
+ "idx_post_site_thread_id": {
1232
+ "name": "idx_post_site_thread_id",
1233
+ "columns": ["site_id", "thread_id"],
1234
+ "isUnique": false
1235
+ },
1236
+ "idx_post_site_thread_created": {
1237
+ "name": "idx_post_site_thread_created",
1238
+ "columns": ["site_id", "thread_id", "created_at", "id"],
1239
+ "isUnique": false
1240
+ },
1241
+ "idx_post_site_status_published": {
1242
+ "name": "idx_post_site_status_published",
1243
+ "columns": ["site_id", "status", "published_at"],
1244
+ "isUnique": false
1245
+ },
1246
+ "idx_post_site_status_activity": {
1247
+ "name": "idx_post_site_status_activity",
1248
+ "columns": ["site_id", "status", "last_activity_at"],
1249
+ "isUnique": false
1250
+ },
1251
+ "idx_post_site_root_published_activity": {
1252
+ "name": "idx_post_site_root_published_activity",
1253
+ "columns": ["site_id", "last_activity_at", "id"],
1254
+ "isUnique": false,
1255
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'"
1256
+ },
1257
+ "idx_post_site_root_draft_updated": {
1258
+ "name": "idx_post_site_root_draft_updated",
1259
+ "columns": ["site_id", "updated_at", "id"],
1260
+ "isUnique": false,
1261
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'draft'"
1262
+ },
1263
+ "idx_post_site_reply_thread_created": {
1264
+ "name": "idx_post_site_reply_thread_created",
1265
+ "columns": ["site_id", "thread_id", "created_at", "id"],
1266
+ "isUnique": false,
1267
+ "where": "\"post\".\"reply_to_id\" IS NOT NULL AND \"post\".\"status\" = 'published'"
1268
+ },
1269
+ "idx_post_site_featured_thread_published": {
1270
+ "name": "idx_post_site_featured_thread_published",
1271
+ "columns": ["site_id", "thread_id", "published_at", "id"],
1272
+ "isUnique": false,
1273
+ "where": "\"post\".\"status\" = 'published' AND \"post\".\"featured_at\" IS NOT NULL"
1274
+ }
1275
+ },
1276
+ "foreignKeys": {
1277
+ "post_site_id_site_id_fk": {
1278
+ "name": "post_site_id_site_id_fk",
1279
+ "tableFrom": "post",
1280
+ "tableTo": "site",
1281
+ "columnsFrom": ["site_id"],
1282
+ "columnsTo": ["id"],
1283
+ "onDelete": "cascade",
1284
+ "onUpdate": "no action"
1285
+ },
1286
+ "post_site_id_reply_to_id_post_site_id_id_fk": {
1287
+ "name": "post_site_id_reply_to_id_post_site_id_id_fk",
1288
+ "tableFrom": "post",
1289
+ "tableTo": "post",
1290
+ "columnsFrom": ["site_id", "reply_to_id"],
1291
+ "columnsTo": ["site_id", "id"],
1292
+ "onDelete": "no action",
1293
+ "onUpdate": "no action"
1294
+ },
1295
+ "post_site_id_thread_id_post_site_id_id_fk": {
1296
+ "name": "post_site_id_thread_id_post_site_id_id_fk",
1297
+ "tableFrom": "post",
1298
+ "tableTo": "post",
1299
+ "columnsFrom": ["site_id", "thread_id"],
1300
+ "columnsTo": ["site_id", "id"],
1301
+ "onDelete": "no action",
1302
+ "onUpdate": "no action"
1303
+ }
1304
+ },
1305
+ "compositePrimaryKeys": {},
1306
+ "uniqueConstraints": {},
1307
+ "checkConstraints": {
1308
+ "chk_post_reply_to_not_self": {
1309
+ "name": "chk_post_reply_to_not_self",
1310
+ "value": "\"post\".\"reply_to_id\" IS NULL OR \"post\".\"reply_to_id\" <> \"post\".\"id\""
1311
+ },
1312
+ "chk_post_thread_shape": {
1313
+ "name": "chk_post_thread_shape",
1314
+ "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 )"
1315
+ }
1316
+ }
1317
+ },
1318
+ "rate_limit": {
1319
+ "name": "rate_limit",
1320
+ "columns": {
1321
+ "key": {
1322
+ "name": "key",
1323
+ "type": "text",
1324
+ "primaryKey": false,
1325
+ "notNull": true,
1326
+ "autoincrement": false
1327
+ },
1328
+ "window_start": {
1329
+ "name": "window_start",
1330
+ "type": "integer",
1331
+ "primaryKey": false,
1332
+ "notNull": true,
1333
+ "autoincrement": false
1334
+ },
1335
+ "count": {
1336
+ "name": "count",
1337
+ "type": "integer",
1338
+ "primaryKey": false,
1339
+ "notNull": true,
1340
+ "autoincrement": false,
1341
+ "default": 0
1342
+ }
1343
+ },
1344
+ "indexes": {},
1345
+ "foreignKeys": {},
1346
+ "compositePrimaryKeys": {
1347
+ "rate_limit_key_window_start_pk": {
1348
+ "columns": ["key", "window_start"],
1349
+ "name": "rate_limit_key_window_start_pk"
1350
+ }
1351
+ },
1352
+ "uniqueConstraints": {},
1353
+ "checkConstraints": {}
1354
+ },
1355
+ "session": {
1356
+ "name": "session",
1357
+ "columns": {
1358
+ "id": {
1359
+ "name": "id",
1360
+ "type": "text",
1361
+ "primaryKey": true,
1362
+ "notNull": true,
1363
+ "autoincrement": false
1364
+ },
1365
+ "expires_at": {
1366
+ "name": "expires_at",
1367
+ "type": "integer",
1368
+ "primaryKey": false,
1369
+ "notNull": true,
1370
+ "autoincrement": false
1371
+ },
1372
+ "token": {
1373
+ "name": "token",
1374
+ "type": "text",
1375
+ "primaryKey": false,
1376
+ "notNull": true,
1377
+ "autoincrement": false
1378
+ },
1379
+ "created_at": {
1380
+ "name": "created_at",
1381
+ "type": "integer",
1382
+ "primaryKey": false,
1383
+ "notNull": true,
1384
+ "autoincrement": false
1385
+ },
1386
+ "updated_at": {
1387
+ "name": "updated_at",
1388
+ "type": "integer",
1389
+ "primaryKey": false,
1390
+ "notNull": true,
1391
+ "autoincrement": false
1392
+ },
1393
+ "ip_address": {
1394
+ "name": "ip_address",
1395
+ "type": "text",
1396
+ "primaryKey": false,
1397
+ "notNull": false,
1398
+ "autoincrement": false
1399
+ },
1400
+ "user_agent": {
1401
+ "name": "user_agent",
1402
+ "type": "text",
1403
+ "primaryKey": false,
1404
+ "notNull": false,
1405
+ "autoincrement": false
1406
+ },
1407
+ "user_id": {
1408
+ "name": "user_id",
1409
+ "type": "text",
1410
+ "primaryKey": false,
1411
+ "notNull": true,
1412
+ "autoincrement": false
1413
+ }
1414
+ },
1415
+ "indexes": {
1416
+ "session_token_unique": {
1417
+ "name": "session_token_unique",
1418
+ "columns": ["token"],
1419
+ "isUnique": true
1420
+ },
1421
+ "idx_session_user_id": {
1422
+ "name": "idx_session_user_id",
1423
+ "columns": ["user_id"],
1424
+ "isUnique": false
1425
+ }
1426
+ },
1427
+ "foreignKeys": {
1428
+ "session_user_id_user_id_fk": {
1429
+ "name": "session_user_id_user_id_fk",
1430
+ "tableFrom": "session",
1431
+ "tableTo": "user",
1432
+ "columnsFrom": ["user_id"],
1433
+ "columnsTo": ["id"],
1434
+ "onDelete": "no action",
1435
+ "onUpdate": "no action"
1436
+ }
1437
+ },
1438
+ "compositePrimaryKeys": {},
1439
+ "uniqueConstraints": {},
1440
+ "checkConstraints": {}
1441
+ },
1442
+ "site_setting": {
1443
+ "name": "site_setting",
1444
+ "columns": {
1445
+ "site_id": {
1446
+ "name": "site_id",
1447
+ "type": "text",
1448
+ "primaryKey": false,
1449
+ "notNull": true,
1450
+ "autoincrement": false
1451
+ },
1452
+ "key": {
1453
+ "name": "key",
1454
+ "type": "text",
1455
+ "primaryKey": false,
1456
+ "notNull": true,
1457
+ "autoincrement": false
1458
+ },
1459
+ "value": {
1460
+ "name": "value",
1461
+ "type": "text",
1462
+ "primaryKey": false,
1463
+ "notNull": true,
1464
+ "autoincrement": false
1465
+ },
1466
+ "updated_at": {
1467
+ "name": "updated_at",
1468
+ "type": "integer",
1469
+ "primaryKey": false,
1470
+ "notNull": true,
1471
+ "autoincrement": false
1472
+ }
1473
+ },
1474
+ "indexes": {
1475
+ "idx_site_setting_site_id": {
1476
+ "name": "idx_site_setting_site_id",
1477
+ "columns": ["site_id"],
1478
+ "isUnique": false
1479
+ }
1480
+ },
1481
+ "foreignKeys": {
1482
+ "site_setting_site_id_site_id_fk": {
1483
+ "name": "site_setting_site_id_site_id_fk",
1484
+ "tableFrom": "site_setting",
1485
+ "tableTo": "site",
1486
+ "columnsFrom": ["site_id"],
1487
+ "columnsTo": ["id"],
1488
+ "onDelete": "cascade",
1489
+ "onUpdate": "no action"
1490
+ }
1491
+ },
1492
+ "compositePrimaryKeys": {
1493
+ "site_setting_site_id_key_pk": {
1494
+ "columns": ["site_id", "key"],
1495
+ "name": "site_setting_site_id_key_pk"
1496
+ }
1497
+ },
1498
+ "uniqueConstraints": {},
1499
+ "checkConstraints": {}
1500
+ },
1501
+ "site_domain": {
1502
+ "name": "site_domain",
1503
+ "columns": {
1504
+ "id": {
1505
+ "name": "id",
1506
+ "type": "text",
1507
+ "primaryKey": true,
1508
+ "notNull": true,
1509
+ "autoincrement": false
1510
+ },
1511
+ "site_id": {
1512
+ "name": "site_id",
1513
+ "type": "text",
1514
+ "primaryKey": false,
1515
+ "notNull": true,
1516
+ "autoincrement": false
1517
+ },
1518
+ "host": {
1519
+ "name": "host",
1520
+ "type": "text",
1521
+ "primaryKey": false,
1522
+ "notNull": true,
1523
+ "autoincrement": false
1524
+ },
1525
+ "path_prefix": {
1526
+ "name": "path_prefix",
1527
+ "type": "text",
1528
+ "primaryKey": false,
1529
+ "notNull": false,
1530
+ "autoincrement": false
1531
+ },
1532
+ "kind": {
1533
+ "name": "kind",
1534
+ "type": "text",
1535
+ "primaryKey": false,
1536
+ "notNull": true,
1537
+ "autoincrement": false,
1538
+ "default": "'primary'"
1539
+ },
1540
+ "redirect_to_primary": {
1541
+ "name": "redirect_to_primary",
1542
+ "type": "integer",
1543
+ "primaryKey": false,
1544
+ "notNull": true,
1545
+ "autoincrement": false,
1546
+ "default": true
1547
+ },
1548
+ "created_at": {
1549
+ "name": "created_at",
1550
+ "type": "integer",
1551
+ "primaryKey": false,
1552
+ "notNull": true,
1553
+ "autoincrement": false
1554
+ },
1555
+ "updated_at": {
1556
+ "name": "updated_at",
1557
+ "type": "integer",
1558
+ "primaryKey": false,
1559
+ "notNull": true,
1560
+ "autoincrement": false
1561
+ }
1562
+ },
1563
+ "indexes": {
1564
+ "uq_site_domain_host": {
1565
+ "name": "uq_site_domain_host",
1566
+ "columns": ["host"],
1567
+ "isUnique": true
1568
+ },
1569
+ "idx_site_domain_site_id": {
1570
+ "name": "idx_site_domain_site_id",
1571
+ "columns": ["site_id"],
1572
+ "isUnique": false
1573
+ }
1574
+ },
1575
+ "foreignKeys": {
1576
+ "site_domain_site_id_site_id_fk": {
1577
+ "name": "site_domain_site_id_site_id_fk",
1578
+ "tableFrom": "site_domain",
1579
+ "tableTo": "site",
1580
+ "columnsFrom": ["site_id"],
1581
+ "columnsTo": ["id"],
1582
+ "onDelete": "cascade",
1583
+ "onUpdate": "no action"
1584
+ }
1585
+ },
1586
+ "compositePrimaryKeys": {},
1587
+ "uniqueConstraints": {},
1588
+ "checkConstraints": {
1589
+ "chk_site_domain_kind": {
1590
+ "name": "chk_site_domain_kind",
1591
+ "value": "\"site_domain\".\"kind\" IN ('primary', 'alias')"
1592
+ }
1593
+ }
1594
+ },
1595
+ "site_member": {
1596
+ "name": "site_member",
1597
+ "columns": {
1598
+ "site_id": {
1599
+ "name": "site_id",
1600
+ "type": "text",
1601
+ "primaryKey": false,
1602
+ "notNull": true,
1603
+ "autoincrement": false
1604
+ },
1605
+ "user_id": {
1606
+ "name": "user_id",
1607
+ "type": "text",
1608
+ "primaryKey": false,
1609
+ "notNull": true,
1610
+ "autoincrement": false
1611
+ },
1612
+ "role": {
1613
+ "name": "role",
1614
+ "type": "text",
1615
+ "primaryKey": false,
1616
+ "notNull": true,
1617
+ "autoincrement": false,
1618
+ "default": "'editor'"
1619
+ },
1620
+ "created_at": {
1621
+ "name": "created_at",
1622
+ "type": "integer",
1623
+ "primaryKey": false,
1624
+ "notNull": true,
1625
+ "autoincrement": false
1626
+ },
1627
+ "updated_at": {
1628
+ "name": "updated_at",
1629
+ "type": "integer",
1630
+ "primaryKey": false,
1631
+ "notNull": true,
1632
+ "autoincrement": false
1633
+ }
1634
+ },
1635
+ "indexes": {
1636
+ "idx_site_member_user_id": {
1637
+ "name": "idx_site_member_user_id",
1638
+ "columns": ["user_id"],
1639
+ "isUnique": false
1640
+ }
1641
+ },
1642
+ "foreignKeys": {
1643
+ "site_member_site_id_site_id_fk": {
1644
+ "name": "site_member_site_id_site_id_fk",
1645
+ "tableFrom": "site_member",
1646
+ "tableTo": "site",
1647
+ "columnsFrom": ["site_id"],
1648
+ "columnsTo": ["id"],
1649
+ "onDelete": "cascade",
1650
+ "onUpdate": "no action"
1651
+ }
1652
+ },
1653
+ "compositePrimaryKeys": {
1654
+ "site_member_site_id_user_id_pk": {
1655
+ "columns": ["site_id", "user_id"],
1656
+ "name": "site_member_site_id_user_id_pk"
1657
+ }
1658
+ },
1659
+ "uniqueConstraints": {},
1660
+ "checkConstraints": {
1661
+ "chk_site_member_role": {
1662
+ "name": "chk_site_member_role",
1663
+ "value": "\"site_member\".\"role\" IN ('owner', 'admin', 'editor')"
1664
+ }
1665
+ }
1666
+ },
1667
+ "site": {
1668
+ "name": "site",
1669
+ "columns": {
1670
+ "id": {
1671
+ "name": "id",
1672
+ "type": "text",
1673
+ "primaryKey": true,
1674
+ "notNull": true,
1675
+ "autoincrement": false
1676
+ },
1677
+ "key": {
1678
+ "name": "key",
1679
+ "type": "text",
1680
+ "primaryKey": false,
1681
+ "notNull": true,
1682
+ "autoincrement": false
1683
+ },
1684
+ "status": {
1685
+ "name": "status",
1686
+ "type": "text",
1687
+ "primaryKey": false,
1688
+ "notNull": true,
1689
+ "autoincrement": false,
1690
+ "default": "'active'"
1691
+ },
1692
+ "provisioning_idempotency_key": {
1693
+ "name": "provisioning_idempotency_key",
1694
+ "type": "text",
1695
+ "primaryKey": false,
1696
+ "notNull": false,
1697
+ "autoincrement": false
1698
+ },
1699
+ "created_at": {
1700
+ "name": "created_at",
1701
+ "type": "integer",
1702
+ "primaryKey": false,
1703
+ "notNull": true,
1704
+ "autoincrement": false
1705
+ },
1706
+ "updated_at": {
1707
+ "name": "updated_at",
1708
+ "type": "integer",
1709
+ "primaryKey": false,
1710
+ "notNull": true,
1711
+ "autoincrement": false
1712
+ }
1713
+ },
1714
+ "indexes": {
1715
+ "uq_site_key": {
1716
+ "name": "uq_site_key",
1717
+ "columns": ["key"],
1718
+ "isUnique": true
1719
+ },
1720
+ "uq_site_provisioning_idempotency_key": {
1721
+ "name": "uq_site_provisioning_idempotency_key",
1722
+ "columns": ["provisioning_idempotency_key"],
1723
+ "isUnique": true,
1724
+ "where": "\"site\".\"provisioning_idempotency_key\" IS NOT NULL"
1725
+ }
1726
+ },
1727
+ "foreignKeys": {},
1728
+ "compositePrimaryKeys": {},
1729
+ "uniqueConstraints": {},
1730
+ "checkConstraints": {
1731
+ "chk_site_status": {
1732
+ "name": "chk_site_status",
1733
+ "value": "\"site\".\"status\" IN ('active', 'suspended')"
1734
+ }
1735
+ }
1736
+ },
1737
+ "storage_purge": {
1738
+ "name": "storage_purge",
1739
+ "columns": {
1740
+ "id": {
1741
+ "name": "id",
1742
+ "type": "text",
1743
+ "primaryKey": true,
1744
+ "notNull": true,
1745
+ "autoincrement": false
1746
+ },
1747
+ "site_id": {
1748
+ "name": "site_id",
1749
+ "type": "text",
1750
+ "primaryKey": false,
1751
+ "notNull": true,
1752
+ "autoincrement": false
1753
+ },
1754
+ "provider": {
1755
+ "name": "provider",
1756
+ "type": "text",
1757
+ "primaryKey": false,
1758
+ "notNull": true,
1759
+ "autoincrement": false
1760
+ },
1761
+ "storage_key": {
1762
+ "name": "storage_key",
1763
+ "type": "text",
1764
+ "primaryKey": false,
1765
+ "notNull": true,
1766
+ "autoincrement": false
1767
+ },
1768
+ "original_key": {
1769
+ "name": "original_key",
1770
+ "type": "text",
1771
+ "primaryKey": false,
1772
+ "notNull": true,
1773
+ "autoincrement": false
1774
+ },
1775
+ "reason": {
1776
+ "name": "reason",
1777
+ "type": "text",
1778
+ "primaryKey": false,
1779
+ "notNull": false,
1780
+ "autoincrement": false
1781
+ },
1782
+ "purge_after": {
1783
+ "name": "purge_after",
1784
+ "type": "integer",
1785
+ "primaryKey": false,
1786
+ "notNull": true,
1787
+ "autoincrement": false
1788
+ },
1789
+ "created_at": {
1790
+ "name": "created_at",
1791
+ "type": "integer",
1792
+ "primaryKey": false,
1793
+ "notNull": true,
1794
+ "autoincrement": false
1795
+ }
1796
+ },
1797
+ "indexes": {
1798
+ "uq_storage_purge_provider_key": {
1799
+ "name": "uq_storage_purge_provider_key",
1800
+ "columns": ["provider", "storage_key"],
1801
+ "isUnique": true
1802
+ },
1803
+ "idx_storage_purge_site_provider_due": {
1804
+ "name": "idx_storage_purge_site_provider_due",
1805
+ "columns": ["site_id", "provider", "purge_after"],
1806
+ "isUnique": false
1807
+ }
1808
+ },
1809
+ "foreignKeys": {
1810
+ "storage_purge_site_id_site_id_fk": {
1811
+ "name": "storage_purge_site_id_site_id_fk",
1812
+ "tableFrom": "storage_purge",
1813
+ "tableTo": "site",
1814
+ "columnsFrom": ["site_id"],
1815
+ "columnsTo": ["id"],
1816
+ "onDelete": "cascade",
1817
+ "onUpdate": "no action"
1818
+ }
1819
+ },
1820
+ "compositePrimaryKeys": {},
1821
+ "uniqueConstraints": {},
1822
+ "checkConstraints": {}
1823
+ },
1824
+ "telegram_binding": {
1825
+ "name": "telegram_binding",
1826
+ "columns": {
1827
+ "id": {
1828
+ "name": "id",
1829
+ "type": "text",
1830
+ "primaryKey": true,
1831
+ "notNull": true,
1832
+ "autoincrement": false
1833
+ },
1834
+ "site_id": {
1835
+ "name": "site_id",
1836
+ "type": "text",
1837
+ "primaryKey": false,
1838
+ "notNull": true,
1839
+ "autoincrement": false
1840
+ },
1841
+ "bot_id": {
1842
+ "name": "bot_id",
1843
+ "type": "text",
1844
+ "primaryKey": false,
1845
+ "notNull": true,
1846
+ "autoincrement": false
1847
+ },
1848
+ "telegram_user_id": {
1849
+ "name": "telegram_user_id",
1850
+ "type": "text",
1851
+ "primaryKey": false,
1852
+ "notNull": true,
1853
+ "autoincrement": false
1854
+ },
1855
+ "telegram_username": {
1856
+ "name": "telegram_username",
1857
+ "type": "text",
1858
+ "primaryKey": false,
1859
+ "notNull": false,
1860
+ "autoincrement": false
1861
+ },
1862
+ "last_update_id": {
1863
+ "name": "last_update_id",
1864
+ "type": "integer",
1865
+ "primaryKey": false,
1866
+ "notNull": false,
1867
+ "autoincrement": false
1868
+ },
1869
+ "bound_at": {
1870
+ "name": "bound_at",
1871
+ "type": "integer",
1872
+ "primaryKey": false,
1873
+ "notNull": true,
1874
+ "autoincrement": false
1875
+ }
1876
+ },
1877
+ "indexes": {
1878
+ "uq_telegram_binding_site_id": {
1879
+ "name": "uq_telegram_binding_site_id",
1880
+ "columns": ["site_id"],
1881
+ "isUnique": true
1882
+ },
1883
+ "uq_telegram_binding_bot_user": {
1884
+ "name": "uq_telegram_binding_bot_user",
1885
+ "columns": ["bot_id", "telegram_user_id"],
1886
+ "isUnique": true
1887
+ }
1888
+ },
1889
+ "foreignKeys": {
1890
+ "telegram_binding_site_id_site_id_fk": {
1891
+ "name": "telegram_binding_site_id_site_id_fk",
1892
+ "tableFrom": "telegram_binding",
1893
+ "tableTo": "site",
1894
+ "columnsFrom": ["site_id"],
1895
+ "columnsTo": ["id"],
1896
+ "onDelete": "cascade",
1897
+ "onUpdate": "no action"
1898
+ }
1899
+ },
1900
+ "compositePrimaryKeys": {},
1901
+ "uniqueConstraints": {},
1902
+ "checkConstraints": {}
1903
+ },
1904
+ "telegram_media_group_item": {
1905
+ "name": "telegram_media_group_item",
1906
+ "columns": {
1907
+ "id": {
1908
+ "name": "id",
1909
+ "type": "text",
1910
+ "primaryKey": true,
1911
+ "notNull": true,
1912
+ "autoincrement": false
1913
+ },
1914
+ "site_id": {
1915
+ "name": "site_id",
1916
+ "type": "text",
1917
+ "primaryKey": false,
1918
+ "notNull": true,
1919
+ "autoincrement": false
1920
+ },
1921
+ "bot_id": {
1922
+ "name": "bot_id",
1923
+ "type": "text",
1924
+ "primaryKey": false,
1925
+ "notNull": true,
1926
+ "autoincrement": false
1927
+ },
1928
+ "telegram_user_id": {
1929
+ "name": "telegram_user_id",
1930
+ "type": "text",
1931
+ "primaryKey": false,
1932
+ "notNull": true,
1933
+ "autoincrement": false
1934
+ },
1935
+ "media_group_id": {
1936
+ "name": "media_group_id",
1937
+ "type": "text",
1938
+ "primaryKey": false,
1939
+ "notNull": true,
1940
+ "autoincrement": false
1941
+ },
1942
+ "chat_id": {
1943
+ "name": "chat_id",
1944
+ "type": "integer",
1945
+ "primaryKey": false,
1946
+ "notNull": true,
1947
+ "autoincrement": false
1948
+ },
1949
+ "message_id": {
1950
+ "name": "message_id",
1951
+ "type": "integer",
1952
+ "primaryKey": false,
1953
+ "notNull": true,
1954
+ "autoincrement": false
1955
+ },
1956
+ "update_id": {
1957
+ "name": "update_id",
1958
+ "type": "integer",
1959
+ "primaryKey": false,
1960
+ "notNull": true,
1961
+ "autoincrement": false
1962
+ },
1963
+ "file_id": {
1964
+ "name": "file_id",
1965
+ "type": "text",
1966
+ "primaryKey": false,
1967
+ "notNull": true,
1968
+ "autoincrement": false
1969
+ },
1970
+ "media_kind": {
1971
+ "name": "media_kind",
1972
+ "type": "text",
1973
+ "primaryKey": false,
1974
+ "notNull": true,
1975
+ "autoincrement": false
1976
+ },
1977
+ "mime_type": {
1978
+ "name": "mime_type",
1979
+ "type": "text",
1980
+ "primaryKey": false,
1981
+ "notNull": false,
1982
+ "autoincrement": false
1983
+ },
1984
+ "original_name": {
1985
+ "name": "original_name",
1986
+ "type": "text",
1987
+ "primaryKey": false,
1988
+ "notNull": false,
1989
+ "autoincrement": false
1990
+ },
1991
+ "caption_markdown": {
1992
+ "name": "caption_markdown",
1993
+ "type": "text",
1994
+ "primaryKey": false,
1995
+ "notNull": false,
1996
+ "autoincrement": false
1997
+ },
1998
+ "width": {
1999
+ "name": "width",
2000
+ "type": "integer",
2001
+ "primaryKey": false,
2002
+ "notNull": false,
2003
+ "autoincrement": false
2004
+ },
2005
+ "height": {
2006
+ "name": "height",
2007
+ "type": "integer",
2008
+ "primaryKey": false,
2009
+ "notNull": false,
2010
+ "autoincrement": false
2011
+ },
2012
+ "duration_seconds": {
2013
+ "name": "duration_seconds",
2014
+ "type": "integer",
2015
+ "primaryKey": false,
2016
+ "notNull": false,
2017
+ "autoincrement": false
2018
+ },
2019
+ "poster_file_id": {
2020
+ "name": "poster_file_id",
2021
+ "type": "text",
2022
+ "primaryKey": false,
2023
+ "notNull": false,
2024
+ "autoincrement": false
2025
+ },
2026
+ "created_at": {
2027
+ "name": "created_at",
2028
+ "type": "integer",
2029
+ "primaryKey": false,
2030
+ "notNull": true,
2031
+ "autoincrement": false
2032
+ }
2033
+ },
2034
+ "indexes": {
2035
+ "idx_telegram_media_group_item_group": {
2036
+ "name": "idx_telegram_media_group_item_group",
2037
+ "columns": ["bot_id", "media_group_id"],
2038
+ "isUnique": false
2039
+ },
2040
+ "uq_telegram_media_group_item_message": {
2041
+ "name": "uq_telegram_media_group_item_message",
2042
+ "columns": ["bot_id", "media_group_id", "message_id"],
2043
+ "isUnique": true
2044
+ }
2045
+ },
2046
+ "foreignKeys": {
2047
+ "telegram_media_group_item_site_id_site_id_fk": {
2048
+ "name": "telegram_media_group_item_site_id_site_id_fk",
2049
+ "tableFrom": "telegram_media_group_item",
2050
+ "tableTo": "site",
2051
+ "columnsFrom": ["site_id"],
2052
+ "columnsTo": ["id"],
2053
+ "onDelete": "cascade",
2054
+ "onUpdate": "no action"
2055
+ }
2056
+ },
2057
+ "compositePrimaryKeys": {},
2058
+ "uniqueConstraints": {},
2059
+ "checkConstraints": {}
2060
+ },
2061
+ "telegram_pending_binding": {
2062
+ "name": "telegram_pending_binding",
2063
+ "columns": {
2064
+ "id": {
2065
+ "name": "id",
2066
+ "type": "text",
2067
+ "primaryKey": true,
2068
+ "notNull": true,
2069
+ "autoincrement": false
2070
+ },
2071
+ "site_id": {
2072
+ "name": "site_id",
2073
+ "type": "text",
2074
+ "primaryKey": false,
2075
+ "notNull": true,
2076
+ "autoincrement": false
2077
+ },
2078
+ "code": {
2079
+ "name": "code",
2080
+ "type": "text",
2081
+ "primaryKey": false,
2082
+ "notNull": true,
2083
+ "autoincrement": false
2084
+ },
2085
+ "created_at": {
2086
+ "name": "created_at",
2087
+ "type": "integer",
2088
+ "primaryKey": false,
2089
+ "notNull": true,
2090
+ "autoincrement": false
2091
+ },
2092
+ "expires_at": {
2093
+ "name": "expires_at",
2094
+ "type": "integer",
2095
+ "primaryKey": false,
2096
+ "notNull": true,
2097
+ "autoincrement": false
2098
+ }
2099
+ },
2100
+ "indexes": {
2101
+ "uq_telegram_pending_binding_site_id": {
2102
+ "name": "uq_telegram_pending_binding_site_id",
2103
+ "columns": ["site_id"],
2104
+ "isUnique": true
2105
+ },
2106
+ "uq_telegram_pending_binding_code": {
2107
+ "name": "uq_telegram_pending_binding_code",
2108
+ "columns": ["code"],
2109
+ "isUnique": true
2110
+ }
2111
+ },
2112
+ "foreignKeys": {
2113
+ "telegram_pending_binding_site_id_site_id_fk": {
2114
+ "name": "telegram_pending_binding_site_id_site_id_fk",
2115
+ "tableFrom": "telegram_pending_binding",
2116
+ "tableTo": "site",
2117
+ "columnsFrom": ["site_id"],
2118
+ "columnsTo": ["id"],
2119
+ "onDelete": "cascade",
2120
+ "onUpdate": "no action"
2121
+ }
2122
+ },
2123
+ "compositePrimaryKeys": {},
2124
+ "uniqueConstraints": {},
2125
+ "checkConstraints": {}
2126
+ },
2127
+ "thread_collection": {
2128
+ "name": "thread_collection",
2129
+ "columns": {
2130
+ "site_id": {
2131
+ "name": "site_id",
2132
+ "type": "text",
2133
+ "primaryKey": false,
2134
+ "notNull": true,
2135
+ "autoincrement": false
2136
+ },
2137
+ "thread_id": {
2138
+ "name": "thread_id",
2139
+ "type": "text",
2140
+ "primaryKey": false,
2141
+ "notNull": true,
2142
+ "autoincrement": false
2143
+ },
2144
+ "collection_id": {
2145
+ "name": "collection_id",
2146
+ "type": "text",
2147
+ "primaryKey": false,
2148
+ "notNull": true,
2149
+ "autoincrement": false
2150
+ },
2151
+ "created_at": {
2152
+ "name": "created_at",
2153
+ "type": "integer",
2154
+ "primaryKey": false,
2155
+ "notNull": true,
2156
+ "autoincrement": false
2157
+ },
2158
+ "position": {
2159
+ "name": "position",
2160
+ "type": "integer",
2161
+ "primaryKey": false,
2162
+ "notNull": true,
2163
+ "autoincrement": false,
2164
+ "default": 0
2165
+ },
2166
+ "pinned_at": {
2167
+ "name": "pinned_at",
2168
+ "type": "integer",
2169
+ "primaryKey": false,
2170
+ "notNull": false,
2171
+ "autoincrement": false
2172
+ }
2173
+ },
2174
+ "indexes": {
2175
+ "idx_thread_collection_site_collection_id": {
2176
+ "name": "idx_thread_collection_site_collection_id",
2177
+ "columns": ["site_id", "collection_id"],
2178
+ "isUnique": false
2179
+ },
2180
+ "idx_thread_collection_site_collection_created_thread": {
2181
+ "name": "idx_thread_collection_site_collection_created_thread",
2182
+ "columns": ["site_id", "collection_id", "created_at", "thread_id"],
2183
+ "isUnique": false
2184
+ }
2185
+ },
2186
+ "foreignKeys": {
2187
+ "thread_collection_site_id_site_id_fk": {
2188
+ "name": "thread_collection_site_id_site_id_fk",
2189
+ "tableFrom": "thread_collection",
2190
+ "tableTo": "site",
2191
+ "columnsFrom": ["site_id"],
2192
+ "columnsTo": ["id"],
2193
+ "onDelete": "cascade",
2194
+ "onUpdate": "no action"
2195
+ },
2196
+ "thread_collection_thread_id_post_id_fk": {
2197
+ "name": "thread_collection_thread_id_post_id_fk",
2198
+ "tableFrom": "thread_collection",
2199
+ "tableTo": "post",
2200
+ "columnsFrom": ["thread_id"],
2201
+ "columnsTo": ["id"],
2202
+ "onDelete": "cascade",
2203
+ "onUpdate": "no action"
2204
+ },
2205
+ "thread_collection_collection_id_collection_id_fk": {
2206
+ "name": "thread_collection_collection_id_collection_id_fk",
2207
+ "tableFrom": "thread_collection",
2208
+ "tableTo": "collection",
2209
+ "columnsFrom": ["collection_id"],
2210
+ "columnsTo": ["id"],
2211
+ "onDelete": "cascade",
2212
+ "onUpdate": "no action"
2213
+ }
2214
+ },
2215
+ "compositePrimaryKeys": {
2216
+ "thread_collection_site_id_thread_id_collection_id_pk": {
2217
+ "columns": ["site_id", "thread_id", "collection_id"],
2218
+ "name": "thread_collection_site_id_thread_id_collection_id_pk"
2219
+ }
2220
+ },
2221
+ "uniqueConstraints": {},
2222
+ "checkConstraints": {}
2223
+ },
2224
+ "upload_session": {
2225
+ "name": "upload_session",
2226
+ "columns": {
2227
+ "id": {
2228
+ "name": "id",
2229
+ "type": "text",
2230
+ "primaryKey": true,
2231
+ "notNull": true,
2232
+ "autoincrement": false
2233
+ },
2234
+ "site_id": {
2235
+ "name": "site_id",
2236
+ "type": "text",
2237
+ "primaryKey": false,
2238
+ "notNull": true,
2239
+ "autoincrement": false
2240
+ },
2241
+ "media_id": {
2242
+ "name": "media_id",
2243
+ "type": "text",
2244
+ "primaryKey": false,
2245
+ "notNull": true,
2246
+ "autoincrement": false
2247
+ },
2248
+ "original_name": {
2249
+ "name": "original_name",
2250
+ "type": "text",
2251
+ "primaryKey": false,
2252
+ "notNull": true,
2253
+ "autoincrement": false
2254
+ },
2255
+ "filename": {
2256
+ "name": "filename",
2257
+ "type": "text",
2258
+ "primaryKey": false,
2259
+ "notNull": true,
2260
+ "autoincrement": false
2261
+ },
2262
+ "provider": {
2263
+ "name": "provider",
2264
+ "type": "text",
2265
+ "primaryKey": false,
2266
+ "notNull": true,
2267
+ "autoincrement": false
2268
+ },
2269
+ "expected_content_type": {
2270
+ "name": "expected_content_type",
2271
+ "type": "text",
2272
+ "primaryKey": false,
2273
+ "notNull": true,
2274
+ "autoincrement": false
2275
+ },
2276
+ "expected_size": {
2277
+ "name": "expected_size",
2278
+ "type": "integer",
2279
+ "primaryKey": false,
2280
+ "notNull": true,
2281
+ "autoincrement": false
2282
+ },
2283
+ "expected_checksum_sha256": {
2284
+ "name": "expected_checksum_sha256",
2285
+ "type": "text",
2286
+ "primaryKey": false,
2287
+ "notNull": false,
2288
+ "autoincrement": false
2289
+ },
2290
+ "content_disposition": {
2291
+ "name": "content_disposition",
2292
+ "type": "text",
2293
+ "primaryKey": false,
2294
+ "notNull": true,
2295
+ "autoincrement": false,
2296
+ "default": "'inline'"
2297
+ },
2298
+ "temp_storage_key": {
2299
+ "name": "temp_storage_key",
2300
+ "type": "text",
2301
+ "primaryKey": false,
2302
+ "notNull": true,
2303
+ "autoincrement": false
2304
+ },
2305
+ "final_storage_key": {
2306
+ "name": "final_storage_key",
2307
+ "type": "text",
2308
+ "primaryKey": false,
2309
+ "notNull": true,
2310
+ "autoincrement": false
2311
+ },
2312
+ "multipart_upload_id": {
2313
+ "name": "multipart_upload_id",
2314
+ "type": "text",
2315
+ "primaryKey": false,
2316
+ "notNull": false,
2317
+ "autoincrement": false
2318
+ },
2319
+ "state": {
2320
+ "name": "state",
2321
+ "type": "text",
2322
+ "primaryKey": false,
2323
+ "notNull": true,
2324
+ "autoincrement": false,
2325
+ "default": "'pending'"
2326
+ },
2327
+ "expires_at": {
2328
+ "name": "expires_at",
2329
+ "type": "integer",
2330
+ "primaryKey": false,
2331
+ "notNull": true,
2332
+ "autoincrement": false
2333
+ },
2334
+ "created_at": {
2335
+ "name": "created_at",
2336
+ "type": "integer",
2337
+ "primaryKey": false,
2338
+ "notNull": true,
2339
+ "autoincrement": false
2340
+ },
2341
+ "updated_at": {
2342
+ "name": "updated_at",
2343
+ "type": "integer",
2344
+ "primaryKey": false,
2345
+ "notNull": true,
2346
+ "autoincrement": false
2347
+ }
2348
+ },
2349
+ "indexes": {
2350
+ "uq_upload_session_media_id": {
2351
+ "name": "uq_upload_session_media_id",
2352
+ "columns": ["media_id"],
2353
+ "isUnique": true
2354
+ },
2355
+ "uq_upload_session_temp_storage_key": {
2356
+ "name": "uq_upload_session_temp_storage_key",
2357
+ "columns": ["temp_storage_key"],
2358
+ "isUnique": true
2359
+ },
2360
+ "uq_upload_session_final_storage_key": {
2361
+ "name": "uq_upload_session_final_storage_key",
2362
+ "columns": ["final_storage_key"],
2363
+ "isUnique": true
2364
+ },
2365
+ "idx_upload_session_site_state": {
2366
+ "name": "idx_upload_session_site_state",
2367
+ "columns": ["site_id", "state"],
2368
+ "isUnique": false
2369
+ },
2370
+ "idx_upload_session_site_expires_at": {
2371
+ "name": "idx_upload_session_site_expires_at",
2372
+ "columns": ["site_id", "expires_at"],
2373
+ "isUnique": false
2374
+ }
2375
+ },
2376
+ "foreignKeys": {
2377
+ "upload_session_site_id_site_id_fk": {
2378
+ "name": "upload_session_site_id_site_id_fk",
2379
+ "tableFrom": "upload_session",
2380
+ "tableTo": "site",
2381
+ "columnsFrom": ["site_id"],
2382
+ "columnsTo": ["id"],
2383
+ "onDelete": "cascade",
2384
+ "onUpdate": "no action"
2385
+ }
2386
+ },
2387
+ "compositePrimaryKeys": {},
2388
+ "uniqueConstraints": {},
2389
+ "checkConstraints": {
2390
+ "chk_upload_session_expected_size_positive": {
2391
+ "name": "chk_upload_session_expected_size_positive",
2392
+ "value": "\"upload_session\".\"expected_size\" > 0"
2393
+ },
2394
+ "chk_upload_session_state": {
2395
+ "name": "chk_upload_session_state",
2396
+ "value": "\"upload_session\".\"state\" IN ('pending', 'uploaded', 'completed', 'aborted', 'failed')"
2397
+ },
2398
+ "chk_upload_session_content_disposition": {
2399
+ "name": "chk_upload_session_content_disposition",
2400
+ "value": "\"upload_session\".\"content_disposition\" IN ('inline', 'attachment')"
2401
+ }
2402
+ }
2403
+ },
2404
+ "user": {
2405
+ "name": "user",
2406
+ "columns": {
2407
+ "id": {
2408
+ "name": "id",
2409
+ "type": "text",
2410
+ "primaryKey": true,
2411
+ "notNull": true,
2412
+ "autoincrement": false
2413
+ },
2414
+ "name": {
2415
+ "name": "name",
2416
+ "type": "text",
2417
+ "primaryKey": false,
2418
+ "notNull": true,
2419
+ "autoincrement": false
2420
+ },
2421
+ "email": {
2422
+ "name": "email",
2423
+ "type": "text",
2424
+ "primaryKey": false,
2425
+ "notNull": true,
2426
+ "autoincrement": false
2427
+ },
2428
+ "email_verified": {
2429
+ "name": "email_verified",
2430
+ "type": "integer",
2431
+ "primaryKey": false,
2432
+ "notNull": true,
2433
+ "autoincrement": false,
2434
+ "default": false
2435
+ },
2436
+ "image": {
2437
+ "name": "image",
2438
+ "type": "text",
2439
+ "primaryKey": false,
2440
+ "notNull": false,
2441
+ "autoincrement": false
2442
+ },
2443
+ "role": {
2444
+ "name": "role",
2445
+ "type": "text",
2446
+ "primaryKey": false,
2447
+ "notNull": false,
2448
+ "autoincrement": false,
2449
+ "default": "'member'"
2450
+ },
2451
+ "created_at": {
2452
+ "name": "created_at",
2453
+ "type": "integer",
2454
+ "primaryKey": false,
2455
+ "notNull": true,
2456
+ "autoincrement": false
2457
+ },
2458
+ "updated_at": {
2459
+ "name": "updated_at",
2460
+ "type": "integer",
2461
+ "primaryKey": false,
2462
+ "notNull": true,
2463
+ "autoincrement": false
2464
+ }
2465
+ },
2466
+ "indexes": {
2467
+ "user_email_unique": {
2468
+ "name": "user_email_unique",
2469
+ "columns": ["email"],
2470
+ "isUnique": true
2471
+ }
2472
+ },
2473
+ "foreignKeys": {},
2474
+ "compositePrimaryKeys": {},
2475
+ "uniqueConstraints": {},
2476
+ "checkConstraints": {}
2477
+ },
2478
+ "verification": {
2479
+ "name": "verification",
2480
+ "columns": {
2481
+ "id": {
2482
+ "name": "id",
2483
+ "type": "text",
2484
+ "primaryKey": true,
2485
+ "notNull": true,
2486
+ "autoincrement": false
2487
+ },
2488
+ "identifier": {
2489
+ "name": "identifier",
2490
+ "type": "text",
2491
+ "primaryKey": false,
2492
+ "notNull": true,
2493
+ "autoincrement": false
2494
+ },
2495
+ "value": {
2496
+ "name": "value",
2497
+ "type": "text",
2498
+ "primaryKey": false,
2499
+ "notNull": true,
2500
+ "autoincrement": false
2501
+ },
2502
+ "expires_at": {
2503
+ "name": "expires_at",
2504
+ "type": "integer",
2505
+ "primaryKey": false,
2506
+ "notNull": true,
2507
+ "autoincrement": false
2508
+ },
2509
+ "created_at": {
2510
+ "name": "created_at",
2511
+ "type": "integer",
2512
+ "primaryKey": false,
2513
+ "notNull": false,
2514
+ "autoincrement": false
2515
+ },
2516
+ "updated_at": {
2517
+ "name": "updated_at",
2518
+ "type": "integer",
2519
+ "primaryKey": false,
2520
+ "notNull": false,
2521
+ "autoincrement": false
2522
+ }
2523
+ },
2524
+ "indexes": {},
2525
+ "foreignKeys": {},
2526
+ "compositePrimaryKeys": {},
2527
+ "uniqueConstraints": {},
2528
+ "checkConstraints": {}
2529
+ }
2530
+ },
2531
+ "views": {},
2532
+ "enums": {},
2533
+ "_meta": {
2534
+ "schemas": {},
2535
+ "tables": {},
2536
+ "columns": {}
2537
+ },
2538
+ "internal": {
2539
+ "indexes": {}
2540
+ }
2541
+ }