@jant/core 0.6.16 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (508) hide show
  1. package/README.md +11 -11
  2. package/bin/commands/assets/upload.js +192 -15
  3. package/bin/commands/import-site.js +60 -4
  4. package/bin/commands/reset-password.js +21 -8
  5. package/bin/commands/site/snapshot/export.js +1 -1
  6. package/bin/commands/site/snapshot/import.js +1 -1
  7. package/bin/lib/d1-query.js +5 -16
  8. package/bin/lib/node-env.js +40 -4
  9. package/bin/lib/site-selection.js +85 -29
  10. package/bin/lib/wrangler-cli.js +28 -2
  11. package/bin/lib/wrangler-json.js +35 -0
  12. package/dist/{app-C7_4oab9.js → app-K_Aa1MMn.js} +52476 -13330
  13. package/dist/client/.vite/manifest.json +255 -90
  14. package/dist/client/_assets/chunks/confirm-D7GrwsCN.js +45 -0
  15. package/dist/client/_assets/chunks/create-editor-CD3FhrOB.js +257 -0
  16. package/dist/client/_assets/chunks/{native-DpcrFAPh.js → emoji-mart-C4RpRKcU.js} +716 -1
  17. package/dist/client/_assets/chunks/footnote-rail-CmeoVtnU.js +1 -0
  18. package/dist/client/_assets/chunks/heic-to-CuP2Qlsw.js +1 -0
  19. package/dist/client/_assets/chunks/jant-locale-picker-DL6mIOT5.js +69 -0
  20. package/dist/client/_assets/chunks/lit-DW8VmJAT.js +2 -0
  21. package/dist/client/_assets/chunks/mediabunny-DRaCQ1r-.js +31 -0
  22. package/dist/client/_assets/chunks/rolldown-runtime-hePW80VL.js +1 -0
  23. package/dist/client/_assets/chunks/settings-paths-BcdySNx6.js +84 -0
  24. package/dist/client/_assets/chunks/site-header-nav-DzXsFk05.js +1 -0
  25. package/dist/client/_assets/chunks/slug-format-CRXO1AL5.js +1 -0
  26. package/dist/client/_assets/chunks/slugify-373citbs.js +1 -0
  27. package/dist/client/_assets/chunks/sortable-list-CgaL2jCs.js +2 -0
  28. package/dist/client/_assets/chunks/types-D5iF3H1a.js +1 -0
  29. package/dist/client/_assets/chunks/unsafe-html-B5ZEXaxg.js +1 -0
  30. package/dist/client/_assets/chunks/unsafe-svg-0QCkP0vZ.js +2 -0
  31. package/dist/client/_assets/client-GiYENVw8.css +2 -0
  32. package/dist/client/_assets/client-VnFxJN7G.js +295 -0
  33. package/dist/client/_assets/client-auth-k8gJ6QJj.js +828 -0
  34. package/dist/client/_assets/client-author-DQ8R-8KR.css +2 -0
  35. package/dist/client/_assets/client-compose-B_kDtWkW.js +2004 -0
  36. package/dist/client/_assets/client-manage-M90aSTOk.js +2170 -0
  37. package/dist/client/_assets/client-settings-DfYs9n1F.js +1112 -0
  38. package/dist/{export-Dl5KCiEs.js → github-sync-BPAvT999.js} +2254 -107
  39. package/dist/index.js +2 -5
  40. package/dist/node.js +5 -7
  41. package/package.json +3 -3
  42. package/src/__tests__/auth-session-freshness.test.ts +57 -0
  43. package/src/__tests__/basecoat-variants.test.ts +121 -0
  44. package/src/__tests__/bin/assets-upload.test.ts +68 -0
  45. package/src/__tests__/export-hugo-build.test.ts +260 -0
  46. package/src/__tests__/export-service.test.ts +231 -0
  47. package/src/__tests__/helpers/component-css.ts +91 -0
  48. package/src/__tests__/helpers/db.ts +33 -0
  49. package/src/__tests__/helpers/export-fixtures.ts +3 -0
  50. package/src/__tests__/stylesheet-audience.test.ts +159 -0
  51. package/src/__tests__/stylesheet-breakpoints.test.ts +183 -0
  52. package/src/app.tsx +71 -16
  53. package/src/auth.ts +18 -1
  54. package/src/client/__tests__/collection-page-actions.test.ts +51 -2
  55. package/src/client/__tests__/compose-bridge-image-upload.test.ts +196 -0
  56. package/src/client/__tests__/compose-bridge-video-poster.test.ts +159 -0
  57. package/src/client/__tests__/compose-bridge.test.ts +272 -0
  58. package/src/client/__tests__/compose-launch.test.ts +62 -1
  59. package/src/client/__tests__/compose-shortcuts.test.ts +38 -9
  60. package/src/client/__tests__/compose-triggers.test.ts +90 -0
  61. package/src/client/__tests__/copy-field.test.ts +162 -0
  62. package/src/client/__tests__/custom-url-menu.test.ts +127 -6
  63. package/src/client/__tests__/image-processor.test.ts +324 -2
  64. package/src/client/__tests__/lazy-entries.test.ts +92 -0
  65. package/src/client/__tests__/media-scroll-hint.test.ts +155 -0
  66. package/src/client/__tests__/runtime-paths.test.ts +84 -0
  67. package/src/client/__tests__/smart-collection-page-actions.test.ts +158 -0
  68. package/src/client/__tests__/toast.test.ts +23 -0
  69. package/src/client/__tests__/video-processor-probe.test.ts +175 -0
  70. package/src/client/__tests__/video-processor.test.ts +181 -0
  71. package/src/client/audio-processor.ts +24 -15
  72. package/src/client/audio-waveform.ts +49 -0
  73. package/src/client/collection-dialog-host.ts +72 -0
  74. package/src/client/collection-navigation.ts +51 -16
  75. package/src/client/collection-page-actions.ts +26 -0
  76. package/src/client/components/__tests__/jant-collection-dialog.test.ts +329 -0
  77. package/src/client/components/__tests__/jant-collection-directory.test.ts +274 -10
  78. package/src/client/components/__tests__/jant-collection-form.test.ts +59 -178
  79. package/src/client/components/__tests__/jant-command-palette.test.ts +28 -0
  80. package/src/client/components/__tests__/jant-compose-dialog-draft-storage.test.ts +340 -0
  81. package/src/client/components/__tests__/jant-compose-dialog.test.ts +1250 -53
  82. package/src/client/components/__tests__/jant-compose-editor.test.ts +544 -40
  83. package/src/client/components/__tests__/jant-compose-fullscreen.test.ts +0 -1
  84. package/src/client/components/__tests__/jant-locale-picker.test.ts +207 -0
  85. package/src/client/components/__tests__/jant-nav-manager.test.ts +234 -15
  86. package/src/client/components/__tests__/jant-post-menu.test.ts +413 -2
  87. package/src/client/components/__tests__/jant-post-picker.test.ts +197 -0
  88. package/src/client/components/__tests__/jant-settings-avatar.test.ts +15 -12
  89. package/src/client/components/__tests__/jant-settings-general.test.ts +541 -172
  90. package/src/client/components/__tests__/jant-settings-language.test.ts +851 -0
  91. package/src/client/components/__tests__/jant-smart-collection-dialog.test.ts +665 -0
  92. package/src/client/components/collection-dialog-types.ts +49 -0
  93. package/src/client/components/collection-manager-types.ts +32 -1
  94. package/src/client/components/collection-types.ts +1 -15
  95. package/src/client/components/compose-types.ts +75 -1
  96. package/src/client/components/jant-collection-dialog.ts +722 -0
  97. package/src/client/components/jant-collection-directory.ts +567 -182
  98. package/src/client/components/jant-collection-form.ts +53 -232
  99. package/src/client/components/jant-command-palette.ts +100 -49
  100. package/src/client/components/jant-compose-dialog.ts +1486 -707
  101. package/src/client/components/jant-compose-editor.ts +673 -336
  102. package/src/client/components/jant-compose-fullscreen.ts +51 -43
  103. package/src/client/components/jant-config-editor.ts +65 -53
  104. package/src/client/components/jant-confirm-dialog.ts +13 -11
  105. package/src/client/components/jant-locale-picker.ts +418 -0
  106. package/src/client/components/jant-media-lightbox.ts +146 -136
  107. package/src/client/components/jant-nav-manager.ts +690 -366
  108. package/src/client/components/jant-post-menu.ts +1086 -282
  109. package/src/client/components/jant-post-picker.ts +324 -0
  110. package/src/client/components/jant-repo-picker.ts +138 -106
  111. package/src/client/components/jant-settings-avatar.ts +31 -27
  112. package/src/client/components/jant-settings-general.ts +617 -543
  113. package/src/client/components/jant-settings-language.ts +1087 -0
  114. package/src/client/components/jant-smart-collection-dialog.ts +1021 -0
  115. package/src/client/components/jant-text-preview.ts +94 -86
  116. package/src/client/components/nav-manager-types.ts +62 -1
  117. package/src/client/components/settings-types.ts +14 -29
  118. package/src/client/components/smart-collection-conditions.ts +285 -0
  119. package/src/client/components/smart-collection-dialog-types.ts +68 -0
  120. package/src/client/compose-bridge.ts +214 -141
  121. package/src/client/compose-launch.ts +76 -2
  122. package/src/client/compose-shortcuts.ts +6 -8
  123. package/src/client/compose-triggers.ts +50 -0
  124. package/src/client/copy-field.ts +108 -0
  125. package/src/client/custom-url-menu.ts +60 -4
  126. package/src/client/icons.ts +14 -0
  127. package/src/client/image-plan.ts +165 -0
  128. package/src/client/image-processor.ts +195 -117
  129. package/src/client/image-worker-client.ts +45 -0
  130. package/src/client/image-worker.ts +135 -0
  131. package/src/client/lazy-entries.ts +95 -0
  132. package/src/client/lazy-slugify.ts +2 -2
  133. package/src/client/media-scroll-hint.ts +43 -2
  134. package/src/client/mediabunny.ts +29 -0
  135. package/src/client/post-picker.ts +41 -0
  136. package/src/client/runtime-paths.ts +74 -1
  137. package/src/client/settings-bridge.ts +4 -10
  138. package/src/client/site-header-nav.js +18 -6
  139. package/src/client/smart-collection-dialog-host.ts +116 -0
  140. package/src/client/smart-collection-page-actions.ts +208 -0
  141. package/src/client/tiptap/__tests__/bubble-menu.test.ts +110 -0
  142. package/src/client/tiptap/__tests__/floating-position.test.ts +136 -1
  143. package/src/client/tiptap/__tests__/inline-image-upload.test.ts +37 -0
  144. package/src/client/tiptap/bubble-menu.ts +47 -16
  145. package/src/client/tiptap/floating-position.ts +216 -2
  146. package/src/client/tiptap/inline-image-upload.ts +7 -3
  147. package/src/client/tiptap/link-toolbar.ts +22 -9
  148. package/src/client/toast.ts +13 -0
  149. package/src/client/types/vite-worker.d.ts +12 -0
  150. package/src/client/upload-with-metadata.ts +3 -13
  151. package/src/client/video-processor.ts +351 -107
  152. package/src/client-auth.ts +14 -31
  153. package/src/client-compose.ts +19 -0
  154. package/src/client-manage.ts +13 -0
  155. package/src/client-settings.ts +14 -0
  156. package/src/client-site.ts +10 -3
  157. package/src/client.ts +4 -0
  158. package/src/db/__tests__/backfill-nav-label-mirrors.test.ts +149 -0
  159. package/src/db/__tests__/schema-enum-sources.test.ts +33 -0
  160. package/src/db/__tests__/smart-collection-placement.test.ts +402 -0
  161. package/src/db/backfills/0006_clear_mirrored_page_nav_labels.sql +31 -0
  162. package/src/db/migrations/0032_married_tomas.sql +3 -0
  163. package/src/db/migrations/0033_busy_johnny_storm.sql +198 -0
  164. package/src/db/migrations/0034_cheerful_rumiko_fujikawa.sql +35 -0
  165. package/src/db/migrations/meta/0032_snapshot.json +2582 -0
  166. package/src/db/migrations/meta/0033_snapshot.json +2816 -0
  167. package/src/db/migrations/meta/0034_snapshot.json +2816 -0
  168. package/src/db/migrations/meta/_journal.json +21 -0
  169. package/src/db/migrations/pg/0030_abandoned_nighthawk.sql +3 -0
  170. package/src/db/migrations/pg/0031_strong_ultimatum.sql +128 -0
  171. package/src/db/migrations/pg/0032_furry_multiple_man.sql +6 -0
  172. package/src/db/migrations/pg/meta/0030_snapshot.json +3329 -0
  173. package/src/db/migrations/pg/meta/0031_snapshot.json +3660 -0
  174. package/src/db/migrations/pg/meta/0032_snapshot.json +3660 -0
  175. package/src/db/migrations/pg/meta/_journal.json +21 -0
  176. package/src/db/pg/schema.ts +195 -27
  177. package/src/db/post-visibility.ts +117 -0
  178. package/src/db/schema.ts +222 -27
  179. package/src/i18n/__tests__/detect.test.ts +26 -81
  180. package/src/i18n/__tests__/supported-locales.test.ts +83 -0
  181. package/src/i18n/context.tsx +12 -2
  182. package/src/i18n/detect.ts +7 -66
  183. package/src/i18n/locales/glossary.zh-Hans.yml +44 -4
  184. package/src/i18n/locales/glossary.zh-Hant.yml +44 -4
  185. package/src/i18n/locales/public/en.po +490 -158
  186. package/src/i18n/locales/public/en.ts +1 -1
  187. package/src/i18n/locales/public/zh-Hans.po +487 -155
  188. package/src/i18n/locales/public/zh-Hans.ts +1 -1
  189. package/src/i18n/locales/public/zh-Hant.po +487 -155
  190. package/src/i18n/locales/public/zh-Hant.ts +1 -1
  191. package/src/i18n/locales/settings/en.po +551 -69
  192. package/src/i18n/locales/settings/en.ts +1 -1
  193. package/src/i18n/locales/settings/zh-Hans.po +597 -115
  194. package/src/i18n/locales/settings/zh-Hans.ts +1 -1
  195. package/src/i18n/locales/settings/zh-Hant.po +610 -128
  196. package/src/i18n/locales/settings/zh-Hant.ts +1 -1
  197. package/src/i18n/locales.ts +94 -0
  198. package/src/i18n/middleware.ts +12 -2
  199. package/src/i18n/supported-locales.ts +80 -0
  200. package/src/lib/__tests__/api-settings.test.ts +11 -2
  201. package/src/lib/__tests__/asset-path.test.ts +92 -0
  202. package/src/lib/__tests__/deferred.test.ts +90 -0
  203. package/src/lib/__tests__/discover-ping.test.ts +89 -0
  204. package/src/lib/__tests__/discover.test.ts +410 -0
  205. package/src/lib/__tests__/feed-policy.test.ts +26 -0
  206. package/src/lib/__tests__/feed.test.ts +1526 -15
  207. package/src/lib/__tests__/filter-dimensions.test.ts +341 -0
  208. package/src/lib/__tests__/hosted-signin.test.ts +1 -1
  209. package/src/lib/__tests__/http-cache.test.ts +162 -0
  210. package/src/lib/__tests__/jant-docs-dev.test.ts +21 -0
  211. package/src/lib/__tests__/jant-docs.test.ts +23 -0
  212. package/src/lib/__tests__/lang-detect.test.ts +231 -0
  213. package/src/lib/__tests__/media-helpers.test.ts +81 -0
  214. package/src/lib/__tests__/navigation.test.ts +135 -1
  215. package/src/lib/__tests__/resolve-config.test.ts +64 -3
  216. package/src/lib/__tests__/schemas.test.ts +42 -4
  217. package/src/lib/__tests__/site-unavailable-page.test.ts +25 -0
  218. package/src/lib/__tests__/slug.test.ts +70 -0
  219. package/src/lib/__tests__/slugify.test.ts +85 -0
  220. package/src/lib/__tests__/storage.test.ts +32 -0
  221. package/src/lib/__tests__/thread-fold.test.ts +113 -0
  222. package/src/lib/__tests__/upload-sideload.test.ts +14 -0
  223. package/src/lib/__tests__/url-fetch.test.ts +1 -2
  224. package/src/lib/__tests__/url.test.ts +78 -72
  225. package/src/lib/__tests__/view-language.test.ts +413 -0
  226. package/src/lib/__tests__/worker-response-cache.test.ts +90 -0
  227. package/src/lib/address.ts +57 -0
  228. package/src/lib/api-posts.ts +12 -0
  229. package/src/lib/asset-path.ts +98 -1
  230. package/src/lib/build-env.ts +16 -0
  231. package/src/lib/collection-groups.ts +5 -1
  232. package/src/lib/collection-paths.ts +3 -10
  233. package/src/lib/constants.ts +28 -3
  234. package/src/lib/copy-field.ts +36 -0
  235. package/src/lib/crypto.ts +40 -0
  236. package/src/lib/csp-builder.ts +2 -1
  237. package/src/lib/deferred.ts +79 -0
  238. package/src/lib/discover-ping.ts +141 -0
  239. package/src/lib/discover.ts +437 -0
  240. package/src/lib/env.ts +134 -0
  241. package/src/lib/errors.ts +33 -0
  242. package/src/lib/feed-policy.ts +236 -2
  243. package/src/lib/feed.ts +926 -73
  244. package/src/lib/filter-dimensions.ts +1349 -0
  245. package/src/lib/github-sync-site-config.ts +3 -0
  246. package/src/lib/hosted-signin.ts +1 -1
  247. package/src/lib/http-cache.ts +148 -0
  248. package/src/lib/hugo-markdown.ts +16 -0
  249. package/src/lib/icons.ts +9 -2
  250. package/src/lib/ids.ts +3 -0
  251. package/src/lib/jant-docs.ts +42 -0
  252. package/src/lib/lang-detect.ts +308 -0
  253. package/src/lib/media-helpers.ts +13 -1
  254. package/src/lib/navigation.ts +78 -11
  255. package/src/lib/pagination.ts +28 -24
  256. package/src/lib/per-language-surfaces.ts +67 -0
  257. package/src/lib/post-meta.ts +19 -0
  258. package/src/lib/render.tsx +55 -7
  259. package/src/lib/resolve-config.ts +53 -5
  260. package/src/lib/schemas.ts +201 -10
  261. package/src/lib/site-header-fragment.tsx +2 -1
  262. package/src/lib/site-unavailable-page.ts +47 -0
  263. package/src/lib/slug.ts +51 -7
  264. package/src/lib/slugify.ts +113 -0
  265. package/src/lib/startup-config.ts +4 -6
  266. package/src/lib/storage.ts +7 -0
  267. package/src/lib/summary.ts +50 -0
  268. package/src/lib/thread-fold.ts +161 -0
  269. package/src/lib/time.ts +32 -0
  270. package/src/lib/timeline.ts +42 -1
  271. package/src/lib/tiptap-render.ts +1 -2
  272. package/src/lib/upload.ts +16 -13
  273. package/src/lib/url.ts +139 -86
  274. package/src/lib/version.ts +10 -8
  275. package/src/lib/view-language.ts +436 -0
  276. package/src/lib/view.ts +51 -23
  277. package/src/lib/viewer-context.ts +62 -0
  278. package/src/middleware/__tests__/auth.test.ts +70 -2
  279. package/src/middleware/__tests__/cache-control.test.ts +71 -3
  280. package/src/middleware/__tests__/onboarding.test.ts +76 -5
  281. package/src/middleware/__tests__/secure-headers.test.ts +1 -1
  282. package/src/middleware/__tests__/session.test.ts +181 -33
  283. package/src/middleware/auth.ts +50 -31
  284. package/src/middleware/cache-control.ts +75 -10
  285. package/src/middleware/config.ts +6 -6
  286. package/src/middleware/error-handler.ts +12 -0
  287. package/src/middleware/onboarding.ts +32 -10
  288. package/src/middleware/secure-headers.ts +1 -1
  289. package/src/middleware/session.ts +96 -8
  290. package/src/node/__tests__/cli-migrate.test.ts +21 -19
  291. package/src/node/__tests__/cli-reset-password.test.ts +81 -8
  292. package/src/node/__tests__/cli-runtime-target.test.ts +48 -1
  293. package/src/node/__tests__/cli-site-selection.test.ts +128 -38
  294. package/src/node/__tests__/runtime.test.ts +37 -0
  295. package/src/node/index.ts +1 -0
  296. package/src/preset.css +76 -22
  297. package/src/routes/__tests__/feed-validator.test.ts +156 -0
  298. package/src/routes/api/__tests__/collections.test.ts +114 -0
  299. package/src/routes/api/__tests__/discover.test.ts +222 -0
  300. package/src/routes/api/__tests__/nav-items.test.ts +212 -2
  301. package/src/routes/api/__tests__/post-translations.test.ts +829 -0
  302. package/src/routes/api/__tests__/settings.test.ts +24 -3
  303. package/src/routes/api/__tests__/telegram.test.ts +6 -5
  304. package/src/routes/api/collections.ts +49 -6
  305. package/src/routes/api/custom-urls.ts +0 -1
  306. package/src/routes/api/discover.ts +95 -0
  307. package/src/routes/api/export.ts +3 -0
  308. package/src/routes/api/internal/__tests__/sites.test.ts +42 -2
  309. package/src/routes/api/nav-items.ts +55 -8
  310. package/src/routes/api/posts.ts +159 -0
  311. package/src/routes/api/public/__tests__/archive.test.ts +111 -0
  312. package/src/routes/api/public/archive.ts +77 -81
  313. package/src/routes/api/public/posts.ts +23 -6
  314. package/src/routes/api/smart-collections.ts +132 -0
  315. package/src/routes/api/telegram.ts +2 -40
  316. package/src/routes/api/uploads.ts +1 -2
  317. package/src/routes/auth/__tests__/setup-auth.test.ts +137 -0
  318. package/src/routes/auth/__tests__/setup-discover.test.ts +204 -0
  319. package/src/routes/auth/__tests__/setup-flow.test.ts +270 -0
  320. package/src/routes/auth/__tests__/setup-page.test.tsx +329 -0
  321. package/src/routes/auth/__tests__/setup-steps.test.ts +310 -0
  322. package/src/routes/auth/__tests__/setup.test.ts +278 -26
  323. package/src/routes/auth/__tests__/signin.test.ts +135 -0
  324. package/src/routes/auth/setup.tsx +934 -186
  325. package/src/routes/auth/signin.tsx +10 -8
  326. package/src/routes/compose.tsx +5 -0
  327. package/src/routes/dash/__tests__/custom-urls-archive.test.ts +44 -0
  328. package/src/routes/dash/__tests__/custom-urls-page.test.ts +49 -0
  329. package/src/routes/dash/__tests__/delete-account.test.ts +106 -0
  330. package/src/routes/dash/__tests__/settings-discover.test.ts +213 -0
  331. package/src/routes/dash/custom-urls.tsx +1 -37
  332. package/src/routes/dash/settings.tsx +502 -41
  333. package/src/routes/discover-announce.ts +96 -0
  334. package/src/routes/feed/__tests__/feed.test.ts +165 -2
  335. package/src/routes/feed/feed.ts +69 -40
  336. package/src/routes/feed/sitemap.ts +95 -11
  337. package/src/routes/pages/__tests__/archive-indexing.test.ts +200 -0
  338. package/src/routes/pages/__tests__/archive-params.test.ts +370 -6
  339. package/src/routes/pages/__tests__/collection-routing.test.ts +16 -0
  340. package/src/routes/pages/__tests__/collections-feed-links.test.ts +72 -0
  341. package/src/routes/pages/__tests__/collections.test.ts +9 -3
  342. package/src/routes/pages/__tests__/custom-archive-url.test.ts +119 -0
  343. package/src/routes/pages/__tests__/feed-autodiscovery.test.ts +148 -0
  344. package/src/routes/pages/__tests__/language-routing.test.ts +679 -0
  345. package/src/routes/pages/__tests__/post-preview-partial.test.ts +96 -0
  346. package/src/routes/pages/__tests__/smart-collection.test.ts +298 -0
  347. package/src/routes/pages/__tests__/subscribe.test.ts +248 -0
  348. package/src/routes/pages/archive.tsx +471 -369
  349. package/src/routes/pages/collection.tsx +94 -96
  350. package/src/routes/pages/collections.tsx +38 -50
  351. package/src/routes/pages/featured.tsx +32 -13
  352. package/src/routes/pages/home.tsx +25 -6
  353. package/src/routes/pages/language.tsx +113 -0
  354. package/src/routes/pages/latest.tsx +26 -16
  355. package/src/routes/pages/new.tsx +3 -0
  356. package/src/routes/pages/page.tsx +178 -17
  357. package/src/routes/pages/partials.tsx +41 -0
  358. package/src/routes/pages/search.tsx +18 -3
  359. package/src/routes/pages/smart-collection.tsx +340 -0
  360. package/src/routes/pages/subscribe.tsx +182 -0
  361. package/src/runtime/__tests__/index.test.ts +19 -0
  362. package/src/runtime/__tests__/node.test.ts +129 -4
  363. package/src/runtime/cloudflare.ts +21 -2
  364. package/src/runtime/index.ts +27 -1
  365. package/src/runtime/node.ts +18 -1
  366. package/src/runtime/site.ts +95 -24
  367. package/src/services/__tests__/auth.test.ts +116 -7
  368. package/src/services/__tests__/collection.test.ts +108 -4
  369. package/src/services/__tests__/language.test.ts +495 -0
  370. package/src/services/__tests__/navigation.test.ts +213 -10
  371. package/src/services/__tests__/path.test.ts +180 -0
  372. package/src/services/__tests__/post-language.test.ts +830 -0
  373. package/src/services/__tests__/post.test.ts +46 -9
  374. package/src/services/__tests__/settings.test.ts +228 -17
  375. package/src/services/__tests__/site-admin.test.ts +5 -5
  376. package/src/services/__tests__/smart-collection.test.ts +651 -0
  377. package/src/services/about-page.ts +22 -1
  378. package/src/services/auth.ts +51 -49
  379. package/src/services/bootstrap.ts +188 -38
  380. package/src/services/collection-directory-position.ts +76 -0
  381. package/src/services/collection.ts +331 -46
  382. package/src/services/custom-url.ts +27 -22
  383. package/src/services/export-theme/assets/client-site.css +1 -1
  384. package/src/services/export-theme/assets/client-site.js +123 -123
  385. package/src/services/export-theme/layouts/_default/rss.xml +77 -1
  386. package/src/services/export-theme/layouts/partials/feed-post-content.xml +105 -2
  387. package/src/services/export-theme/layouts/partials/media-gallery.html +35 -21
  388. package/src/services/export-theme/layouts/partials/pagination.html +14 -13
  389. package/src/services/export-theme/layouts/partials/post-card.html +8 -4
  390. package/src/services/export-theme/layouts/partials/reply.html +2 -1
  391. package/src/services/export-theme/layouts/partials/thread-preview.html +40 -30
  392. package/src/services/export-theme/styles/main.css +13 -1
  393. package/src/services/export.ts +278 -19
  394. package/src/services/index.ts +34 -3
  395. package/src/services/language.ts +412 -0
  396. package/src/services/mcp.ts +3 -1
  397. package/src/services/media.ts +14 -6
  398. package/src/services/navigation.ts +429 -67
  399. package/src/services/path.ts +221 -6
  400. package/src/services/post.ts +1021 -152
  401. package/src/services/search.ts +39 -2
  402. package/src/services/settings.ts +238 -43
  403. package/src/services/site-admin.ts +24 -7
  404. package/src/services/site.ts +77 -1
  405. package/src/services/smart-collection.ts +636 -0
  406. package/src/services/telegram.ts +20 -22
  407. package/src/services/upload-session.ts +1 -3
  408. package/src/style-author.css +27 -0
  409. package/src/styles/components-author.css +1622 -0
  410. package/src/styles/components.css +24 -1571
  411. package/src/styles/site-media.css +16 -2
  412. package/src/styles/tokens.css +82 -12
  413. package/src/styles/ui-author.css +7602 -0
  414. package/src/styles/ui.css +1087 -7219
  415. package/src/types/app-context.ts +7 -0
  416. package/src/types/bindings.ts +3 -0
  417. package/src/types/config.ts +94 -15
  418. package/src/types/constants.ts +188 -16
  419. package/src/types/entities.ts +87 -1
  420. package/src/types/operations.ts +64 -2
  421. package/src/types/props.ts +157 -31
  422. package/src/types/views.ts +55 -1
  423. package/src/ui/__tests__/font-themes.test.ts +52 -12
  424. package/src/ui/compose/ComposeDialog.tsx +201 -7
  425. package/src/ui/compose/ComposePrompt.tsx +1 -5
  426. package/src/ui/compose/__tests__/ComposeDialog.test.tsx +125 -0
  427. package/src/ui/dash/appearance/AdvancedContent.tsx +2 -2
  428. package/src/ui/dash/appearance/CodeInjectionContent.tsx +12 -16
  429. package/src/ui/dash/appearance/NavigationContent.tsx +117 -16
  430. package/src/ui/dash/appearance/__tests__/NavigationContent.test.tsx +33 -11
  431. package/src/ui/dash/appearance/__tests__/system-nav-descriptions.test.ts +44 -0
  432. package/src/ui/dash/appearance/system-nav-descriptions.ts +75 -0
  433. package/src/ui/dash/settings/AccountMenuContent.tsx +2 -2
  434. package/src/ui/dash/settings/ApiTokensContent.tsx +2 -1
  435. package/src/ui/dash/settings/ConfigEditorContent.tsx +35 -16
  436. package/src/ui/dash/settings/GeneralContent.tsx +275 -113
  437. package/src/ui/dash/settings/LanguageContent.tsx +409 -0
  438. package/src/ui/dash/settings/SettingsRootContent.tsx +19 -1
  439. package/src/ui/dash/settings/__tests__/GeneralContent.test.tsx +324 -4
  440. package/src/ui/dash/settings/__tests__/LanguageContent.test.tsx +144 -0
  441. package/src/ui/dash/settings/__tests__/discover-copy.test.ts +66 -0
  442. package/src/ui/dash/settings/discover-copy.ts +116 -0
  443. package/src/ui/feed/LinkCard.tsx +55 -45
  444. package/src/ui/feed/NoteCard.tsx +9 -4
  445. package/src/ui/feed/PostStatusBadges.tsx +90 -43
  446. package/src/ui/feed/QuoteCard.tsx +55 -30
  447. package/src/ui/feed/ThreadPreview.tsx +6 -2
  448. package/src/ui/feed/__tests__/thread-preview.test.ts +13 -16
  449. package/src/ui/feed/__tests__/timeline-cards.test.ts +314 -49
  450. package/src/ui/feed/thread-preview-state.ts +20 -6
  451. package/src/ui/font-themes.ts +39 -29
  452. package/src/ui/layouts/BaseLayout.tsx +155 -10
  453. package/src/ui/layouts/SiteLayout.tsx +192 -34
  454. package/src/ui/layouts/__tests__/BaseLayout.test.tsx +196 -17
  455. package/src/ui/layouts/__tests__/SiteLayout.test.tsx +109 -85
  456. package/src/ui/pages/ArchivePage.tsx +282 -289
  457. package/src/ui/pages/CollectionPage.tsx +86 -76
  458. package/src/ui/pages/CollectionsPage.tsx +5 -0
  459. package/src/ui/pages/ComposePage.tsx +8 -0
  460. package/src/ui/pages/PostPage.tsx +47 -0
  461. package/src/ui/pages/SearchPage.tsx +3 -3
  462. package/src/ui/pages/SmartCollectionPage.tsx +434 -0
  463. package/src/ui/pages/SubscribePage.tsx +236 -0
  464. package/src/ui/pages/__tests__/ArchivePage.test.tsx +65 -9
  465. package/src/ui/pages/__tests__/collections-directory-rows.test.tsx +92 -0
  466. package/src/ui/pages/__tests__/collections-view-links.test.tsx +81 -0
  467. package/src/ui/shared/CollectionDirectory.tsx +178 -3
  468. package/src/ui/shared/CollectionsManager.tsx +70 -17
  469. package/src/ui/shared/CopyField.tsx +127 -0
  470. package/src/ui/shared/EmptyPostContent.tsx +23 -0
  471. package/src/ui/shared/MediaGallery.tsx +125 -46
  472. package/src/ui/shared/Pagination.tsx +20 -5
  473. package/src/ui/shared/PostFooter.tsx +20 -11
  474. package/src/ui/shared/__tests__/archive-labels.test.ts +100 -0
  475. package/src/ui/shared/__tests__/media-gallery.test.ts +210 -2
  476. package/src/ui/shared/__tests__/navigation-labels.test.ts +16 -22
  477. package/src/ui/shared/__tests__/pagination.test.ts +38 -24
  478. package/src/ui/shared/__tests__/post-footer.test.ts +32 -0
  479. package/src/ui/shared/archive-labels.ts +98 -0
  480. package/src/ui/shared/collection-management-labels.ts +94 -16
  481. package/src/ui/shared/navigation-labels.ts +45 -71
  482. package/src/ui/shared/post-article-attributes.ts +2 -0
  483. package/src/ui/shared/smart-collection-labels.ts +343 -0
  484. package/dist/app-C75Zc8dD.js +0 -6
  485. package/dist/client/_assets/chunks/heic-to-DUUaO23q.js +0 -1
  486. package/dist/client/_assets/chunks/module-DcsAZQZ_.js +0 -716
  487. package/dist/client/_assets/chunks/url-CU9pEbk5.js +0 -1
  488. package/dist/client/_assets/client-Bq0vre8Y.js +0 -296
  489. package/dist/client/_assets/client-D3VZyG4L.css +0 -2
  490. package/dist/client/_assets/client-auth-F2rb9WfF.js +0 -5571
  491. package/dist/env-BPYViDJJ.js +0 -281
  492. package/dist/github-api-BNF35Lkx.js +0 -176
  493. package/dist/github-app-DdiD-bC4.js +0 -275
  494. package/dist/github-sync-Bqg62IvV.js +0 -4
  495. package/dist/github-sync-HdK2EgvJ.js +0 -431
  496. package/dist/url-CbLAtlZe.js +0 -900
  497. package/src/client/__tests__/collection-created-notice.test.ts +0 -36
  498. package/src/client/__tests__/collection-form-bridge.test.ts +0 -216
  499. package/src/client/__tests__/post-form-bridge.test.ts +0 -82
  500. package/src/client/collection-created-notice.ts +0 -66
  501. package/src/client/collection-form-bridge.ts +0 -191
  502. package/src/client/components/__tests__/jant-post-form.test.ts +0 -193
  503. package/src/client/components/jant-post-form.ts +0 -422
  504. package/src/client/components/post-form-template.ts +0 -352
  505. package/src/client/components/post-form-types.ts +0 -96
  506. package/src/client/media-metadata.ts +0 -247
  507. package/src/client/post-form-bridge.ts +0 -193
  508. package/src/ui/pages/CollectionEditorPage.tsx +0 -175
@@ -0,0 +1,3660 @@
1
+ {
2
+ "id": "3036eca9-c561-4a47-a3bf-2d55b211df74",
3
+ "prevId": "029ef57b-d22b-4675-b57d-a243bb1d811b",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "account_id": {
18
+ "name": "account_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "provider_id": {
24
+ "name": "provider_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "user_id": {
30
+ "name": "user_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "id_token": {
48
+ "name": "id_token",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "access_token_expires_at": {
54
+ "name": "access_token_expires_at",
55
+ "type": "timestamp with time zone",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "refresh_token_expires_at": {
60
+ "name": "refresh_token_expires_at",
61
+ "type": "timestamp with time zone",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "scope": {
66
+ "name": "scope",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp with time zone",
80
+ "primaryKey": false,
81
+ "notNull": true
82
+ },
83
+ "updated_at": {
84
+ "name": "updated_at",
85
+ "type": "timestamp with time zone",
86
+ "primaryKey": false,
87
+ "notNull": true
88
+ }
89
+ },
90
+ "indexes": {},
91
+ "foreignKeys": {
92
+ "account_user_id_user_id_fk": {
93
+ "name": "account_user_id_user_id_fk",
94
+ "tableFrom": "account",
95
+ "tableTo": "user",
96
+ "columnsFrom": ["user_id"],
97
+ "columnsTo": ["id"],
98
+ "onDelete": "no action",
99
+ "onUpdate": "no action"
100
+ }
101
+ },
102
+ "compositePrimaryKeys": {},
103
+ "uniqueConstraints": {},
104
+ "policies": {},
105
+ "checkConstraints": {},
106
+ "isRLSEnabled": false
107
+ },
108
+ "public.api_token": {
109
+ "name": "api_token",
110
+ "schema": "",
111
+ "columns": {
112
+ "id": {
113
+ "name": "id",
114
+ "type": "text",
115
+ "primaryKey": true,
116
+ "notNull": true
117
+ },
118
+ "site_id": {
119
+ "name": "site_id",
120
+ "type": "text",
121
+ "primaryKey": false,
122
+ "notNull": true
123
+ },
124
+ "name": {
125
+ "name": "name",
126
+ "type": "text",
127
+ "primaryKey": false,
128
+ "notNull": true
129
+ },
130
+ "token_hash": {
131
+ "name": "token_hash",
132
+ "type": "text",
133
+ "primaryKey": false,
134
+ "notNull": true
135
+ },
136
+ "prefix": {
137
+ "name": "prefix",
138
+ "type": "text",
139
+ "primaryKey": false,
140
+ "notNull": true
141
+ },
142
+ "last_used_at": {
143
+ "name": "last_used_at",
144
+ "type": "integer",
145
+ "primaryKey": false,
146
+ "notNull": false
147
+ },
148
+ "created_at": {
149
+ "name": "created_at",
150
+ "type": "integer",
151
+ "primaryKey": false,
152
+ "notNull": true
153
+ },
154
+ "updated_at": {
155
+ "name": "updated_at",
156
+ "type": "integer",
157
+ "primaryKey": false,
158
+ "notNull": true
159
+ }
160
+ },
161
+ "indexes": {
162
+ "idx_api_token_site_id": {
163
+ "name": "idx_api_token_site_id",
164
+ "columns": [
165
+ {
166
+ "expression": "site_id",
167
+ "isExpression": false,
168
+ "asc": true,
169
+ "nulls": "last"
170
+ }
171
+ ],
172
+ "isUnique": false,
173
+ "concurrently": false,
174
+ "method": "btree",
175
+ "with": {}
176
+ }
177
+ },
178
+ "foreignKeys": {
179
+ "api_token_site_id_site_id_fk": {
180
+ "name": "api_token_site_id_site_id_fk",
181
+ "tableFrom": "api_token",
182
+ "tableTo": "site",
183
+ "columnsFrom": ["site_id"],
184
+ "columnsTo": ["id"],
185
+ "onDelete": "cascade",
186
+ "onUpdate": "no action"
187
+ }
188
+ },
189
+ "compositePrimaryKeys": {},
190
+ "uniqueConstraints": {
191
+ "api_token_token_hash_unique": {
192
+ "name": "api_token_token_hash_unique",
193
+ "nullsNotDistinct": false,
194
+ "columns": ["token_hash"]
195
+ }
196
+ },
197
+ "policies": {},
198
+ "checkConstraints": {},
199
+ "isRLSEnabled": false
200
+ },
201
+ "public.collection_directory_item": {
202
+ "name": "collection_directory_item",
203
+ "schema": "",
204
+ "columns": {
205
+ "id": {
206
+ "name": "id",
207
+ "type": "text",
208
+ "primaryKey": true,
209
+ "notNull": true
210
+ },
211
+ "site_id": {
212
+ "name": "site_id",
213
+ "type": "text",
214
+ "primaryKey": false,
215
+ "notNull": true
216
+ },
217
+ "type": {
218
+ "name": "type",
219
+ "type": "text",
220
+ "primaryKey": false,
221
+ "notNull": true
222
+ },
223
+ "collection_id": {
224
+ "name": "collection_id",
225
+ "type": "text",
226
+ "primaryKey": false,
227
+ "notNull": false
228
+ },
229
+ "smart_collection_id": {
230
+ "name": "smart_collection_id",
231
+ "type": "text",
232
+ "primaryKey": false,
233
+ "notNull": false
234
+ },
235
+ "label": {
236
+ "name": "label",
237
+ "type": "text",
238
+ "primaryKey": false,
239
+ "notNull": false
240
+ },
241
+ "url": {
242
+ "name": "url",
243
+ "type": "text",
244
+ "primaryKey": false,
245
+ "notNull": false
246
+ },
247
+ "description": {
248
+ "name": "description",
249
+ "type": "text",
250
+ "primaryKey": false,
251
+ "notNull": false
252
+ },
253
+ "position": {
254
+ "name": "position",
255
+ "type": "text",
256
+ "primaryKey": false,
257
+ "notNull": true,
258
+ "default": "'a0'"
259
+ },
260
+ "created_at": {
261
+ "name": "created_at",
262
+ "type": "integer",
263
+ "primaryKey": false,
264
+ "notNull": true
265
+ },
266
+ "updated_at": {
267
+ "name": "updated_at",
268
+ "type": "integer",
269
+ "primaryKey": false,
270
+ "notNull": true
271
+ }
272
+ },
273
+ "indexes": {
274
+ "idx_collection_directory_item_site_collection_id": {
275
+ "name": "idx_collection_directory_item_site_collection_id",
276
+ "columns": [
277
+ {
278
+ "expression": "site_id",
279
+ "isExpression": false,
280
+ "asc": true,
281
+ "nulls": "last"
282
+ },
283
+ {
284
+ "expression": "collection_id",
285
+ "isExpression": false,
286
+ "asc": true,
287
+ "nulls": "last"
288
+ }
289
+ ],
290
+ "isUnique": false,
291
+ "concurrently": false,
292
+ "method": "btree",
293
+ "with": {}
294
+ },
295
+ "idx_collection_directory_item_site_smart_collection_id": {
296
+ "name": "idx_collection_directory_item_site_smart_collection_id",
297
+ "columns": [
298
+ {
299
+ "expression": "site_id",
300
+ "isExpression": false,
301
+ "asc": true,
302
+ "nulls": "last"
303
+ },
304
+ {
305
+ "expression": "smart_collection_id",
306
+ "isExpression": false,
307
+ "asc": true,
308
+ "nulls": "last"
309
+ }
310
+ ],
311
+ "isUnique": false,
312
+ "concurrently": false,
313
+ "method": "btree",
314
+ "with": {}
315
+ },
316
+ "uq_collection_directory_item_site_position": {
317
+ "name": "uq_collection_directory_item_site_position",
318
+ "columns": [
319
+ {
320
+ "expression": "site_id",
321
+ "isExpression": false,
322
+ "asc": true,
323
+ "nulls": "last"
324
+ },
325
+ {
326
+ "expression": "position",
327
+ "isExpression": false,
328
+ "asc": true,
329
+ "nulls": "last"
330
+ }
331
+ ],
332
+ "isUnique": true,
333
+ "concurrently": false,
334
+ "method": "btree",
335
+ "with": {}
336
+ },
337
+ "uq_collection_directory_item_site_collection_once": {
338
+ "name": "uq_collection_directory_item_site_collection_once",
339
+ "columns": [
340
+ {
341
+ "expression": "site_id",
342
+ "isExpression": false,
343
+ "asc": true,
344
+ "nulls": "last"
345
+ },
346
+ {
347
+ "expression": "collection_id",
348
+ "isExpression": false,
349
+ "asc": true,
350
+ "nulls": "last"
351
+ }
352
+ ],
353
+ "isUnique": true,
354
+ "where": "\"collection_directory_item\".\"type\" = 'collection' AND \"collection_directory_item\".\"collection_id\" IS NOT NULL",
355
+ "concurrently": false,
356
+ "method": "btree",
357
+ "with": {}
358
+ },
359
+ "uq_collection_directory_item_site_smart_collection_once": {
360
+ "name": "uq_collection_directory_item_site_smart_collection_once",
361
+ "columns": [
362
+ {
363
+ "expression": "site_id",
364
+ "isExpression": false,
365
+ "asc": true,
366
+ "nulls": "last"
367
+ },
368
+ {
369
+ "expression": "smart_collection_id",
370
+ "isExpression": false,
371
+ "asc": true,
372
+ "nulls": "last"
373
+ }
374
+ ],
375
+ "isUnique": true,
376
+ "where": "\"collection_directory_item\".\"type\" = 'smart_collection' AND \"collection_directory_item\".\"smart_collection_id\" IS NOT NULL",
377
+ "concurrently": false,
378
+ "method": "btree",
379
+ "with": {}
380
+ }
381
+ },
382
+ "foreignKeys": {
383
+ "collection_directory_item_site_id_site_id_fk": {
384
+ "name": "collection_directory_item_site_id_site_id_fk",
385
+ "tableFrom": "collection_directory_item",
386
+ "tableTo": "site",
387
+ "columnsFrom": ["site_id"],
388
+ "columnsTo": ["id"],
389
+ "onDelete": "cascade",
390
+ "onUpdate": "no action"
391
+ },
392
+ "collection_directory_item_collection_id_collection_id_fk": {
393
+ "name": "collection_directory_item_collection_id_collection_id_fk",
394
+ "tableFrom": "collection_directory_item",
395
+ "tableTo": "collection",
396
+ "columnsFrom": ["collection_id"],
397
+ "columnsTo": ["id"],
398
+ "onDelete": "cascade",
399
+ "onUpdate": "no action"
400
+ },
401
+ "collection_directory_item_smart_collection_id_smart_collection_id_fk": {
402
+ "name": "collection_directory_item_smart_collection_id_smart_collection_id_fk",
403
+ "tableFrom": "collection_directory_item",
404
+ "tableTo": "smart_collection",
405
+ "columnsFrom": ["smart_collection_id"],
406
+ "columnsTo": ["id"],
407
+ "onDelete": "cascade",
408
+ "onUpdate": "no action"
409
+ }
410
+ },
411
+ "compositePrimaryKeys": {},
412
+ "uniqueConstraints": {},
413
+ "policies": {},
414
+ "checkConstraints": {
415
+ "chk_collection_directory_item_type": {
416
+ "name": "chk_collection_directory_item_type",
417
+ "value": "\"collection_directory_item\".\"type\" IN ('collection', 'smart_collection', 'divider', 'link')"
418
+ },
419
+ "chk_collection_directory_item_shape": {
420
+ "name": "chk_collection_directory_item_shape",
421
+ "value": "(\n \"collection_directory_item\".\"type\" = 'collection'\n AND \"collection_directory_item\".\"collection_id\" IS NOT NULL\n AND \"collection_directory_item\".\"smart_collection_id\" IS NULL\n AND \"collection_directory_item\".\"label\" IS NULL\n AND \"collection_directory_item\".\"url\" IS NULL\n ) OR (\n \"collection_directory_item\".\"type\" = 'smart_collection'\n AND \"collection_directory_item\".\"collection_id\" IS NULL\n AND \"collection_directory_item\".\"smart_collection_id\" IS NOT NULL\n AND \"collection_directory_item\".\"label\" IS NULL\n AND \"collection_directory_item\".\"url\" IS NULL\n ) OR (\n \"collection_directory_item\".\"type\" = 'divider'\n AND \"collection_directory_item\".\"collection_id\" IS NULL\n AND \"collection_directory_item\".\"smart_collection_id\" IS NULL\n AND \"collection_directory_item\".\"url\" IS NULL\n ) OR (\n \"collection_directory_item\".\"type\" = 'link'\n AND \"collection_directory_item\".\"collection_id\" IS NULL\n AND \"collection_directory_item\".\"smart_collection_id\" IS NULL\n AND \"collection_directory_item\".\"label\" IS NOT NULL\n AND \"collection_directory_item\".\"url\" IS NOT NULL\n )"
422
+ },
423
+ "chk_collection_directory_item_label": {
424
+ "name": "chk_collection_directory_item_label",
425
+ "value": "\"collection_directory_item\".\"type\" NOT IN ('collection', 'smart_collection') OR \"collection_directory_item\".\"label\" IS NULL"
426
+ },
427
+ "chk_collection_directory_item_description": {
428
+ "name": "chk_collection_directory_item_description",
429
+ "value": "\"collection_directory_item\".\"type\" = 'link' OR \"collection_directory_item\".\"description\" IS NULL"
430
+ }
431
+ },
432
+ "isRLSEnabled": false
433
+ },
434
+ "public.collection": {
435
+ "name": "collection",
436
+ "schema": "",
437
+ "columns": {
438
+ "id": {
439
+ "name": "id",
440
+ "type": "text",
441
+ "primaryKey": true,
442
+ "notNull": true
443
+ },
444
+ "site_id": {
445
+ "name": "site_id",
446
+ "type": "text",
447
+ "primaryKey": false,
448
+ "notNull": true
449
+ },
450
+ "title": {
451
+ "name": "title",
452
+ "type": "text",
453
+ "primaryKey": false,
454
+ "notNull": true
455
+ },
456
+ "description": {
457
+ "name": "description",
458
+ "type": "text",
459
+ "primaryKey": false,
460
+ "notNull": false
461
+ },
462
+ "sort_order": {
463
+ "name": "sort_order",
464
+ "type": "text",
465
+ "primaryKey": false,
466
+ "notNull": true,
467
+ "default": "'newest'"
468
+ },
469
+ "created_at": {
470
+ "name": "created_at",
471
+ "type": "integer",
472
+ "primaryKey": false,
473
+ "notNull": true
474
+ },
475
+ "updated_at": {
476
+ "name": "updated_at",
477
+ "type": "integer",
478
+ "primaryKey": false,
479
+ "notNull": true
480
+ }
481
+ },
482
+ "indexes": {
483
+ "idx_collection_site_created_at": {
484
+ "name": "idx_collection_site_created_at",
485
+ "columns": [
486
+ {
487
+ "expression": "site_id",
488
+ "isExpression": false,
489
+ "asc": true,
490
+ "nulls": "last"
491
+ },
492
+ {
493
+ "expression": "created_at",
494
+ "isExpression": false,
495
+ "asc": true,
496
+ "nulls": "last"
497
+ }
498
+ ],
499
+ "isUnique": false,
500
+ "concurrently": false,
501
+ "method": "btree",
502
+ "with": {}
503
+ }
504
+ },
505
+ "foreignKeys": {
506
+ "collection_site_id_site_id_fk": {
507
+ "name": "collection_site_id_site_id_fk",
508
+ "tableFrom": "collection",
509
+ "tableTo": "site",
510
+ "columnsFrom": ["site_id"],
511
+ "columnsTo": ["id"],
512
+ "onDelete": "cascade",
513
+ "onUpdate": "no action"
514
+ }
515
+ },
516
+ "compositePrimaryKeys": {},
517
+ "uniqueConstraints": {},
518
+ "policies": {},
519
+ "checkConstraints": {
520
+ "chk_collection_sort_order": {
521
+ "name": "chk_collection_sort_order",
522
+ "value": "\"collection\".\"sort_order\" IN ('newest', 'oldest', 'rating_desc')"
523
+ }
524
+ },
525
+ "isRLSEnabled": false
526
+ },
527
+ "public.github_app_installation": {
528
+ "name": "github_app_installation",
529
+ "schema": "",
530
+ "columns": {
531
+ "installation_id": {
532
+ "name": "installation_id",
533
+ "type": "text",
534
+ "primaryKey": false,
535
+ "notNull": true
536
+ },
537
+ "site_id": {
538
+ "name": "site_id",
539
+ "type": "text",
540
+ "primaryKey": false,
541
+ "notNull": true
542
+ },
543
+ "account_login": {
544
+ "name": "account_login",
545
+ "type": "text",
546
+ "primaryKey": false,
547
+ "notNull": true
548
+ },
549
+ "account_type": {
550
+ "name": "account_type",
551
+ "type": "text",
552
+ "primaryKey": false,
553
+ "notNull": true
554
+ },
555
+ "account_avatar_url": {
556
+ "name": "account_avatar_url",
557
+ "type": "text",
558
+ "primaryKey": false,
559
+ "notNull": true,
560
+ "default": "''"
561
+ },
562
+ "added_at": {
563
+ "name": "added_at",
564
+ "type": "integer",
565
+ "primaryKey": false,
566
+ "notNull": true
567
+ }
568
+ },
569
+ "indexes": {
570
+ "github_app_installation_by_installation": {
571
+ "name": "github_app_installation_by_installation",
572
+ "columns": [
573
+ {
574
+ "expression": "installation_id",
575
+ "isExpression": false,
576
+ "asc": true,
577
+ "nulls": "last"
578
+ }
579
+ ],
580
+ "isUnique": false,
581
+ "concurrently": false,
582
+ "method": "btree",
583
+ "with": {}
584
+ },
585
+ "github_app_installation_by_site": {
586
+ "name": "github_app_installation_by_site",
587
+ "columns": [
588
+ {
589
+ "expression": "site_id",
590
+ "isExpression": false,
591
+ "asc": true,
592
+ "nulls": "last"
593
+ }
594
+ ],
595
+ "isUnique": false,
596
+ "concurrently": false,
597
+ "method": "btree",
598
+ "with": {}
599
+ }
600
+ },
601
+ "foreignKeys": {
602
+ "github_app_installation_site_id_site_id_fk": {
603
+ "name": "github_app_installation_site_id_site_id_fk",
604
+ "tableFrom": "github_app_installation",
605
+ "tableTo": "site",
606
+ "columnsFrom": ["site_id"],
607
+ "columnsTo": ["id"],
608
+ "onDelete": "cascade",
609
+ "onUpdate": "no action"
610
+ }
611
+ },
612
+ "compositePrimaryKeys": {
613
+ "github_app_installation_installation_id_site_id_pk": {
614
+ "name": "github_app_installation_installation_id_site_id_pk",
615
+ "columns": ["installation_id", "site_id"]
616
+ }
617
+ },
618
+ "uniqueConstraints": {},
619
+ "policies": {},
620
+ "checkConstraints": {
621
+ "chk_github_app_installation_account_type": {
622
+ "name": "chk_github_app_installation_account_type",
623
+ "value": "\"github_app_installation\".\"account_type\" IN ('User', 'Organization')"
624
+ }
625
+ },
626
+ "isRLSEnabled": false
627
+ },
628
+ "public.media": {
629
+ "name": "media",
630
+ "schema": "",
631
+ "columns": {
632
+ "id": {
633
+ "name": "id",
634
+ "type": "text",
635
+ "primaryKey": true,
636
+ "notNull": true
637
+ },
638
+ "site_id": {
639
+ "name": "site_id",
640
+ "type": "text",
641
+ "primaryKey": false,
642
+ "notNull": true
643
+ },
644
+ "post_id": {
645
+ "name": "post_id",
646
+ "type": "text",
647
+ "primaryKey": false,
648
+ "notNull": false
649
+ },
650
+ "filename": {
651
+ "name": "filename",
652
+ "type": "text",
653
+ "primaryKey": false,
654
+ "notNull": true
655
+ },
656
+ "original_name": {
657
+ "name": "original_name",
658
+ "type": "text",
659
+ "primaryKey": false,
660
+ "notNull": true
661
+ },
662
+ "mime_type": {
663
+ "name": "mime_type",
664
+ "type": "text",
665
+ "primaryKey": false,
666
+ "notNull": true
667
+ },
668
+ "size": {
669
+ "name": "size",
670
+ "type": "integer",
671
+ "primaryKey": false,
672
+ "notNull": true
673
+ },
674
+ "storage_key": {
675
+ "name": "storage_key",
676
+ "type": "text",
677
+ "primaryKey": false,
678
+ "notNull": true
679
+ },
680
+ "provider": {
681
+ "name": "provider",
682
+ "type": "text",
683
+ "primaryKey": false,
684
+ "notNull": true,
685
+ "default": "'r2'"
686
+ },
687
+ "width": {
688
+ "name": "width",
689
+ "type": "integer",
690
+ "primaryKey": false,
691
+ "notNull": false
692
+ },
693
+ "height": {
694
+ "name": "height",
695
+ "type": "integer",
696
+ "primaryKey": false,
697
+ "notNull": false
698
+ },
699
+ "duration_seconds": {
700
+ "name": "duration_seconds",
701
+ "type": "integer",
702
+ "primaryKey": false,
703
+ "notNull": false
704
+ },
705
+ "alt": {
706
+ "name": "alt",
707
+ "type": "text",
708
+ "primaryKey": false,
709
+ "notNull": false
710
+ },
711
+ "position": {
712
+ "name": "position",
713
+ "type": "text",
714
+ "primaryKey": false,
715
+ "notNull": true,
716
+ "default": "'a0'"
717
+ },
718
+ "blurhash": {
719
+ "name": "blurhash",
720
+ "type": "text",
721
+ "primaryKey": false,
722
+ "notNull": false
723
+ },
724
+ "waveform": {
725
+ "name": "waveform",
726
+ "type": "text",
727
+ "primaryKey": false,
728
+ "notNull": false
729
+ },
730
+ "poster_key": {
731
+ "name": "poster_key",
732
+ "type": "text",
733
+ "primaryKey": false,
734
+ "notNull": false
735
+ },
736
+ "summary": {
737
+ "name": "summary",
738
+ "type": "text",
739
+ "primaryKey": false,
740
+ "notNull": false
741
+ },
742
+ "chars": {
743
+ "name": "chars",
744
+ "type": "integer",
745
+ "primaryKey": false,
746
+ "notNull": false
747
+ },
748
+ "media_kind": {
749
+ "name": "media_kind",
750
+ "type": "text",
751
+ "primaryKey": false,
752
+ "notNull": true,
753
+ "default": "'document'"
754
+ },
755
+ "created_at": {
756
+ "name": "created_at",
757
+ "type": "integer",
758
+ "primaryKey": false,
759
+ "notNull": true
760
+ },
761
+ "updated_at": {
762
+ "name": "updated_at",
763
+ "type": "integer",
764
+ "primaryKey": false,
765
+ "notNull": true
766
+ }
767
+ },
768
+ "indexes": {
769
+ "idx_media_site_post_id_position": {
770
+ "name": "idx_media_site_post_id_position",
771
+ "columns": [
772
+ {
773
+ "expression": "site_id",
774
+ "isExpression": false,
775
+ "asc": true,
776
+ "nulls": "last"
777
+ },
778
+ {
779
+ "expression": "post_id",
780
+ "isExpression": false,
781
+ "asc": true,
782
+ "nulls": "last"
783
+ },
784
+ {
785
+ "expression": "position",
786
+ "isExpression": false,
787
+ "asc": true,
788
+ "nulls": "last"
789
+ }
790
+ ],
791
+ "isUnique": false,
792
+ "concurrently": false,
793
+ "method": "btree",
794
+ "with": {}
795
+ },
796
+ "uq_media_site_post_position": {
797
+ "name": "uq_media_site_post_position",
798
+ "columns": [
799
+ {
800
+ "expression": "site_id",
801
+ "isExpression": false,
802
+ "asc": true,
803
+ "nulls": "last"
804
+ },
805
+ {
806
+ "expression": "post_id",
807
+ "isExpression": false,
808
+ "asc": true,
809
+ "nulls": "last"
810
+ },
811
+ {
812
+ "expression": "position",
813
+ "isExpression": false,
814
+ "asc": true,
815
+ "nulls": "last"
816
+ }
817
+ ],
818
+ "isUnique": true,
819
+ "where": "\"media\".\"post_id\" IS NOT NULL",
820
+ "concurrently": false,
821
+ "method": "btree",
822
+ "with": {}
823
+ },
824
+ "uq_media_provider_storage_key": {
825
+ "name": "uq_media_provider_storage_key",
826
+ "columns": [
827
+ {
828
+ "expression": "provider",
829
+ "isExpression": false,
830
+ "asc": true,
831
+ "nulls": "last"
832
+ },
833
+ {
834
+ "expression": "storage_key",
835
+ "isExpression": false,
836
+ "asc": true,
837
+ "nulls": "last"
838
+ }
839
+ ],
840
+ "isUnique": true,
841
+ "concurrently": false,
842
+ "method": "btree",
843
+ "with": {}
844
+ },
845
+ "idx_media_site_media_kind_post_id": {
846
+ "name": "idx_media_site_media_kind_post_id",
847
+ "columns": [
848
+ {
849
+ "expression": "site_id",
850
+ "isExpression": false,
851
+ "asc": true,
852
+ "nulls": "last"
853
+ },
854
+ {
855
+ "expression": "media_kind",
856
+ "isExpression": false,
857
+ "asc": true,
858
+ "nulls": "last"
859
+ },
860
+ {
861
+ "expression": "post_id",
862
+ "isExpression": false,
863
+ "asc": true,
864
+ "nulls": "last"
865
+ }
866
+ ],
867
+ "isUnique": false,
868
+ "concurrently": false,
869
+ "method": "btree",
870
+ "with": {}
871
+ }
872
+ },
873
+ "foreignKeys": {
874
+ "media_site_id_site_id_fk": {
875
+ "name": "media_site_id_site_id_fk",
876
+ "tableFrom": "media",
877
+ "tableTo": "site",
878
+ "columnsFrom": ["site_id"],
879
+ "columnsTo": ["id"],
880
+ "onDelete": "cascade",
881
+ "onUpdate": "no action"
882
+ },
883
+ "media_post_id_post_id_fk": {
884
+ "name": "media_post_id_post_id_fk",
885
+ "tableFrom": "media",
886
+ "tableTo": "post",
887
+ "columnsFrom": ["post_id"],
888
+ "columnsTo": ["id"],
889
+ "onDelete": "set null",
890
+ "onUpdate": "no action"
891
+ }
892
+ },
893
+ "compositePrimaryKeys": {},
894
+ "uniqueConstraints": {},
895
+ "policies": {},
896
+ "checkConstraints": {
897
+ "chk_media_size_positive": {
898
+ "name": "chk_media_size_positive",
899
+ "value": "\"media\".\"size\" > 0"
900
+ },
901
+ "chk_media_position_not_blank": {
902
+ "name": "chk_media_position_not_blank",
903
+ "value": "trim(\"media\".\"position\") <> ''"
904
+ },
905
+ "chk_media_dimensions_positive": {
906
+ "name": "chk_media_dimensions_positive",
907
+ "value": "(\n \"media\".\"width\" IS NULL OR \"media\".\"width\" > 0\n ) AND (\n \"media\".\"height\" IS NULL OR \"media\".\"height\" > 0\n )"
908
+ },
909
+ "chk_media_chars_nonnegative": {
910
+ "name": "chk_media_chars_nonnegative",
911
+ "value": "\"media\".\"chars\" IS NULL OR \"media\".\"chars\" >= 0"
912
+ }
913
+ },
914
+ "isRLSEnabled": false
915
+ },
916
+ "public.nav_item": {
917
+ "name": "nav_item",
918
+ "schema": "",
919
+ "columns": {
920
+ "id": {
921
+ "name": "id",
922
+ "type": "text",
923
+ "primaryKey": true,
924
+ "notNull": true
925
+ },
926
+ "site_id": {
927
+ "name": "site_id",
928
+ "type": "text",
929
+ "primaryKey": false,
930
+ "notNull": true
931
+ },
932
+ "type": {
933
+ "name": "type",
934
+ "type": "text",
935
+ "primaryKey": false,
936
+ "notNull": true,
937
+ "default": "'link'"
938
+ },
939
+ "system_key": {
940
+ "name": "system_key",
941
+ "type": "text",
942
+ "primaryKey": false,
943
+ "notNull": false
944
+ },
945
+ "collection_id": {
946
+ "name": "collection_id",
947
+ "type": "text",
948
+ "primaryKey": false,
949
+ "notNull": false
950
+ },
951
+ "smart_collection_id": {
952
+ "name": "smart_collection_id",
953
+ "type": "text",
954
+ "primaryKey": false,
955
+ "notNull": false
956
+ },
957
+ "post_id": {
958
+ "name": "post_id",
959
+ "type": "text",
960
+ "primaryKey": false,
961
+ "notNull": false
962
+ },
963
+ "label": {
964
+ "name": "label",
965
+ "type": "text",
966
+ "primaryKey": false,
967
+ "notNull": true
968
+ },
969
+ "url": {
970
+ "name": "url",
971
+ "type": "text",
972
+ "primaryKey": false,
973
+ "notNull": true
974
+ },
975
+ "placement": {
976
+ "name": "placement",
977
+ "type": "text",
978
+ "primaryKey": false,
979
+ "notNull": true,
980
+ "default": "'header'"
981
+ },
982
+ "position": {
983
+ "name": "position",
984
+ "type": "text",
985
+ "primaryKey": false,
986
+ "notNull": true,
987
+ "default": "'a0'"
988
+ },
989
+ "created_at": {
990
+ "name": "created_at",
991
+ "type": "integer",
992
+ "primaryKey": false,
993
+ "notNull": true
994
+ },
995
+ "updated_at": {
996
+ "name": "updated_at",
997
+ "type": "integer",
998
+ "primaryKey": false,
999
+ "notNull": true
1000
+ }
1001
+ },
1002
+ "indexes": {
1003
+ "uq_nav_item_site_position": {
1004
+ "name": "uq_nav_item_site_position",
1005
+ "columns": [
1006
+ {
1007
+ "expression": "site_id",
1008
+ "isExpression": false,
1009
+ "asc": true,
1010
+ "nulls": "last"
1011
+ },
1012
+ {
1013
+ "expression": "position",
1014
+ "isExpression": false,
1015
+ "asc": true,
1016
+ "nulls": "last"
1017
+ }
1018
+ ],
1019
+ "isUnique": true,
1020
+ "concurrently": false,
1021
+ "method": "btree",
1022
+ "with": {}
1023
+ },
1024
+ "uq_nav_item_site_system_key": {
1025
+ "name": "uq_nav_item_site_system_key",
1026
+ "columns": [
1027
+ {
1028
+ "expression": "site_id",
1029
+ "isExpression": false,
1030
+ "asc": true,
1031
+ "nulls": "last"
1032
+ },
1033
+ {
1034
+ "expression": "system_key",
1035
+ "isExpression": false,
1036
+ "asc": true,
1037
+ "nulls": "last"
1038
+ }
1039
+ ],
1040
+ "isUnique": true,
1041
+ "where": "\"nav_item\".\"system_key\" IS NOT NULL",
1042
+ "concurrently": false,
1043
+ "method": "btree",
1044
+ "with": {}
1045
+ },
1046
+ "uq_nav_item_site_collection_id": {
1047
+ "name": "uq_nav_item_site_collection_id",
1048
+ "columns": [
1049
+ {
1050
+ "expression": "site_id",
1051
+ "isExpression": false,
1052
+ "asc": true,
1053
+ "nulls": "last"
1054
+ },
1055
+ {
1056
+ "expression": "collection_id",
1057
+ "isExpression": false,
1058
+ "asc": true,
1059
+ "nulls": "last"
1060
+ }
1061
+ ],
1062
+ "isUnique": true,
1063
+ "where": "\"nav_item\".\"collection_id\" IS NOT NULL",
1064
+ "concurrently": false,
1065
+ "method": "btree",
1066
+ "with": {}
1067
+ },
1068
+ "uq_nav_item_site_smart_collection_id": {
1069
+ "name": "uq_nav_item_site_smart_collection_id",
1070
+ "columns": [
1071
+ {
1072
+ "expression": "site_id",
1073
+ "isExpression": false,
1074
+ "asc": true,
1075
+ "nulls": "last"
1076
+ },
1077
+ {
1078
+ "expression": "smart_collection_id",
1079
+ "isExpression": false,
1080
+ "asc": true,
1081
+ "nulls": "last"
1082
+ }
1083
+ ],
1084
+ "isUnique": true,
1085
+ "where": "\"nav_item\".\"smart_collection_id\" IS NOT NULL",
1086
+ "concurrently": false,
1087
+ "method": "btree",
1088
+ "with": {}
1089
+ },
1090
+ "uq_nav_item_site_post_id": {
1091
+ "name": "uq_nav_item_site_post_id",
1092
+ "columns": [
1093
+ {
1094
+ "expression": "site_id",
1095
+ "isExpression": false,
1096
+ "asc": true,
1097
+ "nulls": "last"
1098
+ },
1099
+ {
1100
+ "expression": "post_id",
1101
+ "isExpression": false,
1102
+ "asc": true,
1103
+ "nulls": "last"
1104
+ }
1105
+ ],
1106
+ "isUnique": true,
1107
+ "where": "\"nav_item\".\"post_id\" IS NOT NULL",
1108
+ "concurrently": false,
1109
+ "method": "btree",
1110
+ "with": {}
1111
+ }
1112
+ },
1113
+ "foreignKeys": {
1114
+ "nav_item_site_id_site_id_fk": {
1115
+ "name": "nav_item_site_id_site_id_fk",
1116
+ "tableFrom": "nav_item",
1117
+ "tableTo": "site",
1118
+ "columnsFrom": ["site_id"],
1119
+ "columnsTo": ["id"],
1120
+ "onDelete": "cascade",
1121
+ "onUpdate": "no action"
1122
+ },
1123
+ "nav_item_collection_id_collection_id_fk": {
1124
+ "name": "nav_item_collection_id_collection_id_fk",
1125
+ "tableFrom": "nav_item",
1126
+ "tableTo": "collection",
1127
+ "columnsFrom": ["collection_id"],
1128
+ "columnsTo": ["id"],
1129
+ "onDelete": "cascade",
1130
+ "onUpdate": "no action"
1131
+ },
1132
+ "nav_item_smart_collection_id_smart_collection_id_fk": {
1133
+ "name": "nav_item_smart_collection_id_smart_collection_id_fk",
1134
+ "tableFrom": "nav_item",
1135
+ "tableTo": "smart_collection",
1136
+ "columnsFrom": ["smart_collection_id"],
1137
+ "columnsTo": ["id"],
1138
+ "onDelete": "cascade",
1139
+ "onUpdate": "no action"
1140
+ },
1141
+ "nav_item_post_id_post_id_fk": {
1142
+ "name": "nav_item_post_id_post_id_fk",
1143
+ "tableFrom": "nav_item",
1144
+ "tableTo": "post",
1145
+ "columnsFrom": ["post_id"],
1146
+ "columnsTo": ["id"],
1147
+ "onDelete": "cascade",
1148
+ "onUpdate": "no action"
1149
+ }
1150
+ },
1151
+ "compositePrimaryKeys": {},
1152
+ "uniqueConstraints": {},
1153
+ "policies": {},
1154
+ "checkConstraints": {
1155
+ "chk_nav_item_type": {
1156
+ "name": "chk_nav_item_type",
1157
+ "value": "\"nav_item\".\"type\" IN ('link', 'system', 'collection', 'smart_collection', 'page')"
1158
+ },
1159
+ "chk_nav_item_placement": {
1160
+ "name": "chk_nav_item_placement",
1161
+ "value": "\"nav_item\".\"placement\" IN ('header', 'more')"
1162
+ },
1163
+ "chk_nav_item_shape": {
1164
+ "name": "chk_nav_item_shape",
1165
+ "value": "(\n \"nav_item\".\"type\" = 'link'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n AND \"nav_item\".\"smart_collection_id\" IS NULL\n AND \"nav_item\".\"post_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'system'\n AND \"nav_item\".\"system_key\" IS NOT NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n AND \"nav_item\".\"smart_collection_id\" IS NULL\n AND \"nav_item\".\"post_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'collection'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NOT NULL\n AND \"nav_item\".\"smart_collection_id\" IS NULL\n AND \"nav_item\".\"post_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'smart_collection'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n AND \"nav_item\".\"smart_collection_id\" IS NOT NULL\n AND \"nav_item\".\"post_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'page'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n AND \"nav_item\".\"smart_collection_id\" IS NULL\n AND \"nav_item\".\"post_id\" IS NOT NULL\n )"
1166
+ }
1167
+ },
1168
+ "isRLSEnabled": false
1169
+ },
1170
+ "public.path_registry": {
1171
+ "name": "path_registry",
1172
+ "schema": "",
1173
+ "columns": {
1174
+ "id": {
1175
+ "name": "id",
1176
+ "type": "text",
1177
+ "primaryKey": true,
1178
+ "notNull": true
1179
+ },
1180
+ "site_id": {
1181
+ "name": "site_id",
1182
+ "type": "text",
1183
+ "primaryKey": false,
1184
+ "notNull": true
1185
+ },
1186
+ "path": {
1187
+ "name": "path",
1188
+ "type": "text",
1189
+ "primaryKey": false,
1190
+ "notNull": true
1191
+ },
1192
+ "kind": {
1193
+ "name": "kind",
1194
+ "type": "text",
1195
+ "primaryKey": false,
1196
+ "notNull": true
1197
+ },
1198
+ "post_id": {
1199
+ "name": "post_id",
1200
+ "type": "text",
1201
+ "primaryKey": false,
1202
+ "notNull": false
1203
+ },
1204
+ "collection_id": {
1205
+ "name": "collection_id",
1206
+ "type": "text",
1207
+ "primaryKey": false,
1208
+ "notNull": false
1209
+ },
1210
+ "smart_collection_id": {
1211
+ "name": "smart_collection_id",
1212
+ "type": "text",
1213
+ "primaryKey": false,
1214
+ "notNull": false
1215
+ },
1216
+ "redirect_to_path": {
1217
+ "name": "redirect_to_path",
1218
+ "type": "text",
1219
+ "primaryKey": false,
1220
+ "notNull": false
1221
+ },
1222
+ "redirect_type": {
1223
+ "name": "redirect_type",
1224
+ "type": "integer",
1225
+ "primaryKey": false,
1226
+ "notNull": false
1227
+ },
1228
+ "archive_query": {
1229
+ "name": "archive_query",
1230
+ "type": "text",
1231
+ "primaryKey": false,
1232
+ "notNull": false
1233
+ },
1234
+ "created_at": {
1235
+ "name": "created_at",
1236
+ "type": "integer",
1237
+ "primaryKey": false,
1238
+ "notNull": true
1239
+ },
1240
+ "updated_at": {
1241
+ "name": "updated_at",
1242
+ "type": "integer",
1243
+ "primaryKey": false,
1244
+ "notNull": true
1245
+ }
1246
+ },
1247
+ "indexes": {
1248
+ "uq_path_registry_site_path": {
1249
+ "name": "uq_path_registry_site_path",
1250
+ "columns": [
1251
+ {
1252
+ "expression": "site_id",
1253
+ "isExpression": false,
1254
+ "asc": true,
1255
+ "nulls": "last"
1256
+ },
1257
+ {
1258
+ "expression": "path",
1259
+ "isExpression": false,
1260
+ "asc": true,
1261
+ "nulls": "last"
1262
+ }
1263
+ ],
1264
+ "isUnique": true,
1265
+ "concurrently": false,
1266
+ "method": "btree",
1267
+ "with": {}
1268
+ },
1269
+ "uq_path_registry_site_post_slug": {
1270
+ "name": "uq_path_registry_site_post_slug",
1271
+ "columns": [
1272
+ {
1273
+ "expression": "site_id",
1274
+ "isExpression": false,
1275
+ "asc": true,
1276
+ "nulls": "last"
1277
+ },
1278
+ {
1279
+ "expression": "post_id",
1280
+ "isExpression": false,
1281
+ "asc": true,
1282
+ "nulls": "last"
1283
+ }
1284
+ ],
1285
+ "isUnique": true,
1286
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"post_id\" IS NOT NULL",
1287
+ "concurrently": false,
1288
+ "method": "btree",
1289
+ "with": {}
1290
+ },
1291
+ "uq_path_registry_site_collection_slug": {
1292
+ "name": "uq_path_registry_site_collection_slug",
1293
+ "columns": [
1294
+ {
1295
+ "expression": "site_id",
1296
+ "isExpression": false,
1297
+ "asc": true,
1298
+ "nulls": "last"
1299
+ },
1300
+ {
1301
+ "expression": "collection_id",
1302
+ "isExpression": false,
1303
+ "asc": true,
1304
+ "nulls": "last"
1305
+ }
1306
+ ],
1307
+ "isUnique": true,
1308
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"collection_id\" IS NOT NULL",
1309
+ "concurrently": false,
1310
+ "method": "btree",
1311
+ "with": {}
1312
+ },
1313
+ "uq_path_registry_site_smart_collection_slug": {
1314
+ "name": "uq_path_registry_site_smart_collection_slug",
1315
+ "columns": [
1316
+ {
1317
+ "expression": "site_id",
1318
+ "isExpression": false,
1319
+ "asc": true,
1320
+ "nulls": "last"
1321
+ },
1322
+ {
1323
+ "expression": "smart_collection_id",
1324
+ "isExpression": false,
1325
+ "asc": true,
1326
+ "nulls": "last"
1327
+ }
1328
+ ],
1329
+ "isUnique": true,
1330
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"smart_collection_id\" IS NOT NULL",
1331
+ "concurrently": false,
1332
+ "method": "btree",
1333
+ "with": {}
1334
+ },
1335
+ "idx_path_registry_site_post_id": {
1336
+ "name": "idx_path_registry_site_post_id",
1337
+ "columns": [
1338
+ {
1339
+ "expression": "site_id",
1340
+ "isExpression": false,
1341
+ "asc": true,
1342
+ "nulls": "last"
1343
+ },
1344
+ {
1345
+ "expression": "post_id",
1346
+ "isExpression": false,
1347
+ "asc": true,
1348
+ "nulls": "last"
1349
+ }
1350
+ ],
1351
+ "isUnique": false,
1352
+ "concurrently": false,
1353
+ "method": "btree",
1354
+ "with": {}
1355
+ },
1356
+ "idx_path_registry_site_collection_id": {
1357
+ "name": "idx_path_registry_site_collection_id",
1358
+ "columns": [
1359
+ {
1360
+ "expression": "site_id",
1361
+ "isExpression": false,
1362
+ "asc": true,
1363
+ "nulls": "last"
1364
+ },
1365
+ {
1366
+ "expression": "collection_id",
1367
+ "isExpression": false,
1368
+ "asc": true,
1369
+ "nulls": "last"
1370
+ }
1371
+ ],
1372
+ "isUnique": false,
1373
+ "concurrently": false,
1374
+ "method": "btree",
1375
+ "with": {}
1376
+ },
1377
+ "idx_path_registry_site_smart_collection_id": {
1378
+ "name": "idx_path_registry_site_smart_collection_id",
1379
+ "columns": [
1380
+ {
1381
+ "expression": "site_id",
1382
+ "isExpression": false,
1383
+ "asc": true,
1384
+ "nulls": "last"
1385
+ },
1386
+ {
1387
+ "expression": "smart_collection_id",
1388
+ "isExpression": false,
1389
+ "asc": true,
1390
+ "nulls": "last"
1391
+ }
1392
+ ],
1393
+ "isUnique": false,
1394
+ "concurrently": false,
1395
+ "method": "btree",
1396
+ "with": {}
1397
+ }
1398
+ },
1399
+ "foreignKeys": {
1400
+ "path_registry_site_id_site_id_fk": {
1401
+ "name": "path_registry_site_id_site_id_fk",
1402
+ "tableFrom": "path_registry",
1403
+ "tableTo": "site",
1404
+ "columnsFrom": ["site_id"],
1405
+ "columnsTo": ["id"],
1406
+ "onDelete": "cascade",
1407
+ "onUpdate": "no action"
1408
+ },
1409
+ "path_registry_post_id_post_id_fk": {
1410
+ "name": "path_registry_post_id_post_id_fk",
1411
+ "tableFrom": "path_registry",
1412
+ "tableTo": "post",
1413
+ "columnsFrom": ["post_id"],
1414
+ "columnsTo": ["id"],
1415
+ "onDelete": "cascade",
1416
+ "onUpdate": "no action"
1417
+ },
1418
+ "path_registry_collection_id_collection_id_fk": {
1419
+ "name": "path_registry_collection_id_collection_id_fk",
1420
+ "tableFrom": "path_registry",
1421
+ "tableTo": "collection",
1422
+ "columnsFrom": ["collection_id"],
1423
+ "columnsTo": ["id"],
1424
+ "onDelete": "cascade",
1425
+ "onUpdate": "no action"
1426
+ },
1427
+ "path_registry_smart_collection_id_smart_collection_id_fk": {
1428
+ "name": "path_registry_smart_collection_id_smart_collection_id_fk",
1429
+ "tableFrom": "path_registry",
1430
+ "tableTo": "smart_collection",
1431
+ "columnsFrom": ["smart_collection_id"],
1432
+ "columnsTo": ["id"],
1433
+ "onDelete": "cascade",
1434
+ "onUpdate": "no action"
1435
+ }
1436
+ },
1437
+ "compositePrimaryKeys": {},
1438
+ "uniqueConstraints": {},
1439
+ "policies": {},
1440
+ "checkConstraints": {
1441
+ "chk_path_registry_kind": {
1442
+ "name": "chk_path_registry_kind",
1443
+ "value": "\"path_registry\".\"kind\" IN ('slug', 'alias', 'redirect', 'archive')"
1444
+ },
1445
+ "chk_path_registry_shape": {
1446
+ "name": "chk_path_registry_shape",
1447
+ "value": "(\n \"path_registry\".\"kind\" IN ('slug', 'alias')\n AND (\n (\"path_registry\".\"post_id\" IS NOT NULL AND \"path_registry\".\"collection_id\" IS NULL AND \"path_registry\".\"smart_collection_id\" IS NULL)\n OR (\"path_registry\".\"post_id\" IS NULL AND \"path_registry\".\"collection_id\" IS NOT NULL AND \"path_registry\".\"smart_collection_id\" IS NULL)\n OR (\"path_registry\".\"post_id\" IS NULL AND \"path_registry\".\"collection_id\" IS NULL AND \"path_registry\".\"smart_collection_id\" IS NOT NULL)\n )\n AND \"path_registry\".\"redirect_to_path\" IS NULL\n AND \"path_registry\".\"redirect_type\" IS NULL\n AND \"path_registry\".\"archive_query\" IS NULL\n ) OR (\n \"path_registry\".\"kind\" = 'redirect'\n AND \"path_registry\".\"post_id\" IS NULL\n AND \"path_registry\".\"collection_id\" IS NULL\n AND \"path_registry\".\"smart_collection_id\" IS NULL\n AND \"path_registry\".\"redirect_to_path\" IS NOT NULL\n AND \"path_registry\".\"redirect_type\" IN (301, 302)\n AND \"path_registry\".\"archive_query\" IS NULL\n ) OR (\n \"path_registry\".\"kind\" = 'archive'\n AND \"path_registry\".\"post_id\" IS NULL\n AND \"path_registry\".\"collection_id\" IS NULL\n AND \"path_registry\".\"smart_collection_id\" IS NULL\n AND \"path_registry\".\"redirect_to_path\" IS NULL\n AND \"path_registry\".\"redirect_type\" IS NULL\n AND \"path_registry\".\"archive_query\" IS NOT NULL\n )"
1448
+ }
1449
+ },
1450
+ "isRLSEnabled": false
1451
+ },
1452
+ "public.post": {
1453
+ "name": "post",
1454
+ "schema": "",
1455
+ "columns": {
1456
+ "id": {
1457
+ "name": "id",
1458
+ "type": "text",
1459
+ "primaryKey": true,
1460
+ "notNull": true
1461
+ },
1462
+ "site_id": {
1463
+ "name": "site_id",
1464
+ "type": "text",
1465
+ "primaryKey": false,
1466
+ "notNull": true
1467
+ },
1468
+ "format": {
1469
+ "name": "format",
1470
+ "type": "text",
1471
+ "primaryKey": false,
1472
+ "notNull": true
1473
+ },
1474
+ "status": {
1475
+ "name": "status",
1476
+ "type": "text",
1477
+ "primaryKey": false,
1478
+ "notNull": true,
1479
+ "default": "'published'"
1480
+ },
1481
+ "visibility": {
1482
+ "name": "visibility",
1483
+ "type": "text",
1484
+ "primaryKey": false,
1485
+ "notNull": false,
1486
+ "default": "'public'"
1487
+ },
1488
+ "pinned_at": {
1489
+ "name": "pinned_at",
1490
+ "type": "integer",
1491
+ "primaryKey": false,
1492
+ "notNull": false
1493
+ },
1494
+ "featured_at": {
1495
+ "name": "featured_at",
1496
+ "type": "integer",
1497
+ "primaryKey": false,
1498
+ "notNull": false
1499
+ },
1500
+ "title": {
1501
+ "name": "title",
1502
+ "type": "text",
1503
+ "primaryKey": false,
1504
+ "notNull": false
1505
+ },
1506
+ "url": {
1507
+ "name": "url",
1508
+ "type": "text",
1509
+ "primaryKey": false,
1510
+ "notNull": false
1511
+ },
1512
+ "body": {
1513
+ "name": "body",
1514
+ "type": "text",
1515
+ "primaryKey": false,
1516
+ "notNull": false
1517
+ },
1518
+ "body_html": {
1519
+ "name": "body_html",
1520
+ "type": "text",
1521
+ "primaryKey": false,
1522
+ "notNull": false
1523
+ },
1524
+ "body_html_version": {
1525
+ "name": "body_html_version",
1526
+ "type": "integer",
1527
+ "primaryKey": false,
1528
+ "notNull": true,
1529
+ "default": 1
1530
+ },
1531
+ "body_text": {
1532
+ "name": "body_text",
1533
+ "type": "text",
1534
+ "primaryKey": false,
1535
+ "notNull": false
1536
+ },
1537
+ "quote_text": {
1538
+ "name": "quote_text",
1539
+ "type": "text",
1540
+ "primaryKey": false,
1541
+ "notNull": false
1542
+ },
1543
+ "summary": {
1544
+ "name": "summary",
1545
+ "type": "text",
1546
+ "primaryKey": false,
1547
+ "notNull": false
1548
+ },
1549
+ "search_text": {
1550
+ "name": "search_text",
1551
+ "type": "text",
1552
+ "primaryKey": false,
1553
+ "notNull": false,
1554
+ "generated": {
1555
+ "as": "coalesce(\"title\", '') || ' ' || coalesce(\"url\", '') || ' ' || coalesce(\"quote_text\", '') || ' ' || coalesce(\"body_text\", '')",
1556
+ "type": "stored"
1557
+ }
1558
+ },
1559
+ "search_document": {
1560
+ "name": "search_document",
1561
+ "type": "tsvector",
1562
+ "primaryKey": false,
1563
+ "notNull": false,
1564
+ "generated": {
1565
+ "as": "setweight(to_tsvector('simple', coalesce(\"title\", '')), 'A') ||\n setweight(to_tsvector('simple', coalesce(\"url\", '')), 'A') ||\n setweight(to_tsvector('simple', coalesce(\"quote_text\", '')), 'B') ||\n setweight(to_tsvector('simple', coalesce(\"body_text\", '')), 'C')",
1566
+ "type": "stored"
1567
+ }
1568
+ },
1569
+ "rating": {
1570
+ "name": "rating",
1571
+ "type": "integer",
1572
+ "primaryKey": false,
1573
+ "notNull": false
1574
+ },
1575
+ "preview_image_key": {
1576
+ "name": "preview_image_key",
1577
+ "type": "text",
1578
+ "primaryKey": false,
1579
+ "notNull": false
1580
+ },
1581
+ "preview_kind": {
1582
+ "name": "preview_kind",
1583
+ "type": "text",
1584
+ "primaryKey": false,
1585
+ "notNull": false
1586
+ },
1587
+ "preview_provider": {
1588
+ "name": "preview_provider",
1589
+ "type": "text",
1590
+ "primaryKey": false,
1591
+ "notNull": false
1592
+ },
1593
+ "reply_to_id": {
1594
+ "name": "reply_to_id",
1595
+ "type": "text",
1596
+ "primaryKey": false,
1597
+ "notNull": false
1598
+ },
1599
+ "thread_id": {
1600
+ "name": "thread_id",
1601
+ "type": "text",
1602
+ "primaryKey": false,
1603
+ "notNull": true
1604
+ },
1605
+ "language": {
1606
+ "name": "language",
1607
+ "type": "text",
1608
+ "primaryKey": false,
1609
+ "notNull": false
1610
+ },
1611
+ "translation_group_id": {
1612
+ "name": "translation_group_id",
1613
+ "type": "text",
1614
+ "primaryKey": false,
1615
+ "notNull": false
1616
+ },
1617
+ "quiet_reply": {
1618
+ "name": "quiet_reply",
1619
+ "type": "boolean",
1620
+ "primaryKey": false,
1621
+ "notNull": true,
1622
+ "default": false
1623
+ },
1624
+ "published_at": {
1625
+ "name": "published_at",
1626
+ "type": "integer",
1627
+ "primaryKey": false,
1628
+ "notNull": false
1629
+ },
1630
+ "last_activity_at": {
1631
+ "name": "last_activity_at",
1632
+ "type": "integer",
1633
+ "primaryKey": false,
1634
+ "notNull": false
1635
+ },
1636
+ "thread_updated_at": {
1637
+ "name": "thread_updated_at",
1638
+ "type": "integer",
1639
+ "primaryKey": false,
1640
+ "notNull": false
1641
+ },
1642
+ "created_at": {
1643
+ "name": "created_at",
1644
+ "type": "integer",
1645
+ "primaryKey": false,
1646
+ "notNull": true
1647
+ },
1648
+ "updated_at": {
1649
+ "name": "updated_at",
1650
+ "type": "integer",
1651
+ "primaryKey": false,
1652
+ "notNull": true
1653
+ }
1654
+ },
1655
+ "indexes": {
1656
+ "idx_post_site_thread_id": {
1657
+ "name": "idx_post_site_thread_id",
1658
+ "columns": [
1659
+ {
1660
+ "expression": "site_id",
1661
+ "isExpression": false,
1662
+ "asc": true,
1663
+ "nulls": "last"
1664
+ },
1665
+ {
1666
+ "expression": "thread_id",
1667
+ "isExpression": false,
1668
+ "asc": true,
1669
+ "nulls": "last"
1670
+ }
1671
+ ],
1672
+ "isUnique": false,
1673
+ "concurrently": false,
1674
+ "method": "btree",
1675
+ "with": {}
1676
+ },
1677
+ "idx_post_site_thread_created": {
1678
+ "name": "idx_post_site_thread_created",
1679
+ "columns": [
1680
+ {
1681
+ "expression": "site_id",
1682
+ "isExpression": false,
1683
+ "asc": true,
1684
+ "nulls": "last"
1685
+ },
1686
+ {
1687
+ "expression": "thread_id",
1688
+ "isExpression": false,
1689
+ "asc": true,
1690
+ "nulls": "last"
1691
+ },
1692
+ {
1693
+ "expression": "created_at",
1694
+ "isExpression": false,
1695
+ "asc": true,
1696
+ "nulls": "last"
1697
+ },
1698
+ {
1699
+ "expression": "id",
1700
+ "isExpression": false,
1701
+ "asc": true,
1702
+ "nulls": "last"
1703
+ }
1704
+ ],
1705
+ "isUnique": false,
1706
+ "concurrently": false,
1707
+ "method": "btree",
1708
+ "with": {}
1709
+ },
1710
+ "idx_post_site_status_published": {
1711
+ "name": "idx_post_site_status_published",
1712
+ "columns": [
1713
+ {
1714
+ "expression": "site_id",
1715
+ "isExpression": false,
1716
+ "asc": true,
1717
+ "nulls": "last"
1718
+ },
1719
+ {
1720
+ "expression": "status",
1721
+ "isExpression": false,
1722
+ "asc": true,
1723
+ "nulls": "last"
1724
+ },
1725
+ {
1726
+ "expression": "published_at",
1727
+ "isExpression": false,
1728
+ "asc": true,
1729
+ "nulls": "last"
1730
+ }
1731
+ ],
1732
+ "isUnique": false,
1733
+ "concurrently": false,
1734
+ "method": "btree",
1735
+ "with": {}
1736
+ },
1737
+ "idx_post_site_status_activity": {
1738
+ "name": "idx_post_site_status_activity",
1739
+ "columns": [
1740
+ {
1741
+ "expression": "site_id",
1742
+ "isExpression": false,
1743
+ "asc": true,
1744
+ "nulls": "last"
1745
+ },
1746
+ {
1747
+ "expression": "status",
1748
+ "isExpression": false,
1749
+ "asc": true,
1750
+ "nulls": "last"
1751
+ },
1752
+ {
1753
+ "expression": "last_activity_at",
1754
+ "isExpression": false,
1755
+ "asc": true,
1756
+ "nulls": "last"
1757
+ }
1758
+ ],
1759
+ "isUnique": false,
1760
+ "concurrently": false,
1761
+ "method": "btree",
1762
+ "with": {}
1763
+ },
1764
+ "idx_post_site_root_published_activity": {
1765
+ "name": "idx_post_site_root_published_activity",
1766
+ "columns": [
1767
+ {
1768
+ "expression": "site_id",
1769
+ "isExpression": false,
1770
+ "asc": true,
1771
+ "nulls": "last"
1772
+ },
1773
+ {
1774
+ "expression": "last_activity_at",
1775
+ "isExpression": false,
1776
+ "asc": true,
1777
+ "nulls": "last"
1778
+ },
1779
+ {
1780
+ "expression": "id",
1781
+ "isExpression": false,
1782
+ "asc": true,
1783
+ "nulls": "last"
1784
+ }
1785
+ ],
1786
+ "isUnique": false,
1787
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'",
1788
+ "concurrently": false,
1789
+ "method": "btree",
1790
+ "with": {}
1791
+ },
1792
+ "idx_post_site_root_thread_updated": {
1793
+ "name": "idx_post_site_root_thread_updated",
1794
+ "columns": [
1795
+ {
1796
+ "expression": "site_id",
1797
+ "isExpression": false,
1798
+ "asc": true,
1799
+ "nulls": "last"
1800
+ },
1801
+ {
1802
+ "expression": "thread_updated_at",
1803
+ "isExpression": false,
1804
+ "asc": true,
1805
+ "nulls": "last"
1806
+ },
1807
+ {
1808
+ "expression": "id",
1809
+ "isExpression": false,
1810
+ "asc": true,
1811
+ "nulls": "last"
1812
+ }
1813
+ ],
1814
+ "isUnique": false,
1815
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'",
1816
+ "concurrently": false,
1817
+ "method": "btree",
1818
+ "with": {}
1819
+ },
1820
+ "idx_post_site_root_draft_updated": {
1821
+ "name": "idx_post_site_root_draft_updated",
1822
+ "columns": [
1823
+ {
1824
+ "expression": "site_id",
1825
+ "isExpression": false,
1826
+ "asc": true,
1827
+ "nulls": "last"
1828
+ },
1829
+ {
1830
+ "expression": "updated_at",
1831
+ "isExpression": false,
1832
+ "asc": true,
1833
+ "nulls": "last"
1834
+ },
1835
+ {
1836
+ "expression": "id",
1837
+ "isExpression": false,
1838
+ "asc": true,
1839
+ "nulls": "last"
1840
+ }
1841
+ ],
1842
+ "isUnique": false,
1843
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'draft'",
1844
+ "concurrently": false,
1845
+ "method": "btree",
1846
+ "with": {}
1847
+ },
1848
+ "idx_post_site_reply_thread_created": {
1849
+ "name": "idx_post_site_reply_thread_created",
1850
+ "columns": [
1851
+ {
1852
+ "expression": "site_id",
1853
+ "isExpression": false,
1854
+ "asc": true,
1855
+ "nulls": "last"
1856
+ },
1857
+ {
1858
+ "expression": "thread_id",
1859
+ "isExpression": false,
1860
+ "asc": true,
1861
+ "nulls": "last"
1862
+ },
1863
+ {
1864
+ "expression": "created_at",
1865
+ "isExpression": false,
1866
+ "asc": true,
1867
+ "nulls": "last"
1868
+ },
1869
+ {
1870
+ "expression": "id",
1871
+ "isExpression": false,
1872
+ "asc": true,
1873
+ "nulls": "last"
1874
+ }
1875
+ ],
1876
+ "isUnique": false,
1877
+ "where": "\"post\".\"reply_to_id\" IS NOT NULL AND \"post\".\"status\" = 'published'",
1878
+ "concurrently": false,
1879
+ "method": "btree",
1880
+ "with": {}
1881
+ },
1882
+ "idx_post_site_featured_thread_published": {
1883
+ "name": "idx_post_site_featured_thread_published",
1884
+ "columns": [
1885
+ {
1886
+ "expression": "site_id",
1887
+ "isExpression": false,
1888
+ "asc": true,
1889
+ "nulls": "last"
1890
+ },
1891
+ {
1892
+ "expression": "thread_id",
1893
+ "isExpression": false,
1894
+ "asc": true,
1895
+ "nulls": "last"
1896
+ },
1897
+ {
1898
+ "expression": "published_at",
1899
+ "isExpression": false,
1900
+ "asc": true,
1901
+ "nulls": "last"
1902
+ },
1903
+ {
1904
+ "expression": "id",
1905
+ "isExpression": false,
1906
+ "asc": true,
1907
+ "nulls": "last"
1908
+ }
1909
+ ],
1910
+ "isUnique": false,
1911
+ "where": "\"post\".\"status\" = 'published' AND \"post\".\"featured_at\" IS NOT NULL",
1912
+ "concurrently": false,
1913
+ "method": "btree",
1914
+ "with": {}
1915
+ },
1916
+ "uq_post_site_translation_group_language": {
1917
+ "name": "uq_post_site_translation_group_language",
1918
+ "columns": [
1919
+ {
1920
+ "expression": "site_id",
1921
+ "isExpression": false,
1922
+ "asc": true,
1923
+ "nulls": "last"
1924
+ },
1925
+ {
1926
+ "expression": "translation_group_id",
1927
+ "isExpression": false,
1928
+ "asc": true,
1929
+ "nulls": "last"
1930
+ },
1931
+ {
1932
+ "expression": "language",
1933
+ "isExpression": false,
1934
+ "asc": true,
1935
+ "nulls": "last"
1936
+ }
1937
+ ],
1938
+ "isUnique": true,
1939
+ "where": "\"post\".\"translation_group_id\" IS NOT NULL",
1940
+ "concurrently": false,
1941
+ "method": "btree",
1942
+ "with": {}
1943
+ },
1944
+ "idx_post_search_document": {
1945
+ "name": "idx_post_search_document",
1946
+ "columns": [
1947
+ {
1948
+ "expression": "search_document",
1949
+ "isExpression": false,
1950
+ "asc": true,
1951
+ "nulls": "last"
1952
+ }
1953
+ ],
1954
+ "isUnique": false,
1955
+ "concurrently": false,
1956
+ "method": "gin",
1957
+ "with": {}
1958
+ },
1959
+ "idx_post_search_text_trgm": {
1960
+ "name": "idx_post_search_text_trgm",
1961
+ "columns": [
1962
+ {
1963
+ "expression": "search_text",
1964
+ "isExpression": false,
1965
+ "asc": true,
1966
+ "nulls": "last",
1967
+ "opclass": "gin_trgm_ops"
1968
+ }
1969
+ ],
1970
+ "isUnique": false,
1971
+ "concurrently": false,
1972
+ "method": "gin",
1973
+ "with": {}
1974
+ }
1975
+ },
1976
+ "foreignKeys": {
1977
+ "post_site_id_site_id_fk": {
1978
+ "name": "post_site_id_site_id_fk",
1979
+ "tableFrom": "post",
1980
+ "tableTo": "site",
1981
+ "columnsFrom": ["site_id"],
1982
+ "columnsTo": ["id"],
1983
+ "onDelete": "cascade",
1984
+ "onUpdate": "no action"
1985
+ },
1986
+ "post_site_id_reply_to_id_post_site_id_id_fk": {
1987
+ "name": "post_site_id_reply_to_id_post_site_id_id_fk",
1988
+ "tableFrom": "post",
1989
+ "tableTo": "post",
1990
+ "columnsFrom": ["site_id", "reply_to_id"],
1991
+ "columnsTo": ["site_id", "id"],
1992
+ "onDelete": "no action",
1993
+ "onUpdate": "no action"
1994
+ },
1995
+ "post_site_id_thread_id_post_site_id_id_fk": {
1996
+ "name": "post_site_id_thread_id_post_site_id_id_fk",
1997
+ "tableFrom": "post",
1998
+ "tableTo": "post",
1999
+ "columnsFrom": ["site_id", "thread_id"],
2000
+ "columnsTo": ["site_id", "id"],
2001
+ "onDelete": "no action",
2002
+ "onUpdate": "no action"
2003
+ }
2004
+ },
2005
+ "compositePrimaryKeys": {},
2006
+ "uniqueConstraints": {
2007
+ "uq_post_site_id_id": {
2008
+ "name": "uq_post_site_id_id",
2009
+ "nullsNotDistinct": false,
2010
+ "columns": ["site_id", "id"]
2011
+ }
2012
+ },
2013
+ "policies": {},
2014
+ "checkConstraints": {
2015
+ "chk_post_reply_to_not_self": {
2016
+ "name": "chk_post_reply_to_not_self",
2017
+ "value": "\"post\".\"reply_to_id\" IS NULL OR \"post\".\"reply_to_id\" <> \"post\".\"id\""
2018
+ },
2019
+ "chk_post_thread_shape": {
2020
+ "name": "chk_post_thread_shape",
2021
+ "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 )"
2022
+ }
2023
+ },
2024
+ "isRLSEnabled": false
2025
+ },
2026
+ "public.rate_limit": {
2027
+ "name": "rate_limit",
2028
+ "schema": "",
2029
+ "columns": {
2030
+ "key": {
2031
+ "name": "key",
2032
+ "type": "text",
2033
+ "primaryKey": false,
2034
+ "notNull": true
2035
+ },
2036
+ "window_start": {
2037
+ "name": "window_start",
2038
+ "type": "integer",
2039
+ "primaryKey": false,
2040
+ "notNull": true
2041
+ },
2042
+ "count": {
2043
+ "name": "count",
2044
+ "type": "integer",
2045
+ "primaryKey": false,
2046
+ "notNull": true,
2047
+ "default": 0
2048
+ }
2049
+ },
2050
+ "indexes": {},
2051
+ "foreignKeys": {},
2052
+ "compositePrimaryKeys": {
2053
+ "rate_limit_key_window_start_pk": {
2054
+ "name": "rate_limit_key_window_start_pk",
2055
+ "columns": ["key", "window_start"]
2056
+ }
2057
+ },
2058
+ "uniqueConstraints": {},
2059
+ "policies": {},
2060
+ "checkConstraints": {},
2061
+ "isRLSEnabled": false
2062
+ },
2063
+ "public.session": {
2064
+ "name": "session",
2065
+ "schema": "",
2066
+ "columns": {
2067
+ "id": {
2068
+ "name": "id",
2069
+ "type": "text",
2070
+ "primaryKey": true,
2071
+ "notNull": true
2072
+ },
2073
+ "expires_at": {
2074
+ "name": "expires_at",
2075
+ "type": "timestamp with time zone",
2076
+ "primaryKey": false,
2077
+ "notNull": true
2078
+ },
2079
+ "token": {
2080
+ "name": "token",
2081
+ "type": "text",
2082
+ "primaryKey": false,
2083
+ "notNull": true
2084
+ },
2085
+ "created_at": {
2086
+ "name": "created_at",
2087
+ "type": "timestamp with time zone",
2088
+ "primaryKey": false,
2089
+ "notNull": true
2090
+ },
2091
+ "updated_at": {
2092
+ "name": "updated_at",
2093
+ "type": "timestamp with time zone",
2094
+ "primaryKey": false,
2095
+ "notNull": true
2096
+ },
2097
+ "ip_address": {
2098
+ "name": "ip_address",
2099
+ "type": "text",
2100
+ "primaryKey": false,
2101
+ "notNull": false
2102
+ },
2103
+ "user_agent": {
2104
+ "name": "user_agent",
2105
+ "type": "text",
2106
+ "primaryKey": false,
2107
+ "notNull": false
2108
+ },
2109
+ "user_id": {
2110
+ "name": "user_id",
2111
+ "type": "text",
2112
+ "primaryKey": false,
2113
+ "notNull": true
2114
+ }
2115
+ },
2116
+ "indexes": {
2117
+ "idx_session_user_id": {
2118
+ "name": "idx_session_user_id",
2119
+ "columns": [
2120
+ {
2121
+ "expression": "user_id",
2122
+ "isExpression": false,
2123
+ "asc": true,
2124
+ "nulls": "last"
2125
+ }
2126
+ ],
2127
+ "isUnique": false,
2128
+ "concurrently": false,
2129
+ "method": "btree",
2130
+ "with": {}
2131
+ }
2132
+ },
2133
+ "foreignKeys": {
2134
+ "session_user_id_user_id_fk": {
2135
+ "name": "session_user_id_user_id_fk",
2136
+ "tableFrom": "session",
2137
+ "tableTo": "user",
2138
+ "columnsFrom": ["user_id"],
2139
+ "columnsTo": ["id"],
2140
+ "onDelete": "no action",
2141
+ "onUpdate": "no action"
2142
+ }
2143
+ },
2144
+ "compositePrimaryKeys": {},
2145
+ "uniqueConstraints": {
2146
+ "session_token_unique": {
2147
+ "name": "session_token_unique",
2148
+ "nullsNotDistinct": false,
2149
+ "columns": ["token"]
2150
+ }
2151
+ },
2152
+ "policies": {},
2153
+ "checkConstraints": {},
2154
+ "isRLSEnabled": false
2155
+ },
2156
+ "public.site_setting": {
2157
+ "name": "site_setting",
2158
+ "schema": "",
2159
+ "columns": {
2160
+ "site_id": {
2161
+ "name": "site_id",
2162
+ "type": "text",
2163
+ "primaryKey": false,
2164
+ "notNull": true
2165
+ },
2166
+ "key": {
2167
+ "name": "key",
2168
+ "type": "text",
2169
+ "primaryKey": false,
2170
+ "notNull": true
2171
+ },
2172
+ "value": {
2173
+ "name": "value",
2174
+ "type": "text",
2175
+ "primaryKey": false,
2176
+ "notNull": true
2177
+ },
2178
+ "updated_at": {
2179
+ "name": "updated_at",
2180
+ "type": "integer",
2181
+ "primaryKey": false,
2182
+ "notNull": true
2183
+ }
2184
+ },
2185
+ "indexes": {
2186
+ "idx_site_setting_site_id": {
2187
+ "name": "idx_site_setting_site_id",
2188
+ "columns": [
2189
+ {
2190
+ "expression": "site_id",
2191
+ "isExpression": false,
2192
+ "asc": true,
2193
+ "nulls": "last"
2194
+ }
2195
+ ],
2196
+ "isUnique": false,
2197
+ "concurrently": false,
2198
+ "method": "btree",
2199
+ "with": {}
2200
+ }
2201
+ },
2202
+ "foreignKeys": {
2203
+ "site_setting_site_id_site_id_fk": {
2204
+ "name": "site_setting_site_id_site_id_fk",
2205
+ "tableFrom": "site_setting",
2206
+ "tableTo": "site",
2207
+ "columnsFrom": ["site_id"],
2208
+ "columnsTo": ["id"],
2209
+ "onDelete": "cascade",
2210
+ "onUpdate": "no action"
2211
+ }
2212
+ },
2213
+ "compositePrimaryKeys": {
2214
+ "site_setting_site_id_key_pk": {
2215
+ "name": "site_setting_site_id_key_pk",
2216
+ "columns": ["site_id", "key"]
2217
+ }
2218
+ },
2219
+ "uniqueConstraints": {},
2220
+ "policies": {},
2221
+ "checkConstraints": {},
2222
+ "isRLSEnabled": false
2223
+ },
2224
+ "public.site_domain": {
2225
+ "name": "site_domain",
2226
+ "schema": "",
2227
+ "columns": {
2228
+ "id": {
2229
+ "name": "id",
2230
+ "type": "text",
2231
+ "primaryKey": true,
2232
+ "notNull": true
2233
+ },
2234
+ "site_id": {
2235
+ "name": "site_id",
2236
+ "type": "text",
2237
+ "primaryKey": false,
2238
+ "notNull": true
2239
+ },
2240
+ "host": {
2241
+ "name": "host",
2242
+ "type": "text",
2243
+ "primaryKey": false,
2244
+ "notNull": true
2245
+ },
2246
+ "path_prefix": {
2247
+ "name": "path_prefix",
2248
+ "type": "text",
2249
+ "primaryKey": false,
2250
+ "notNull": false
2251
+ },
2252
+ "kind": {
2253
+ "name": "kind",
2254
+ "type": "text",
2255
+ "primaryKey": false,
2256
+ "notNull": true,
2257
+ "default": "'primary'"
2258
+ },
2259
+ "redirect_to_primary": {
2260
+ "name": "redirect_to_primary",
2261
+ "type": "boolean",
2262
+ "primaryKey": false,
2263
+ "notNull": true,
2264
+ "default": true
2265
+ },
2266
+ "created_at": {
2267
+ "name": "created_at",
2268
+ "type": "integer",
2269
+ "primaryKey": false,
2270
+ "notNull": true
2271
+ },
2272
+ "updated_at": {
2273
+ "name": "updated_at",
2274
+ "type": "integer",
2275
+ "primaryKey": false,
2276
+ "notNull": true
2277
+ }
2278
+ },
2279
+ "indexes": {
2280
+ "uq_site_domain_host": {
2281
+ "name": "uq_site_domain_host",
2282
+ "columns": [
2283
+ {
2284
+ "expression": "host",
2285
+ "isExpression": false,
2286
+ "asc": true,
2287
+ "nulls": "last"
2288
+ }
2289
+ ],
2290
+ "isUnique": true,
2291
+ "concurrently": false,
2292
+ "method": "btree",
2293
+ "with": {}
2294
+ },
2295
+ "idx_site_domain_site_id": {
2296
+ "name": "idx_site_domain_site_id",
2297
+ "columns": [
2298
+ {
2299
+ "expression": "site_id",
2300
+ "isExpression": false,
2301
+ "asc": true,
2302
+ "nulls": "last"
2303
+ }
2304
+ ],
2305
+ "isUnique": false,
2306
+ "concurrently": false,
2307
+ "method": "btree",
2308
+ "with": {}
2309
+ }
2310
+ },
2311
+ "foreignKeys": {
2312
+ "site_domain_site_id_site_id_fk": {
2313
+ "name": "site_domain_site_id_site_id_fk",
2314
+ "tableFrom": "site_domain",
2315
+ "tableTo": "site",
2316
+ "columnsFrom": ["site_id"],
2317
+ "columnsTo": ["id"],
2318
+ "onDelete": "cascade",
2319
+ "onUpdate": "no action"
2320
+ }
2321
+ },
2322
+ "compositePrimaryKeys": {},
2323
+ "uniqueConstraints": {},
2324
+ "policies": {},
2325
+ "checkConstraints": {
2326
+ "chk_site_domain_kind": {
2327
+ "name": "chk_site_domain_kind",
2328
+ "value": "\"site_domain\".\"kind\" IN ('primary', 'alias')"
2329
+ }
2330
+ },
2331
+ "isRLSEnabled": false
2332
+ },
2333
+ "public.site_member": {
2334
+ "name": "site_member",
2335
+ "schema": "",
2336
+ "columns": {
2337
+ "site_id": {
2338
+ "name": "site_id",
2339
+ "type": "text",
2340
+ "primaryKey": false,
2341
+ "notNull": true
2342
+ },
2343
+ "user_id": {
2344
+ "name": "user_id",
2345
+ "type": "text",
2346
+ "primaryKey": false,
2347
+ "notNull": true
2348
+ },
2349
+ "role": {
2350
+ "name": "role",
2351
+ "type": "text",
2352
+ "primaryKey": false,
2353
+ "notNull": true,
2354
+ "default": "'editor'"
2355
+ },
2356
+ "created_at": {
2357
+ "name": "created_at",
2358
+ "type": "integer",
2359
+ "primaryKey": false,
2360
+ "notNull": true
2361
+ },
2362
+ "updated_at": {
2363
+ "name": "updated_at",
2364
+ "type": "integer",
2365
+ "primaryKey": false,
2366
+ "notNull": true
2367
+ }
2368
+ },
2369
+ "indexes": {
2370
+ "idx_site_member_user_id": {
2371
+ "name": "idx_site_member_user_id",
2372
+ "columns": [
2373
+ {
2374
+ "expression": "user_id",
2375
+ "isExpression": false,
2376
+ "asc": true,
2377
+ "nulls": "last"
2378
+ }
2379
+ ],
2380
+ "isUnique": false,
2381
+ "concurrently": false,
2382
+ "method": "btree",
2383
+ "with": {}
2384
+ }
2385
+ },
2386
+ "foreignKeys": {
2387
+ "site_member_site_id_site_id_fk": {
2388
+ "name": "site_member_site_id_site_id_fk",
2389
+ "tableFrom": "site_member",
2390
+ "tableTo": "site",
2391
+ "columnsFrom": ["site_id"],
2392
+ "columnsTo": ["id"],
2393
+ "onDelete": "cascade",
2394
+ "onUpdate": "no action"
2395
+ }
2396
+ },
2397
+ "compositePrimaryKeys": {
2398
+ "site_member_site_id_user_id_pk": {
2399
+ "name": "site_member_site_id_user_id_pk",
2400
+ "columns": ["site_id", "user_id"]
2401
+ }
2402
+ },
2403
+ "uniqueConstraints": {},
2404
+ "policies": {},
2405
+ "checkConstraints": {
2406
+ "chk_site_member_role": {
2407
+ "name": "chk_site_member_role",
2408
+ "value": "\"site_member\".\"role\" IN ('owner', 'admin', 'editor')"
2409
+ }
2410
+ },
2411
+ "isRLSEnabled": false
2412
+ },
2413
+ "public.site": {
2414
+ "name": "site",
2415
+ "schema": "",
2416
+ "columns": {
2417
+ "id": {
2418
+ "name": "id",
2419
+ "type": "text",
2420
+ "primaryKey": true,
2421
+ "notNull": true
2422
+ },
2423
+ "key": {
2424
+ "name": "key",
2425
+ "type": "text",
2426
+ "primaryKey": false,
2427
+ "notNull": true
2428
+ },
2429
+ "status": {
2430
+ "name": "status",
2431
+ "type": "text",
2432
+ "primaryKey": false,
2433
+ "notNull": true,
2434
+ "default": "'active'"
2435
+ },
2436
+ "provisioning_idempotency_key": {
2437
+ "name": "provisioning_idempotency_key",
2438
+ "type": "text",
2439
+ "primaryKey": false,
2440
+ "notNull": false
2441
+ },
2442
+ "created_at": {
2443
+ "name": "created_at",
2444
+ "type": "integer",
2445
+ "primaryKey": false,
2446
+ "notNull": true
2447
+ },
2448
+ "updated_at": {
2449
+ "name": "updated_at",
2450
+ "type": "integer",
2451
+ "primaryKey": false,
2452
+ "notNull": true
2453
+ }
2454
+ },
2455
+ "indexes": {
2456
+ "uq_site_key": {
2457
+ "name": "uq_site_key",
2458
+ "columns": [
2459
+ {
2460
+ "expression": "key",
2461
+ "isExpression": false,
2462
+ "asc": true,
2463
+ "nulls": "last"
2464
+ }
2465
+ ],
2466
+ "isUnique": true,
2467
+ "concurrently": false,
2468
+ "method": "btree",
2469
+ "with": {}
2470
+ },
2471
+ "uq_site_provisioning_idempotency_key": {
2472
+ "name": "uq_site_provisioning_idempotency_key",
2473
+ "columns": [
2474
+ {
2475
+ "expression": "provisioning_idempotency_key",
2476
+ "isExpression": false,
2477
+ "asc": true,
2478
+ "nulls": "last"
2479
+ }
2480
+ ],
2481
+ "isUnique": true,
2482
+ "where": "\"site\".\"provisioning_idempotency_key\" IS NOT NULL",
2483
+ "concurrently": false,
2484
+ "method": "btree",
2485
+ "with": {}
2486
+ }
2487
+ },
2488
+ "foreignKeys": {},
2489
+ "compositePrimaryKeys": {},
2490
+ "uniqueConstraints": {},
2491
+ "policies": {},
2492
+ "checkConstraints": {
2493
+ "chk_site_status": {
2494
+ "name": "chk_site_status",
2495
+ "value": "\"site\".\"status\" IN ('active', 'suspended')"
2496
+ }
2497
+ },
2498
+ "isRLSEnabled": false
2499
+ },
2500
+ "public.smart_collection": {
2501
+ "name": "smart_collection",
2502
+ "schema": "",
2503
+ "columns": {
2504
+ "id": {
2505
+ "name": "id",
2506
+ "type": "text",
2507
+ "primaryKey": true,
2508
+ "notNull": true
2509
+ },
2510
+ "site_id": {
2511
+ "name": "site_id",
2512
+ "type": "text",
2513
+ "primaryKey": false,
2514
+ "notNull": true
2515
+ },
2516
+ "title": {
2517
+ "name": "title",
2518
+ "type": "text",
2519
+ "primaryKey": false,
2520
+ "notNull": true
2521
+ },
2522
+ "description": {
2523
+ "name": "description",
2524
+ "type": "text",
2525
+ "primaryKey": false,
2526
+ "notNull": false
2527
+ },
2528
+ "format": {
2529
+ "name": "format",
2530
+ "type": "text",
2531
+ "primaryKey": false,
2532
+ "notNull": false
2533
+ },
2534
+ "year": {
2535
+ "name": "year",
2536
+ "type": "integer",
2537
+ "primaryKey": false,
2538
+ "notNull": false
2539
+ },
2540
+ "collection_id": {
2541
+ "name": "collection_id",
2542
+ "type": "text",
2543
+ "primaryKey": false,
2544
+ "notNull": false
2545
+ },
2546
+ "media": {
2547
+ "name": "media",
2548
+ "type": "text",
2549
+ "primaryKey": false,
2550
+ "notNull": false
2551
+ },
2552
+ "has_title": {
2553
+ "name": "has_title",
2554
+ "type": "boolean",
2555
+ "primaryKey": false,
2556
+ "notNull": false
2557
+ },
2558
+ "has_replies": {
2559
+ "name": "has_replies",
2560
+ "type": "boolean",
2561
+ "primaryKey": false,
2562
+ "notNull": false
2563
+ },
2564
+ "visibility": {
2565
+ "name": "visibility",
2566
+ "type": "text",
2567
+ "primaryKey": false,
2568
+ "notNull": false
2569
+ },
2570
+ "sort": {
2571
+ "name": "sort",
2572
+ "type": "text",
2573
+ "primaryKey": false,
2574
+ "notNull": true,
2575
+ "default": "'newest'"
2576
+ },
2577
+ "layout": {
2578
+ "name": "layout",
2579
+ "type": "text",
2580
+ "primaryKey": false,
2581
+ "notNull": false
2582
+ },
2583
+ "created_at": {
2584
+ "name": "created_at",
2585
+ "type": "integer",
2586
+ "primaryKey": false,
2587
+ "notNull": true
2588
+ },
2589
+ "updated_at": {
2590
+ "name": "updated_at",
2591
+ "type": "integer",
2592
+ "primaryKey": false,
2593
+ "notNull": true
2594
+ }
2595
+ },
2596
+ "indexes": {
2597
+ "idx_smart_collection_site_created_at": {
2598
+ "name": "idx_smart_collection_site_created_at",
2599
+ "columns": [
2600
+ {
2601
+ "expression": "site_id",
2602
+ "isExpression": false,
2603
+ "asc": true,
2604
+ "nulls": "last"
2605
+ },
2606
+ {
2607
+ "expression": "created_at",
2608
+ "isExpression": false,
2609
+ "asc": true,
2610
+ "nulls": "last"
2611
+ }
2612
+ ],
2613
+ "isUnique": false,
2614
+ "concurrently": false,
2615
+ "method": "btree",
2616
+ "with": {}
2617
+ },
2618
+ "idx_smart_collection_site_collection_id": {
2619
+ "name": "idx_smart_collection_site_collection_id",
2620
+ "columns": [
2621
+ {
2622
+ "expression": "site_id",
2623
+ "isExpression": false,
2624
+ "asc": true,
2625
+ "nulls": "last"
2626
+ },
2627
+ {
2628
+ "expression": "collection_id",
2629
+ "isExpression": false,
2630
+ "asc": true,
2631
+ "nulls": "last"
2632
+ }
2633
+ ],
2634
+ "isUnique": false,
2635
+ "concurrently": false,
2636
+ "method": "btree",
2637
+ "with": {}
2638
+ }
2639
+ },
2640
+ "foreignKeys": {
2641
+ "smart_collection_site_id_site_id_fk": {
2642
+ "name": "smart_collection_site_id_site_id_fk",
2643
+ "tableFrom": "smart_collection",
2644
+ "tableTo": "site",
2645
+ "columnsFrom": ["site_id"],
2646
+ "columnsTo": ["id"],
2647
+ "onDelete": "cascade",
2648
+ "onUpdate": "no action"
2649
+ }
2650
+ },
2651
+ "compositePrimaryKeys": {},
2652
+ "uniqueConstraints": {},
2653
+ "policies": {},
2654
+ "checkConstraints": {
2655
+ "chk_smart_collection_format": {
2656
+ "name": "chk_smart_collection_format",
2657
+ "value": "\"smart_collection\".\"format\" IS NULL OR \"smart_collection\".\"format\" IN ('note', 'link', 'quote')"
2658
+ },
2659
+ "chk_smart_collection_visibility": {
2660
+ "name": "chk_smart_collection_visibility",
2661
+ "value": "\"smart_collection\".\"visibility\" IS NULL OR \"smart_collection\".\"visibility\" IN ('public', 'featured', 'latest_hidden')"
2662
+ },
2663
+ "chk_smart_collection_sort": {
2664
+ "name": "chk_smart_collection_sort",
2665
+ "value": "\"smart_collection\".\"sort\" IN ('newest', 'oldest', 'rating_desc')"
2666
+ },
2667
+ "chk_smart_collection_layout": {
2668
+ "name": "chk_smart_collection_layout",
2669
+ "value": "\"smart_collection\".\"layout\" IS NULL OR \"smart_collection\".\"layout\" IN ('list', 'grid')"
2670
+ },
2671
+ "chk_smart_collection_year": {
2672
+ "name": "chk_smart_collection_year",
2673
+ "value": "\"smart_collection\".\"year\" IS NULL OR \"smart_collection\".\"year\" BETWEEN 1971 AND 9999"
2674
+ }
2675
+ },
2676
+ "isRLSEnabled": false
2677
+ },
2678
+ "public.storage_purge": {
2679
+ "name": "storage_purge",
2680
+ "schema": "",
2681
+ "columns": {
2682
+ "id": {
2683
+ "name": "id",
2684
+ "type": "text",
2685
+ "primaryKey": true,
2686
+ "notNull": true
2687
+ },
2688
+ "site_id": {
2689
+ "name": "site_id",
2690
+ "type": "text",
2691
+ "primaryKey": false,
2692
+ "notNull": true
2693
+ },
2694
+ "provider": {
2695
+ "name": "provider",
2696
+ "type": "text",
2697
+ "primaryKey": false,
2698
+ "notNull": true
2699
+ },
2700
+ "storage_key": {
2701
+ "name": "storage_key",
2702
+ "type": "text",
2703
+ "primaryKey": false,
2704
+ "notNull": true
2705
+ },
2706
+ "original_key": {
2707
+ "name": "original_key",
2708
+ "type": "text",
2709
+ "primaryKey": false,
2710
+ "notNull": true
2711
+ },
2712
+ "reason": {
2713
+ "name": "reason",
2714
+ "type": "text",
2715
+ "primaryKey": false,
2716
+ "notNull": false
2717
+ },
2718
+ "purge_after": {
2719
+ "name": "purge_after",
2720
+ "type": "integer",
2721
+ "primaryKey": false,
2722
+ "notNull": true
2723
+ },
2724
+ "created_at": {
2725
+ "name": "created_at",
2726
+ "type": "integer",
2727
+ "primaryKey": false,
2728
+ "notNull": true
2729
+ }
2730
+ },
2731
+ "indexes": {
2732
+ "uq_storage_purge_provider_key": {
2733
+ "name": "uq_storage_purge_provider_key",
2734
+ "columns": [
2735
+ {
2736
+ "expression": "provider",
2737
+ "isExpression": false,
2738
+ "asc": true,
2739
+ "nulls": "last"
2740
+ },
2741
+ {
2742
+ "expression": "storage_key",
2743
+ "isExpression": false,
2744
+ "asc": true,
2745
+ "nulls": "last"
2746
+ }
2747
+ ],
2748
+ "isUnique": true,
2749
+ "concurrently": false,
2750
+ "method": "btree",
2751
+ "with": {}
2752
+ },
2753
+ "idx_storage_purge_site_provider_due": {
2754
+ "name": "idx_storage_purge_site_provider_due",
2755
+ "columns": [
2756
+ {
2757
+ "expression": "site_id",
2758
+ "isExpression": false,
2759
+ "asc": true,
2760
+ "nulls": "last"
2761
+ },
2762
+ {
2763
+ "expression": "provider",
2764
+ "isExpression": false,
2765
+ "asc": true,
2766
+ "nulls": "last"
2767
+ },
2768
+ {
2769
+ "expression": "purge_after",
2770
+ "isExpression": false,
2771
+ "asc": true,
2772
+ "nulls": "last"
2773
+ }
2774
+ ],
2775
+ "isUnique": false,
2776
+ "concurrently": false,
2777
+ "method": "btree",
2778
+ "with": {}
2779
+ }
2780
+ },
2781
+ "foreignKeys": {
2782
+ "storage_purge_site_id_site_id_fk": {
2783
+ "name": "storage_purge_site_id_site_id_fk",
2784
+ "tableFrom": "storage_purge",
2785
+ "tableTo": "site",
2786
+ "columnsFrom": ["site_id"],
2787
+ "columnsTo": ["id"],
2788
+ "onDelete": "cascade",
2789
+ "onUpdate": "no action"
2790
+ }
2791
+ },
2792
+ "compositePrimaryKeys": {},
2793
+ "uniqueConstraints": {},
2794
+ "policies": {},
2795
+ "checkConstraints": {},
2796
+ "isRLSEnabled": false
2797
+ },
2798
+ "public.telegram_binding": {
2799
+ "name": "telegram_binding",
2800
+ "schema": "",
2801
+ "columns": {
2802
+ "id": {
2803
+ "name": "id",
2804
+ "type": "text",
2805
+ "primaryKey": true,
2806
+ "notNull": true
2807
+ },
2808
+ "site_id": {
2809
+ "name": "site_id",
2810
+ "type": "text",
2811
+ "primaryKey": false,
2812
+ "notNull": true
2813
+ },
2814
+ "bot_id": {
2815
+ "name": "bot_id",
2816
+ "type": "text",
2817
+ "primaryKey": false,
2818
+ "notNull": true
2819
+ },
2820
+ "telegram_user_id": {
2821
+ "name": "telegram_user_id",
2822
+ "type": "text",
2823
+ "primaryKey": false,
2824
+ "notNull": true
2825
+ },
2826
+ "telegram_username": {
2827
+ "name": "telegram_username",
2828
+ "type": "text",
2829
+ "primaryKey": false,
2830
+ "notNull": false
2831
+ },
2832
+ "last_update_id": {
2833
+ "name": "last_update_id",
2834
+ "type": "integer",
2835
+ "primaryKey": false,
2836
+ "notNull": false
2837
+ },
2838
+ "bound_at": {
2839
+ "name": "bound_at",
2840
+ "type": "integer",
2841
+ "primaryKey": false,
2842
+ "notNull": true
2843
+ }
2844
+ },
2845
+ "indexes": {
2846
+ "uq_telegram_binding_site_id": {
2847
+ "name": "uq_telegram_binding_site_id",
2848
+ "columns": [
2849
+ {
2850
+ "expression": "site_id",
2851
+ "isExpression": false,
2852
+ "asc": true,
2853
+ "nulls": "last"
2854
+ }
2855
+ ],
2856
+ "isUnique": true,
2857
+ "concurrently": false,
2858
+ "method": "btree",
2859
+ "with": {}
2860
+ },
2861
+ "uq_telegram_binding_bot_user": {
2862
+ "name": "uq_telegram_binding_bot_user",
2863
+ "columns": [
2864
+ {
2865
+ "expression": "bot_id",
2866
+ "isExpression": false,
2867
+ "asc": true,
2868
+ "nulls": "last"
2869
+ },
2870
+ {
2871
+ "expression": "telegram_user_id",
2872
+ "isExpression": false,
2873
+ "asc": true,
2874
+ "nulls": "last"
2875
+ }
2876
+ ],
2877
+ "isUnique": true,
2878
+ "concurrently": false,
2879
+ "method": "btree",
2880
+ "with": {}
2881
+ }
2882
+ },
2883
+ "foreignKeys": {
2884
+ "telegram_binding_site_id_site_id_fk": {
2885
+ "name": "telegram_binding_site_id_site_id_fk",
2886
+ "tableFrom": "telegram_binding",
2887
+ "tableTo": "site",
2888
+ "columnsFrom": ["site_id"],
2889
+ "columnsTo": ["id"],
2890
+ "onDelete": "cascade",
2891
+ "onUpdate": "no action"
2892
+ }
2893
+ },
2894
+ "compositePrimaryKeys": {},
2895
+ "uniqueConstraints": {},
2896
+ "policies": {},
2897
+ "checkConstraints": {},
2898
+ "isRLSEnabled": false
2899
+ },
2900
+ "public.telegram_media_group_item": {
2901
+ "name": "telegram_media_group_item",
2902
+ "schema": "",
2903
+ "columns": {
2904
+ "id": {
2905
+ "name": "id",
2906
+ "type": "text",
2907
+ "primaryKey": true,
2908
+ "notNull": true
2909
+ },
2910
+ "site_id": {
2911
+ "name": "site_id",
2912
+ "type": "text",
2913
+ "primaryKey": false,
2914
+ "notNull": true
2915
+ },
2916
+ "bot_id": {
2917
+ "name": "bot_id",
2918
+ "type": "text",
2919
+ "primaryKey": false,
2920
+ "notNull": true
2921
+ },
2922
+ "telegram_user_id": {
2923
+ "name": "telegram_user_id",
2924
+ "type": "text",
2925
+ "primaryKey": false,
2926
+ "notNull": true
2927
+ },
2928
+ "media_group_id": {
2929
+ "name": "media_group_id",
2930
+ "type": "text",
2931
+ "primaryKey": false,
2932
+ "notNull": true
2933
+ },
2934
+ "chat_id": {
2935
+ "name": "chat_id",
2936
+ "type": "integer",
2937
+ "primaryKey": false,
2938
+ "notNull": true
2939
+ },
2940
+ "message_id": {
2941
+ "name": "message_id",
2942
+ "type": "integer",
2943
+ "primaryKey": false,
2944
+ "notNull": true
2945
+ },
2946
+ "update_id": {
2947
+ "name": "update_id",
2948
+ "type": "integer",
2949
+ "primaryKey": false,
2950
+ "notNull": true
2951
+ },
2952
+ "file_id": {
2953
+ "name": "file_id",
2954
+ "type": "text",
2955
+ "primaryKey": false,
2956
+ "notNull": true
2957
+ },
2958
+ "media_kind": {
2959
+ "name": "media_kind",
2960
+ "type": "text",
2961
+ "primaryKey": false,
2962
+ "notNull": true
2963
+ },
2964
+ "mime_type": {
2965
+ "name": "mime_type",
2966
+ "type": "text",
2967
+ "primaryKey": false,
2968
+ "notNull": false
2969
+ },
2970
+ "original_name": {
2971
+ "name": "original_name",
2972
+ "type": "text",
2973
+ "primaryKey": false,
2974
+ "notNull": false
2975
+ },
2976
+ "caption_markdown": {
2977
+ "name": "caption_markdown",
2978
+ "type": "text",
2979
+ "primaryKey": false,
2980
+ "notNull": false
2981
+ },
2982
+ "width": {
2983
+ "name": "width",
2984
+ "type": "integer",
2985
+ "primaryKey": false,
2986
+ "notNull": false
2987
+ },
2988
+ "height": {
2989
+ "name": "height",
2990
+ "type": "integer",
2991
+ "primaryKey": false,
2992
+ "notNull": false
2993
+ },
2994
+ "duration_seconds": {
2995
+ "name": "duration_seconds",
2996
+ "type": "integer",
2997
+ "primaryKey": false,
2998
+ "notNull": false
2999
+ },
3000
+ "poster_file_id": {
3001
+ "name": "poster_file_id",
3002
+ "type": "text",
3003
+ "primaryKey": false,
3004
+ "notNull": false
3005
+ },
3006
+ "created_at": {
3007
+ "name": "created_at",
3008
+ "type": "integer",
3009
+ "primaryKey": false,
3010
+ "notNull": true
3011
+ }
3012
+ },
3013
+ "indexes": {
3014
+ "idx_telegram_media_group_item_group": {
3015
+ "name": "idx_telegram_media_group_item_group",
3016
+ "columns": [
3017
+ {
3018
+ "expression": "bot_id",
3019
+ "isExpression": false,
3020
+ "asc": true,
3021
+ "nulls": "last"
3022
+ },
3023
+ {
3024
+ "expression": "media_group_id",
3025
+ "isExpression": false,
3026
+ "asc": true,
3027
+ "nulls": "last"
3028
+ }
3029
+ ],
3030
+ "isUnique": false,
3031
+ "concurrently": false,
3032
+ "method": "btree",
3033
+ "with": {}
3034
+ },
3035
+ "uq_telegram_media_group_item_message": {
3036
+ "name": "uq_telegram_media_group_item_message",
3037
+ "columns": [
3038
+ {
3039
+ "expression": "bot_id",
3040
+ "isExpression": false,
3041
+ "asc": true,
3042
+ "nulls": "last"
3043
+ },
3044
+ {
3045
+ "expression": "media_group_id",
3046
+ "isExpression": false,
3047
+ "asc": true,
3048
+ "nulls": "last"
3049
+ },
3050
+ {
3051
+ "expression": "message_id",
3052
+ "isExpression": false,
3053
+ "asc": true,
3054
+ "nulls": "last"
3055
+ }
3056
+ ],
3057
+ "isUnique": true,
3058
+ "concurrently": false,
3059
+ "method": "btree",
3060
+ "with": {}
3061
+ }
3062
+ },
3063
+ "foreignKeys": {
3064
+ "telegram_media_group_item_site_id_site_id_fk": {
3065
+ "name": "telegram_media_group_item_site_id_site_id_fk",
3066
+ "tableFrom": "telegram_media_group_item",
3067
+ "tableTo": "site",
3068
+ "columnsFrom": ["site_id"],
3069
+ "columnsTo": ["id"],
3070
+ "onDelete": "cascade",
3071
+ "onUpdate": "no action"
3072
+ }
3073
+ },
3074
+ "compositePrimaryKeys": {},
3075
+ "uniqueConstraints": {},
3076
+ "policies": {},
3077
+ "checkConstraints": {},
3078
+ "isRLSEnabled": false
3079
+ },
3080
+ "public.telegram_pending_binding": {
3081
+ "name": "telegram_pending_binding",
3082
+ "schema": "",
3083
+ "columns": {
3084
+ "id": {
3085
+ "name": "id",
3086
+ "type": "text",
3087
+ "primaryKey": true,
3088
+ "notNull": true
3089
+ },
3090
+ "site_id": {
3091
+ "name": "site_id",
3092
+ "type": "text",
3093
+ "primaryKey": false,
3094
+ "notNull": true
3095
+ },
3096
+ "code": {
3097
+ "name": "code",
3098
+ "type": "text",
3099
+ "primaryKey": false,
3100
+ "notNull": true
3101
+ },
3102
+ "created_at": {
3103
+ "name": "created_at",
3104
+ "type": "integer",
3105
+ "primaryKey": false,
3106
+ "notNull": true
3107
+ },
3108
+ "expires_at": {
3109
+ "name": "expires_at",
3110
+ "type": "integer",
3111
+ "primaryKey": false,
3112
+ "notNull": true
3113
+ }
3114
+ },
3115
+ "indexes": {
3116
+ "uq_telegram_pending_binding_site_id": {
3117
+ "name": "uq_telegram_pending_binding_site_id",
3118
+ "columns": [
3119
+ {
3120
+ "expression": "site_id",
3121
+ "isExpression": false,
3122
+ "asc": true,
3123
+ "nulls": "last"
3124
+ }
3125
+ ],
3126
+ "isUnique": true,
3127
+ "concurrently": false,
3128
+ "method": "btree",
3129
+ "with": {}
3130
+ },
3131
+ "uq_telegram_pending_binding_code": {
3132
+ "name": "uq_telegram_pending_binding_code",
3133
+ "columns": [
3134
+ {
3135
+ "expression": "code",
3136
+ "isExpression": false,
3137
+ "asc": true,
3138
+ "nulls": "last"
3139
+ }
3140
+ ],
3141
+ "isUnique": true,
3142
+ "concurrently": false,
3143
+ "method": "btree",
3144
+ "with": {}
3145
+ }
3146
+ },
3147
+ "foreignKeys": {
3148
+ "telegram_pending_binding_site_id_site_id_fk": {
3149
+ "name": "telegram_pending_binding_site_id_site_id_fk",
3150
+ "tableFrom": "telegram_pending_binding",
3151
+ "tableTo": "site",
3152
+ "columnsFrom": ["site_id"],
3153
+ "columnsTo": ["id"],
3154
+ "onDelete": "cascade",
3155
+ "onUpdate": "no action"
3156
+ }
3157
+ },
3158
+ "compositePrimaryKeys": {},
3159
+ "uniqueConstraints": {},
3160
+ "policies": {},
3161
+ "checkConstraints": {},
3162
+ "isRLSEnabled": false
3163
+ },
3164
+ "public.thread_collection": {
3165
+ "name": "thread_collection",
3166
+ "schema": "",
3167
+ "columns": {
3168
+ "site_id": {
3169
+ "name": "site_id",
3170
+ "type": "text",
3171
+ "primaryKey": false,
3172
+ "notNull": true
3173
+ },
3174
+ "thread_id": {
3175
+ "name": "thread_id",
3176
+ "type": "text",
3177
+ "primaryKey": false,
3178
+ "notNull": true
3179
+ },
3180
+ "collection_id": {
3181
+ "name": "collection_id",
3182
+ "type": "text",
3183
+ "primaryKey": false,
3184
+ "notNull": true
3185
+ },
3186
+ "created_at": {
3187
+ "name": "created_at",
3188
+ "type": "integer",
3189
+ "primaryKey": false,
3190
+ "notNull": true
3191
+ },
3192
+ "position": {
3193
+ "name": "position",
3194
+ "type": "integer",
3195
+ "primaryKey": false,
3196
+ "notNull": true,
3197
+ "default": 0
3198
+ },
3199
+ "pinned_at": {
3200
+ "name": "pinned_at",
3201
+ "type": "integer",
3202
+ "primaryKey": false,
3203
+ "notNull": false
3204
+ }
3205
+ },
3206
+ "indexes": {
3207
+ "idx_thread_collection_site_collection_id": {
3208
+ "name": "idx_thread_collection_site_collection_id",
3209
+ "columns": [
3210
+ {
3211
+ "expression": "site_id",
3212
+ "isExpression": false,
3213
+ "asc": true,
3214
+ "nulls": "last"
3215
+ },
3216
+ {
3217
+ "expression": "collection_id",
3218
+ "isExpression": false,
3219
+ "asc": true,
3220
+ "nulls": "last"
3221
+ }
3222
+ ],
3223
+ "isUnique": false,
3224
+ "concurrently": false,
3225
+ "method": "btree",
3226
+ "with": {}
3227
+ },
3228
+ "idx_thread_collection_site_collection_created_thread": {
3229
+ "name": "idx_thread_collection_site_collection_created_thread",
3230
+ "columns": [
3231
+ {
3232
+ "expression": "site_id",
3233
+ "isExpression": false,
3234
+ "asc": true,
3235
+ "nulls": "last"
3236
+ },
3237
+ {
3238
+ "expression": "collection_id",
3239
+ "isExpression": false,
3240
+ "asc": true,
3241
+ "nulls": "last"
3242
+ },
3243
+ {
3244
+ "expression": "created_at",
3245
+ "isExpression": false,
3246
+ "asc": true,
3247
+ "nulls": "last"
3248
+ },
3249
+ {
3250
+ "expression": "thread_id",
3251
+ "isExpression": false,
3252
+ "asc": true,
3253
+ "nulls": "last"
3254
+ }
3255
+ ],
3256
+ "isUnique": false,
3257
+ "concurrently": false,
3258
+ "method": "btree",
3259
+ "with": {}
3260
+ }
3261
+ },
3262
+ "foreignKeys": {
3263
+ "thread_collection_site_id_site_id_fk": {
3264
+ "name": "thread_collection_site_id_site_id_fk",
3265
+ "tableFrom": "thread_collection",
3266
+ "tableTo": "site",
3267
+ "columnsFrom": ["site_id"],
3268
+ "columnsTo": ["id"],
3269
+ "onDelete": "cascade",
3270
+ "onUpdate": "no action"
3271
+ },
3272
+ "thread_collection_thread_id_post_id_fk": {
3273
+ "name": "thread_collection_thread_id_post_id_fk",
3274
+ "tableFrom": "thread_collection",
3275
+ "tableTo": "post",
3276
+ "columnsFrom": ["thread_id"],
3277
+ "columnsTo": ["id"],
3278
+ "onDelete": "cascade",
3279
+ "onUpdate": "no action"
3280
+ },
3281
+ "thread_collection_collection_id_collection_id_fk": {
3282
+ "name": "thread_collection_collection_id_collection_id_fk",
3283
+ "tableFrom": "thread_collection",
3284
+ "tableTo": "collection",
3285
+ "columnsFrom": ["collection_id"],
3286
+ "columnsTo": ["id"],
3287
+ "onDelete": "cascade",
3288
+ "onUpdate": "no action"
3289
+ }
3290
+ },
3291
+ "compositePrimaryKeys": {
3292
+ "thread_collection_site_id_thread_id_collection_id_pk": {
3293
+ "name": "thread_collection_site_id_thread_id_collection_id_pk",
3294
+ "columns": ["site_id", "thread_id", "collection_id"]
3295
+ }
3296
+ },
3297
+ "uniqueConstraints": {},
3298
+ "policies": {},
3299
+ "checkConstraints": {},
3300
+ "isRLSEnabled": false
3301
+ },
3302
+ "public.upload_session": {
3303
+ "name": "upload_session",
3304
+ "schema": "",
3305
+ "columns": {
3306
+ "id": {
3307
+ "name": "id",
3308
+ "type": "text",
3309
+ "primaryKey": true,
3310
+ "notNull": true
3311
+ },
3312
+ "site_id": {
3313
+ "name": "site_id",
3314
+ "type": "text",
3315
+ "primaryKey": false,
3316
+ "notNull": true
3317
+ },
3318
+ "media_id": {
3319
+ "name": "media_id",
3320
+ "type": "text",
3321
+ "primaryKey": false,
3322
+ "notNull": true
3323
+ },
3324
+ "original_name": {
3325
+ "name": "original_name",
3326
+ "type": "text",
3327
+ "primaryKey": false,
3328
+ "notNull": true
3329
+ },
3330
+ "filename": {
3331
+ "name": "filename",
3332
+ "type": "text",
3333
+ "primaryKey": false,
3334
+ "notNull": true
3335
+ },
3336
+ "provider": {
3337
+ "name": "provider",
3338
+ "type": "text",
3339
+ "primaryKey": false,
3340
+ "notNull": true
3341
+ },
3342
+ "expected_content_type": {
3343
+ "name": "expected_content_type",
3344
+ "type": "text",
3345
+ "primaryKey": false,
3346
+ "notNull": true
3347
+ },
3348
+ "expected_size": {
3349
+ "name": "expected_size",
3350
+ "type": "integer",
3351
+ "primaryKey": false,
3352
+ "notNull": true
3353
+ },
3354
+ "expected_checksum_sha256": {
3355
+ "name": "expected_checksum_sha256",
3356
+ "type": "text",
3357
+ "primaryKey": false,
3358
+ "notNull": false
3359
+ },
3360
+ "content_disposition": {
3361
+ "name": "content_disposition",
3362
+ "type": "text",
3363
+ "primaryKey": false,
3364
+ "notNull": true,
3365
+ "default": "'inline'"
3366
+ },
3367
+ "temp_storage_key": {
3368
+ "name": "temp_storage_key",
3369
+ "type": "text",
3370
+ "primaryKey": false,
3371
+ "notNull": true
3372
+ },
3373
+ "final_storage_key": {
3374
+ "name": "final_storage_key",
3375
+ "type": "text",
3376
+ "primaryKey": false,
3377
+ "notNull": true
3378
+ },
3379
+ "multipart_upload_id": {
3380
+ "name": "multipart_upload_id",
3381
+ "type": "text",
3382
+ "primaryKey": false,
3383
+ "notNull": false
3384
+ },
3385
+ "state": {
3386
+ "name": "state",
3387
+ "type": "text",
3388
+ "primaryKey": false,
3389
+ "notNull": true,
3390
+ "default": "'pending'"
3391
+ },
3392
+ "expires_at": {
3393
+ "name": "expires_at",
3394
+ "type": "integer",
3395
+ "primaryKey": false,
3396
+ "notNull": true
3397
+ },
3398
+ "created_at": {
3399
+ "name": "created_at",
3400
+ "type": "integer",
3401
+ "primaryKey": false,
3402
+ "notNull": true
3403
+ },
3404
+ "updated_at": {
3405
+ "name": "updated_at",
3406
+ "type": "integer",
3407
+ "primaryKey": false,
3408
+ "notNull": true
3409
+ }
3410
+ },
3411
+ "indexes": {
3412
+ "uq_upload_session_media_id": {
3413
+ "name": "uq_upload_session_media_id",
3414
+ "columns": [
3415
+ {
3416
+ "expression": "media_id",
3417
+ "isExpression": false,
3418
+ "asc": true,
3419
+ "nulls": "last"
3420
+ }
3421
+ ],
3422
+ "isUnique": true,
3423
+ "concurrently": false,
3424
+ "method": "btree",
3425
+ "with": {}
3426
+ },
3427
+ "uq_upload_session_temp_storage_key": {
3428
+ "name": "uq_upload_session_temp_storage_key",
3429
+ "columns": [
3430
+ {
3431
+ "expression": "temp_storage_key",
3432
+ "isExpression": false,
3433
+ "asc": true,
3434
+ "nulls": "last"
3435
+ }
3436
+ ],
3437
+ "isUnique": true,
3438
+ "concurrently": false,
3439
+ "method": "btree",
3440
+ "with": {}
3441
+ },
3442
+ "uq_upload_session_final_storage_key": {
3443
+ "name": "uq_upload_session_final_storage_key",
3444
+ "columns": [
3445
+ {
3446
+ "expression": "final_storage_key",
3447
+ "isExpression": false,
3448
+ "asc": true,
3449
+ "nulls": "last"
3450
+ }
3451
+ ],
3452
+ "isUnique": true,
3453
+ "concurrently": false,
3454
+ "method": "btree",
3455
+ "with": {}
3456
+ },
3457
+ "idx_upload_session_site_state": {
3458
+ "name": "idx_upload_session_site_state",
3459
+ "columns": [
3460
+ {
3461
+ "expression": "site_id",
3462
+ "isExpression": false,
3463
+ "asc": true,
3464
+ "nulls": "last"
3465
+ },
3466
+ {
3467
+ "expression": "state",
3468
+ "isExpression": false,
3469
+ "asc": true,
3470
+ "nulls": "last"
3471
+ }
3472
+ ],
3473
+ "isUnique": false,
3474
+ "concurrently": false,
3475
+ "method": "btree",
3476
+ "with": {}
3477
+ },
3478
+ "idx_upload_session_site_expires_at": {
3479
+ "name": "idx_upload_session_site_expires_at",
3480
+ "columns": [
3481
+ {
3482
+ "expression": "site_id",
3483
+ "isExpression": false,
3484
+ "asc": true,
3485
+ "nulls": "last"
3486
+ },
3487
+ {
3488
+ "expression": "expires_at",
3489
+ "isExpression": false,
3490
+ "asc": true,
3491
+ "nulls": "last"
3492
+ }
3493
+ ],
3494
+ "isUnique": false,
3495
+ "concurrently": false,
3496
+ "method": "btree",
3497
+ "with": {}
3498
+ }
3499
+ },
3500
+ "foreignKeys": {
3501
+ "upload_session_site_id_site_id_fk": {
3502
+ "name": "upload_session_site_id_site_id_fk",
3503
+ "tableFrom": "upload_session",
3504
+ "tableTo": "site",
3505
+ "columnsFrom": ["site_id"],
3506
+ "columnsTo": ["id"],
3507
+ "onDelete": "cascade",
3508
+ "onUpdate": "no action"
3509
+ }
3510
+ },
3511
+ "compositePrimaryKeys": {},
3512
+ "uniqueConstraints": {},
3513
+ "policies": {},
3514
+ "checkConstraints": {
3515
+ "chk_upload_session_expected_size_positive": {
3516
+ "name": "chk_upload_session_expected_size_positive",
3517
+ "value": "\"upload_session\".\"expected_size\" > 0"
3518
+ },
3519
+ "chk_upload_session_state": {
3520
+ "name": "chk_upload_session_state",
3521
+ "value": "\"upload_session\".\"state\" IN ('pending', 'uploaded', 'completed', 'aborted', 'failed')"
3522
+ },
3523
+ "chk_upload_session_content_disposition": {
3524
+ "name": "chk_upload_session_content_disposition",
3525
+ "value": "\"upload_session\".\"content_disposition\" IN ('inline', 'attachment')"
3526
+ }
3527
+ },
3528
+ "isRLSEnabled": false
3529
+ },
3530
+ "public.user": {
3531
+ "name": "user",
3532
+ "schema": "",
3533
+ "columns": {
3534
+ "id": {
3535
+ "name": "id",
3536
+ "type": "text",
3537
+ "primaryKey": true,
3538
+ "notNull": true
3539
+ },
3540
+ "name": {
3541
+ "name": "name",
3542
+ "type": "text",
3543
+ "primaryKey": false,
3544
+ "notNull": true
3545
+ },
3546
+ "email": {
3547
+ "name": "email",
3548
+ "type": "text",
3549
+ "primaryKey": false,
3550
+ "notNull": true
3551
+ },
3552
+ "email_verified": {
3553
+ "name": "email_verified",
3554
+ "type": "boolean",
3555
+ "primaryKey": false,
3556
+ "notNull": true,
3557
+ "default": false
3558
+ },
3559
+ "image": {
3560
+ "name": "image",
3561
+ "type": "text",
3562
+ "primaryKey": false,
3563
+ "notNull": false
3564
+ },
3565
+ "role": {
3566
+ "name": "role",
3567
+ "type": "text",
3568
+ "primaryKey": false,
3569
+ "notNull": false,
3570
+ "default": "'member'"
3571
+ },
3572
+ "created_at": {
3573
+ "name": "created_at",
3574
+ "type": "timestamp with time zone",
3575
+ "primaryKey": false,
3576
+ "notNull": true
3577
+ },
3578
+ "updated_at": {
3579
+ "name": "updated_at",
3580
+ "type": "timestamp with time zone",
3581
+ "primaryKey": false,
3582
+ "notNull": true
3583
+ }
3584
+ },
3585
+ "indexes": {},
3586
+ "foreignKeys": {},
3587
+ "compositePrimaryKeys": {},
3588
+ "uniqueConstraints": {
3589
+ "user_email_unique": {
3590
+ "name": "user_email_unique",
3591
+ "nullsNotDistinct": false,
3592
+ "columns": ["email"]
3593
+ }
3594
+ },
3595
+ "policies": {},
3596
+ "checkConstraints": {},
3597
+ "isRLSEnabled": false
3598
+ },
3599
+ "public.verification": {
3600
+ "name": "verification",
3601
+ "schema": "",
3602
+ "columns": {
3603
+ "id": {
3604
+ "name": "id",
3605
+ "type": "text",
3606
+ "primaryKey": true,
3607
+ "notNull": true
3608
+ },
3609
+ "identifier": {
3610
+ "name": "identifier",
3611
+ "type": "text",
3612
+ "primaryKey": false,
3613
+ "notNull": true
3614
+ },
3615
+ "value": {
3616
+ "name": "value",
3617
+ "type": "text",
3618
+ "primaryKey": false,
3619
+ "notNull": true
3620
+ },
3621
+ "expires_at": {
3622
+ "name": "expires_at",
3623
+ "type": "timestamp with time zone",
3624
+ "primaryKey": false,
3625
+ "notNull": true
3626
+ },
3627
+ "created_at": {
3628
+ "name": "created_at",
3629
+ "type": "timestamp with time zone",
3630
+ "primaryKey": false,
3631
+ "notNull": false
3632
+ },
3633
+ "updated_at": {
3634
+ "name": "updated_at",
3635
+ "type": "timestamp with time zone",
3636
+ "primaryKey": false,
3637
+ "notNull": false
3638
+ }
3639
+ },
3640
+ "indexes": {},
3641
+ "foreignKeys": {},
3642
+ "compositePrimaryKeys": {},
3643
+ "uniqueConstraints": {},
3644
+ "policies": {},
3645
+ "checkConstraints": {},
3646
+ "isRLSEnabled": false
3647
+ }
3648
+ },
3649
+ "enums": {},
3650
+ "schemas": {},
3651
+ "sequences": {},
3652
+ "roles": {},
3653
+ "policies": {},
3654
+ "views": {},
3655
+ "_meta": {
3656
+ "columns": {},
3657
+ "schemas": {},
3658
+ "tables": {}
3659
+ }
3660
+ }