@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,3329 @@
1
+ {
2
+ "id": "d6cd0fa7-f6cf-4075-b3c1-76402f2bb821",
3
+ "prevId": "69aa05e6-c4ab-48b3-8e23-fb8dfc3443e8",
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
+ "label": {
230
+ "name": "label",
231
+ "type": "text",
232
+ "primaryKey": false,
233
+ "notNull": false
234
+ },
235
+ "url": {
236
+ "name": "url",
237
+ "type": "text",
238
+ "primaryKey": false,
239
+ "notNull": false
240
+ },
241
+ "description": {
242
+ "name": "description",
243
+ "type": "text",
244
+ "primaryKey": false,
245
+ "notNull": false
246
+ },
247
+ "position": {
248
+ "name": "position",
249
+ "type": "text",
250
+ "primaryKey": false,
251
+ "notNull": true,
252
+ "default": "'a0'"
253
+ },
254
+ "created_at": {
255
+ "name": "created_at",
256
+ "type": "integer",
257
+ "primaryKey": false,
258
+ "notNull": true
259
+ },
260
+ "updated_at": {
261
+ "name": "updated_at",
262
+ "type": "integer",
263
+ "primaryKey": false,
264
+ "notNull": true
265
+ }
266
+ },
267
+ "indexes": {
268
+ "idx_collection_directory_item_site_collection_id": {
269
+ "name": "idx_collection_directory_item_site_collection_id",
270
+ "columns": [
271
+ {
272
+ "expression": "site_id",
273
+ "isExpression": false,
274
+ "asc": true,
275
+ "nulls": "last"
276
+ },
277
+ {
278
+ "expression": "collection_id",
279
+ "isExpression": false,
280
+ "asc": true,
281
+ "nulls": "last"
282
+ }
283
+ ],
284
+ "isUnique": false,
285
+ "concurrently": false,
286
+ "method": "btree",
287
+ "with": {}
288
+ },
289
+ "uq_collection_directory_item_site_position": {
290
+ "name": "uq_collection_directory_item_site_position",
291
+ "columns": [
292
+ {
293
+ "expression": "site_id",
294
+ "isExpression": false,
295
+ "asc": true,
296
+ "nulls": "last"
297
+ },
298
+ {
299
+ "expression": "position",
300
+ "isExpression": false,
301
+ "asc": true,
302
+ "nulls": "last"
303
+ }
304
+ ],
305
+ "isUnique": true,
306
+ "concurrently": false,
307
+ "method": "btree",
308
+ "with": {}
309
+ },
310
+ "uq_collection_directory_item_site_collection_once": {
311
+ "name": "uq_collection_directory_item_site_collection_once",
312
+ "columns": [
313
+ {
314
+ "expression": "site_id",
315
+ "isExpression": false,
316
+ "asc": true,
317
+ "nulls": "last"
318
+ },
319
+ {
320
+ "expression": "collection_id",
321
+ "isExpression": false,
322
+ "asc": true,
323
+ "nulls": "last"
324
+ }
325
+ ],
326
+ "isUnique": true,
327
+ "where": "\"collection_directory_item\".\"type\" = 'collection' AND \"collection_directory_item\".\"collection_id\" IS NOT NULL",
328
+ "concurrently": false,
329
+ "method": "btree",
330
+ "with": {}
331
+ }
332
+ },
333
+ "foreignKeys": {
334
+ "collection_directory_item_site_id_site_id_fk": {
335
+ "name": "collection_directory_item_site_id_site_id_fk",
336
+ "tableFrom": "collection_directory_item",
337
+ "tableTo": "site",
338
+ "columnsFrom": ["site_id"],
339
+ "columnsTo": ["id"],
340
+ "onDelete": "cascade",
341
+ "onUpdate": "no action"
342
+ },
343
+ "collection_directory_item_collection_id_collection_id_fk": {
344
+ "name": "collection_directory_item_collection_id_collection_id_fk",
345
+ "tableFrom": "collection_directory_item",
346
+ "tableTo": "collection",
347
+ "columnsFrom": ["collection_id"],
348
+ "columnsTo": ["id"],
349
+ "onDelete": "cascade",
350
+ "onUpdate": "no action"
351
+ }
352
+ },
353
+ "compositePrimaryKeys": {},
354
+ "uniqueConstraints": {},
355
+ "policies": {},
356
+ "checkConstraints": {
357
+ "chk_collection_directory_item_type": {
358
+ "name": "chk_collection_directory_item_type",
359
+ "value": "\"collection_directory_item\".\"type\" IN ('collection', 'divider', 'link')"
360
+ },
361
+ "chk_collection_directory_item_shape": {
362
+ "name": "chk_collection_directory_item_shape",
363
+ "value": "(\n \"collection_directory_item\".\"type\" = 'collection'\n AND \"collection_directory_item\".\"collection_id\" IS NOT NULL\n AND \"collection_directory_item\".\"label\" IS NULL\n AND \"collection_directory_item\".\"url\" IS NULL\n ) OR (\n \"collection_directory_item\".\"type\" = 'divider'\n AND \"collection_directory_item\".\"collection_id\" IS NULL\n AND \"collection_directory_item\".\"url\" IS NULL\n ) OR (\n \"collection_directory_item\".\"type\" = 'link'\n AND \"collection_directory_item\".\"collection_id\" IS NULL\n AND \"collection_directory_item\".\"label\" IS NOT NULL\n AND \"collection_directory_item\".\"url\" IS NOT NULL\n )"
364
+ },
365
+ "chk_collection_directory_item_label": {
366
+ "name": "chk_collection_directory_item_label",
367
+ "value": "\"collection_directory_item\".\"type\" <> 'collection' OR \"collection_directory_item\".\"label\" IS NULL"
368
+ },
369
+ "chk_collection_directory_item_description": {
370
+ "name": "chk_collection_directory_item_description",
371
+ "value": "\"collection_directory_item\".\"type\" = 'link' OR \"collection_directory_item\".\"description\" IS NULL"
372
+ }
373
+ },
374
+ "isRLSEnabled": false
375
+ },
376
+ "public.collection": {
377
+ "name": "collection",
378
+ "schema": "",
379
+ "columns": {
380
+ "id": {
381
+ "name": "id",
382
+ "type": "text",
383
+ "primaryKey": true,
384
+ "notNull": true
385
+ },
386
+ "site_id": {
387
+ "name": "site_id",
388
+ "type": "text",
389
+ "primaryKey": false,
390
+ "notNull": true
391
+ },
392
+ "title": {
393
+ "name": "title",
394
+ "type": "text",
395
+ "primaryKey": false,
396
+ "notNull": true
397
+ },
398
+ "description": {
399
+ "name": "description",
400
+ "type": "text",
401
+ "primaryKey": false,
402
+ "notNull": false
403
+ },
404
+ "sort_order": {
405
+ "name": "sort_order",
406
+ "type": "text",
407
+ "primaryKey": false,
408
+ "notNull": true,
409
+ "default": "'newest'"
410
+ },
411
+ "created_at": {
412
+ "name": "created_at",
413
+ "type": "integer",
414
+ "primaryKey": false,
415
+ "notNull": true
416
+ },
417
+ "updated_at": {
418
+ "name": "updated_at",
419
+ "type": "integer",
420
+ "primaryKey": false,
421
+ "notNull": true
422
+ }
423
+ },
424
+ "indexes": {
425
+ "idx_collection_site_created_at": {
426
+ "name": "idx_collection_site_created_at",
427
+ "columns": [
428
+ {
429
+ "expression": "site_id",
430
+ "isExpression": false,
431
+ "asc": true,
432
+ "nulls": "last"
433
+ },
434
+ {
435
+ "expression": "created_at",
436
+ "isExpression": false,
437
+ "asc": true,
438
+ "nulls": "last"
439
+ }
440
+ ],
441
+ "isUnique": false,
442
+ "concurrently": false,
443
+ "method": "btree",
444
+ "with": {}
445
+ }
446
+ },
447
+ "foreignKeys": {
448
+ "collection_site_id_site_id_fk": {
449
+ "name": "collection_site_id_site_id_fk",
450
+ "tableFrom": "collection",
451
+ "tableTo": "site",
452
+ "columnsFrom": ["site_id"],
453
+ "columnsTo": ["id"],
454
+ "onDelete": "cascade",
455
+ "onUpdate": "no action"
456
+ }
457
+ },
458
+ "compositePrimaryKeys": {},
459
+ "uniqueConstraints": {},
460
+ "policies": {},
461
+ "checkConstraints": {
462
+ "chk_collection_sort_order": {
463
+ "name": "chk_collection_sort_order",
464
+ "value": "\"collection\".\"sort_order\" IN ('newest', 'oldest', 'rating_desc')"
465
+ }
466
+ },
467
+ "isRLSEnabled": false
468
+ },
469
+ "public.github_app_installation": {
470
+ "name": "github_app_installation",
471
+ "schema": "",
472
+ "columns": {
473
+ "installation_id": {
474
+ "name": "installation_id",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true
478
+ },
479
+ "site_id": {
480
+ "name": "site_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "account_login": {
486
+ "name": "account_login",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "account_type": {
492
+ "name": "account_type",
493
+ "type": "text",
494
+ "primaryKey": false,
495
+ "notNull": true
496
+ },
497
+ "account_avatar_url": {
498
+ "name": "account_avatar_url",
499
+ "type": "text",
500
+ "primaryKey": false,
501
+ "notNull": true,
502
+ "default": "''"
503
+ },
504
+ "added_at": {
505
+ "name": "added_at",
506
+ "type": "integer",
507
+ "primaryKey": false,
508
+ "notNull": true
509
+ }
510
+ },
511
+ "indexes": {
512
+ "github_app_installation_by_installation": {
513
+ "name": "github_app_installation_by_installation",
514
+ "columns": [
515
+ {
516
+ "expression": "installation_id",
517
+ "isExpression": false,
518
+ "asc": true,
519
+ "nulls": "last"
520
+ }
521
+ ],
522
+ "isUnique": false,
523
+ "concurrently": false,
524
+ "method": "btree",
525
+ "with": {}
526
+ },
527
+ "github_app_installation_by_site": {
528
+ "name": "github_app_installation_by_site",
529
+ "columns": [
530
+ {
531
+ "expression": "site_id",
532
+ "isExpression": false,
533
+ "asc": true,
534
+ "nulls": "last"
535
+ }
536
+ ],
537
+ "isUnique": false,
538
+ "concurrently": false,
539
+ "method": "btree",
540
+ "with": {}
541
+ }
542
+ },
543
+ "foreignKeys": {
544
+ "github_app_installation_site_id_site_id_fk": {
545
+ "name": "github_app_installation_site_id_site_id_fk",
546
+ "tableFrom": "github_app_installation",
547
+ "tableTo": "site",
548
+ "columnsFrom": ["site_id"],
549
+ "columnsTo": ["id"],
550
+ "onDelete": "cascade",
551
+ "onUpdate": "no action"
552
+ }
553
+ },
554
+ "compositePrimaryKeys": {
555
+ "github_app_installation_installation_id_site_id_pk": {
556
+ "name": "github_app_installation_installation_id_site_id_pk",
557
+ "columns": ["installation_id", "site_id"]
558
+ }
559
+ },
560
+ "uniqueConstraints": {},
561
+ "policies": {},
562
+ "checkConstraints": {
563
+ "chk_github_app_installation_account_type": {
564
+ "name": "chk_github_app_installation_account_type",
565
+ "value": "\"github_app_installation\".\"account_type\" IN ('User', 'Organization')"
566
+ }
567
+ },
568
+ "isRLSEnabled": false
569
+ },
570
+ "public.media": {
571
+ "name": "media",
572
+ "schema": "",
573
+ "columns": {
574
+ "id": {
575
+ "name": "id",
576
+ "type": "text",
577
+ "primaryKey": true,
578
+ "notNull": true
579
+ },
580
+ "site_id": {
581
+ "name": "site_id",
582
+ "type": "text",
583
+ "primaryKey": false,
584
+ "notNull": true
585
+ },
586
+ "post_id": {
587
+ "name": "post_id",
588
+ "type": "text",
589
+ "primaryKey": false,
590
+ "notNull": false
591
+ },
592
+ "filename": {
593
+ "name": "filename",
594
+ "type": "text",
595
+ "primaryKey": false,
596
+ "notNull": true
597
+ },
598
+ "original_name": {
599
+ "name": "original_name",
600
+ "type": "text",
601
+ "primaryKey": false,
602
+ "notNull": true
603
+ },
604
+ "mime_type": {
605
+ "name": "mime_type",
606
+ "type": "text",
607
+ "primaryKey": false,
608
+ "notNull": true
609
+ },
610
+ "size": {
611
+ "name": "size",
612
+ "type": "integer",
613
+ "primaryKey": false,
614
+ "notNull": true
615
+ },
616
+ "storage_key": {
617
+ "name": "storage_key",
618
+ "type": "text",
619
+ "primaryKey": false,
620
+ "notNull": true
621
+ },
622
+ "provider": {
623
+ "name": "provider",
624
+ "type": "text",
625
+ "primaryKey": false,
626
+ "notNull": true,
627
+ "default": "'r2'"
628
+ },
629
+ "width": {
630
+ "name": "width",
631
+ "type": "integer",
632
+ "primaryKey": false,
633
+ "notNull": false
634
+ },
635
+ "height": {
636
+ "name": "height",
637
+ "type": "integer",
638
+ "primaryKey": false,
639
+ "notNull": false
640
+ },
641
+ "duration_seconds": {
642
+ "name": "duration_seconds",
643
+ "type": "integer",
644
+ "primaryKey": false,
645
+ "notNull": false
646
+ },
647
+ "alt": {
648
+ "name": "alt",
649
+ "type": "text",
650
+ "primaryKey": false,
651
+ "notNull": false
652
+ },
653
+ "position": {
654
+ "name": "position",
655
+ "type": "text",
656
+ "primaryKey": false,
657
+ "notNull": true,
658
+ "default": "'a0'"
659
+ },
660
+ "blurhash": {
661
+ "name": "blurhash",
662
+ "type": "text",
663
+ "primaryKey": false,
664
+ "notNull": false
665
+ },
666
+ "waveform": {
667
+ "name": "waveform",
668
+ "type": "text",
669
+ "primaryKey": false,
670
+ "notNull": false
671
+ },
672
+ "poster_key": {
673
+ "name": "poster_key",
674
+ "type": "text",
675
+ "primaryKey": false,
676
+ "notNull": false
677
+ },
678
+ "summary": {
679
+ "name": "summary",
680
+ "type": "text",
681
+ "primaryKey": false,
682
+ "notNull": false
683
+ },
684
+ "chars": {
685
+ "name": "chars",
686
+ "type": "integer",
687
+ "primaryKey": false,
688
+ "notNull": false
689
+ },
690
+ "media_kind": {
691
+ "name": "media_kind",
692
+ "type": "text",
693
+ "primaryKey": false,
694
+ "notNull": true,
695
+ "default": "'document'"
696
+ },
697
+ "created_at": {
698
+ "name": "created_at",
699
+ "type": "integer",
700
+ "primaryKey": false,
701
+ "notNull": true
702
+ },
703
+ "updated_at": {
704
+ "name": "updated_at",
705
+ "type": "integer",
706
+ "primaryKey": false,
707
+ "notNull": true
708
+ }
709
+ },
710
+ "indexes": {
711
+ "idx_media_site_post_id_position": {
712
+ "name": "idx_media_site_post_id_position",
713
+ "columns": [
714
+ {
715
+ "expression": "site_id",
716
+ "isExpression": false,
717
+ "asc": true,
718
+ "nulls": "last"
719
+ },
720
+ {
721
+ "expression": "post_id",
722
+ "isExpression": false,
723
+ "asc": true,
724
+ "nulls": "last"
725
+ },
726
+ {
727
+ "expression": "position",
728
+ "isExpression": false,
729
+ "asc": true,
730
+ "nulls": "last"
731
+ }
732
+ ],
733
+ "isUnique": false,
734
+ "concurrently": false,
735
+ "method": "btree",
736
+ "with": {}
737
+ },
738
+ "uq_media_site_post_position": {
739
+ "name": "uq_media_site_post_position",
740
+ "columns": [
741
+ {
742
+ "expression": "site_id",
743
+ "isExpression": false,
744
+ "asc": true,
745
+ "nulls": "last"
746
+ },
747
+ {
748
+ "expression": "post_id",
749
+ "isExpression": false,
750
+ "asc": true,
751
+ "nulls": "last"
752
+ },
753
+ {
754
+ "expression": "position",
755
+ "isExpression": false,
756
+ "asc": true,
757
+ "nulls": "last"
758
+ }
759
+ ],
760
+ "isUnique": true,
761
+ "where": "\"media\".\"post_id\" IS NOT NULL",
762
+ "concurrently": false,
763
+ "method": "btree",
764
+ "with": {}
765
+ },
766
+ "uq_media_provider_storage_key": {
767
+ "name": "uq_media_provider_storage_key",
768
+ "columns": [
769
+ {
770
+ "expression": "provider",
771
+ "isExpression": false,
772
+ "asc": true,
773
+ "nulls": "last"
774
+ },
775
+ {
776
+ "expression": "storage_key",
777
+ "isExpression": false,
778
+ "asc": true,
779
+ "nulls": "last"
780
+ }
781
+ ],
782
+ "isUnique": true,
783
+ "concurrently": false,
784
+ "method": "btree",
785
+ "with": {}
786
+ },
787
+ "idx_media_site_media_kind_post_id": {
788
+ "name": "idx_media_site_media_kind_post_id",
789
+ "columns": [
790
+ {
791
+ "expression": "site_id",
792
+ "isExpression": false,
793
+ "asc": true,
794
+ "nulls": "last"
795
+ },
796
+ {
797
+ "expression": "media_kind",
798
+ "isExpression": false,
799
+ "asc": true,
800
+ "nulls": "last"
801
+ },
802
+ {
803
+ "expression": "post_id",
804
+ "isExpression": false,
805
+ "asc": true,
806
+ "nulls": "last"
807
+ }
808
+ ],
809
+ "isUnique": false,
810
+ "concurrently": false,
811
+ "method": "btree",
812
+ "with": {}
813
+ }
814
+ },
815
+ "foreignKeys": {
816
+ "media_site_id_site_id_fk": {
817
+ "name": "media_site_id_site_id_fk",
818
+ "tableFrom": "media",
819
+ "tableTo": "site",
820
+ "columnsFrom": ["site_id"],
821
+ "columnsTo": ["id"],
822
+ "onDelete": "cascade",
823
+ "onUpdate": "no action"
824
+ },
825
+ "media_post_id_post_id_fk": {
826
+ "name": "media_post_id_post_id_fk",
827
+ "tableFrom": "media",
828
+ "tableTo": "post",
829
+ "columnsFrom": ["post_id"],
830
+ "columnsTo": ["id"],
831
+ "onDelete": "set null",
832
+ "onUpdate": "no action"
833
+ }
834
+ },
835
+ "compositePrimaryKeys": {},
836
+ "uniqueConstraints": {},
837
+ "policies": {},
838
+ "checkConstraints": {
839
+ "chk_media_size_positive": {
840
+ "name": "chk_media_size_positive",
841
+ "value": "\"media\".\"size\" > 0"
842
+ },
843
+ "chk_media_position_not_blank": {
844
+ "name": "chk_media_position_not_blank",
845
+ "value": "trim(\"media\".\"position\") <> ''"
846
+ },
847
+ "chk_media_dimensions_positive": {
848
+ "name": "chk_media_dimensions_positive",
849
+ "value": "(\n \"media\".\"width\" IS NULL OR \"media\".\"width\" > 0\n ) AND (\n \"media\".\"height\" IS NULL OR \"media\".\"height\" > 0\n )"
850
+ },
851
+ "chk_media_chars_nonnegative": {
852
+ "name": "chk_media_chars_nonnegative",
853
+ "value": "\"media\".\"chars\" IS NULL OR \"media\".\"chars\" >= 0"
854
+ }
855
+ },
856
+ "isRLSEnabled": false
857
+ },
858
+ "public.nav_item": {
859
+ "name": "nav_item",
860
+ "schema": "",
861
+ "columns": {
862
+ "id": {
863
+ "name": "id",
864
+ "type": "text",
865
+ "primaryKey": true,
866
+ "notNull": true
867
+ },
868
+ "site_id": {
869
+ "name": "site_id",
870
+ "type": "text",
871
+ "primaryKey": false,
872
+ "notNull": true
873
+ },
874
+ "type": {
875
+ "name": "type",
876
+ "type": "text",
877
+ "primaryKey": false,
878
+ "notNull": true,
879
+ "default": "'link'"
880
+ },
881
+ "system_key": {
882
+ "name": "system_key",
883
+ "type": "text",
884
+ "primaryKey": false,
885
+ "notNull": false
886
+ },
887
+ "collection_id": {
888
+ "name": "collection_id",
889
+ "type": "text",
890
+ "primaryKey": false,
891
+ "notNull": false
892
+ },
893
+ "post_id": {
894
+ "name": "post_id",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": false
898
+ },
899
+ "label": {
900
+ "name": "label",
901
+ "type": "text",
902
+ "primaryKey": false,
903
+ "notNull": true
904
+ },
905
+ "url": {
906
+ "name": "url",
907
+ "type": "text",
908
+ "primaryKey": false,
909
+ "notNull": true
910
+ },
911
+ "placement": {
912
+ "name": "placement",
913
+ "type": "text",
914
+ "primaryKey": false,
915
+ "notNull": true,
916
+ "default": "'header'"
917
+ },
918
+ "position": {
919
+ "name": "position",
920
+ "type": "text",
921
+ "primaryKey": false,
922
+ "notNull": true,
923
+ "default": "'a0'"
924
+ },
925
+ "created_at": {
926
+ "name": "created_at",
927
+ "type": "integer",
928
+ "primaryKey": false,
929
+ "notNull": true
930
+ },
931
+ "updated_at": {
932
+ "name": "updated_at",
933
+ "type": "integer",
934
+ "primaryKey": false,
935
+ "notNull": true
936
+ }
937
+ },
938
+ "indexes": {
939
+ "uq_nav_item_site_position": {
940
+ "name": "uq_nav_item_site_position",
941
+ "columns": [
942
+ {
943
+ "expression": "site_id",
944
+ "isExpression": false,
945
+ "asc": true,
946
+ "nulls": "last"
947
+ },
948
+ {
949
+ "expression": "position",
950
+ "isExpression": false,
951
+ "asc": true,
952
+ "nulls": "last"
953
+ }
954
+ ],
955
+ "isUnique": true,
956
+ "concurrently": false,
957
+ "method": "btree",
958
+ "with": {}
959
+ },
960
+ "uq_nav_item_site_system_key": {
961
+ "name": "uq_nav_item_site_system_key",
962
+ "columns": [
963
+ {
964
+ "expression": "site_id",
965
+ "isExpression": false,
966
+ "asc": true,
967
+ "nulls": "last"
968
+ },
969
+ {
970
+ "expression": "system_key",
971
+ "isExpression": false,
972
+ "asc": true,
973
+ "nulls": "last"
974
+ }
975
+ ],
976
+ "isUnique": true,
977
+ "where": "\"nav_item\".\"system_key\" IS NOT NULL",
978
+ "concurrently": false,
979
+ "method": "btree",
980
+ "with": {}
981
+ },
982
+ "uq_nav_item_site_collection_id": {
983
+ "name": "uq_nav_item_site_collection_id",
984
+ "columns": [
985
+ {
986
+ "expression": "site_id",
987
+ "isExpression": false,
988
+ "asc": true,
989
+ "nulls": "last"
990
+ },
991
+ {
992
+ "expression": "collection_id",
993
+ "isExpression": false,
994
+ "asc": true,
995
+ "nulls": "last"
996
+ }
997
+ ],
998
+ "isUnique": true,
999
+ "where": "\"nav_item\".\"collection_id\" IS NOT NULL",
1000
+ "concurrently": false,
1001
+ "method": "btree",
1002
+ "with": {}
1003
+ },
1004
+ "uq_nav_item_site_post_id": {
1005
+ "name": "uq_nav_item_site_post_id",
1006
+ "columns": [
1007
+ {
1008
+ "expression": "site_id",
1009
+ "isExpression": false,
1010
+ "asc": true,
1011
+ "nulls": "last"
1012
+ },
1013
+ {
1014
+ "expression": "post_id",
1015
+ "isExpression": false,
1016
+ "asc": true,
1017
+ "nulls": "last"
1018
+ }
1019
+ ],
1020
+ "isUnique": true,
1021
+ "where": "\"nav_item\".\"post_id\" IS NOT NULL",
1022
+ "concurrently": false,
1023
+ "method": "btree",
1024
+ "with": {}
1025
+ }
1026
+ },
1027
+ "foreignKeys": {
1028
+ "nav_item_site_id_site_id_fk": {
1029
+ "name": "nav_item_site_id_site_id_fk",
1030
+ "tableFrom": "nav_item",
1031
+ "tableTo": "site",
1032
+ "columnsFrom": ["site_id"],
1033
+ "columnsTo": ["id"],
1034
+ "onDelete": "cascade",
1035
+ "onUpdate": "no action"
1036
+ },
1037
+ "nav_item_collection_id_collection_id_fk": {
1038
+ "name": "nav_item_collection_id_collection_id_fk",
1039
+ "tableFrom": "nav_item",
1040
+ "tableTo": "collection",
1041
+ "columnsFrom": ["collection_id"],
1042
+ "columnsTo": ["id"],
1043
+ "onDelete": "cascade",
1044
+ "onUpdate": "no action"
1045
+ },
1046
+ "nav_item_post_id_post_id_fk": {
1047
+ "name": "nav_item_post_id_post_id_fk",
1048
+ "tableFrom": "nav_item",
1049
+ "tableTo": "post",
1050
+ "columnsFrom": ["post_id"],
1051
+ "columnsTo": ["id"],
1052
+ "onDelete": "cascade",
1053
+ "onUpdate": "no action"
1054
+ }
1055
+ },
1056
+ "compositePrimaryKeys": {},
1057
+ "uniqueConstraints": {},
1058
+ "policies": {},
1059
+ "checkConstraints": {
1060
+ "chk_nav_item_type": {
1061
+ "name": "chk_nav_item_type",
1062
+ "value": "\"nav_item\".\"type\" IN ('link', 'system', 'collection', 'page')"
1063
+ },
1064
+ "chk_nav_item_placement": {
1065
+ "name": "chk_nav_item_placement",
1066
+ "value": "\"nav_item\".\"placement\" IN ('header', 'more')"
1067
+ },
1068
+ "chk_nav_item_shape": {
1069
+ "name": "chk_nav_item_shape",
1070
+ "value": "(\n \"nav_item\".\"type\" = 'link'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n AND \"nav_item\".\"post_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'system'\n AND \"nav_item\".\"system_key\" IS NOT NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n AND \"nav_item\".\"post_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'collection'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NOT NULL\n AND \"nav_item\".\"post_id\" IS NULL\n ) OR (\n \"nav_item\".\"type\" = 'page'\n AND \"nav_item\".\"system_key\" IS NULL\n AND \"nav_item\".\"collection_id\" IS NULL\n AND \"nav_item\".\"post_id\" IS NOT NULL\n )"
1071
+ }
1072
+ },
1073
+ "isRLSEnabled": false
1074
+ },
1075
+ "public.path_registry": {
1076
+ "name": "path_registry",
1077
+ "schema": "",
1078
+ "columns": {
1079
+ "id": {
1080
+ "name": "id",
1081
+ "type": "text",
1082
+ "primaryKey": true,
1083
+ "notNull": true
1084
+ },
1085
+ "site_id": {
1086
+ "name": "site_id",
1087
+ "type": "text",
1088
+ "primaryKey": false,
1089
+ "notNull": true
1090
+ },
1091
+ "path": {
1092
+ "name": "path",
1093
+ "type": "text",
1094
+ "primaryKey": false,
1095
+ "notNull": true
1096
+ },
1097
+ "kind": {
1098
+ "name": "kind",
1099
+ "type": "text",
1100
+ "primaryKey": false,
1101
+ "notNull": true
1102
+ },
1103
+ "post_id": {
1104
+ "name": "post_id",
1105
+ "type": "text",
1106
+ "primaryKey": false,
1107
+ "notNull": false
1108
+ },
1109
+ "collection_id": {
1110
+ "name": "collection_id",
1111
+ "type": "text",
1112
+ "primaryKey": false,
1113
+ "notNull": false
1114
+ },
1115
+ "redirect_to_path": {
1116
+ "name": "redirect_to_path",
1117
+ "type": "text",
1118
+ "primaryKey": false,
1119
+ "notNull": false
1120
+ },
1121
+ "redirect_type": {
1122
+ "name": "redirect_type",
1123
+ "type": "integer",
1124
+ "primaryKey": false,
1125
+ "notNull": false
1126
+ },
1127
+ "archive_query": {
1128
+ "name": "archive_query",
1129
+ "type": "text",
1130
+ "primaryKey": false,
1131
+ "notNull": false
1132
+ },
1133
+ "created_at": {
1134
+ "name": "created_at",
1135
+ "type": "integer",
1136
+ "primaryKey": false,
1137
+ "notNull": true
1138
+ },
1139
+ "updated_at": {
1140
+ "name": "updated_at",
1141
+ "type": "integer",
1142
+ "primaryKey": false,
1143
+ "notNull": true
1144
+ }
1145
+ },
1146
+ "indexes": {
1147
+ "uq_path_registry_site_path": {
1148
+ "name": "uq_path_registry_site_path",
1149
+ "columns": [
1150
+ {
1151
+ "expression": "site_id",
1152
+ "isExpression": false,
1153
+ "asc": true,
1154
+ "nulls": "last"
1155
+ },
1156
+ {
1157
+ "expression": "path",
1158
+ "isExpression": false,
1159
+ "asc": true,
1160
+ "nulls": "last"
1161
+ }
1162
+ ],
1163
+ "isUnique": true,
1164
+ "concurrently": false,
1165
+ "method": "btree",
1166
+ "with": {}
1167
+ },
1168
+ "uq_path_registry_site_post_slug": {
1169
+ "name": "uq_path_registry_site_post_slug",
1170
+ "columns": [
1171
+ {
1172
+ "expression": "site_id",
1173
+ "isExpression": false,
1174
+ "asc": true,
1175
+ "nulls": "last"
1176
+ },
1177
+ {
1178
+ "expression": "post_id",
1179
+ "isExpression": false,
1180
+ "asc": true,
1181
+ "nulls": "last"
1182
+ }
1183
+ ],
1184
+ "isUnique": true,
1185
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"post_id\" IS NOT NULL",
1186
+ "concurrently": false,
1187
+ "method": "btree",
1188
+ "with": {}
1189
+ },
1190
+ "uq_path_registry_site_collection_slug": {
1191
+ "name": "uq_path_registry_site_collection_slug",
1192
+ "columns": [
1193
+ {
1194
+ "expression": "site_id",
1195
+ "isExpression": false,
1196
+ "asc": true,
1197
+ "nulls": "last"
1198
+ },
1199
+ {
1200
+ "expression": "collection_id",
1201
+ "isExpression": false,
1202
+ "asc": true,
1203
+ "nulls": "last"
1204
+ }
1205
+ ],
1206
+ "isUnique": true,
1207
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"collection_id\" IS NOT NULL",
1208
+ "concurrently": false,
1209
+ "method": "btree",
1210
+ "with": {}
1211
+ },
1212
+ "idx_path_registry_site_post_id": {
1213
+ "name": "idx_path_registry_site_post_id",
1214
+ "columns": [
1215
+ {
1216
+ "expression": "site_id",
1217
+ "isExpression": false,
1218
+ "asc": true,
1219
+ "nulls": "last"
1220
+ },
1221
+ {
1222
+ "expression": "post_id",
1223
+ "isExpression": false,
1224
+ "asc": true,
1225
+ "nulls": "last"
1226
+ }
1227
+ ],
1228
+ "isUnique": false,
1229
+ "concurrently": false,
1230
+ "method": "btree",
1231
+ "with": {}
1232
+ },
1233
+ "idx_path_registry_site_collection_id": {
1234
+ "name": "idx_path_registry_site_collection_id",
1235
+ "columns": [
1236
+ {
1237
+ "expression": "site_id",
1238
+ "isExpression": false,
1239
+ "asc": true,
1240
+ "nulls": "last"
1241
+ },
1242
+ {
1243
+ "expression": "collection_id",
1244
+ "isExpression": false,
1245
+ "asc": true,
1246
+ "nulls": "last"
1247
+ }
1248
+ ],
1249
+ "isUnique": false,
1250
+ "concurrently": false,
1251
+ "method": "btree",
1252
+ "with": {}
1253
+ }
1254
+ },
1255
+ "foreignKeys": {
1256
+ "path_registry_site_id_site_id_fk": {
1257
+ "name": "path_registry_site_id_site_id_fk",
1258
+ "tableFrom": "path_registry",
1259
+ "tableTo": "site",
1260
+ "columnsFrom": ["site_id"],
1261
+ "columnsTo": ["id"],
1262
+ "onDelete": "cascade",
1263
+ "onUpdate": "no action"
1264
+ },
1265
+ "path_registry_post_id_post_id_fk": {
1266
+ "name": "path_registry_post_id_post_id_fk",
1267
+ "tableFrom": "path_registry",
1268
+ "tableTo": "post",
1269
+ "columnsFrom": ["post_id"],
1270
+ "columnsTo": ["id"],
1271
+ "onDelete": "cascade",
1272
+ "onUpdate": "no action"
1273
+ },
1274
+ "path_registry_collection_id_collection_id_fk": {
1275
+ "name": "path_registry_collection_id_collection_id_fk",
1276
+ "tableFrom": "path_registry",
1277
+ "tableTo": "collection",
1278
+ "columnsFrom": ["collection_id"],
1279
+ "columnsTo": ["id"],
1280
+ "onDelete": "cascade",
1281
+ "onUpdate": "no action"
1282
+ }
1283
+ },
1284
+ "compositePrimaryKeys": {},
1285
+ "uniqueConstraints": {},
1286
+ "policies": {},
1287
+ "checkConstraints": {
1288
+ "chk_path_registry_kind": {
1289
+ "name": "chk_path_registry_kind",
1290
+ "value": "\"path_registry\".\"kind\" IN ('slug', 'alias', 'redirect', 'archive')"
1291
+ },
1292
+ "chk_path_registry_shape": {
1293
+ "name": "chk_path_registry_shape",
1294
+ "value": "(\n \"path_registry\".\"kind\" IN ('slug', 'alias')\n AND (\n (\"path_registry\".\"post_id\" IS NOT NULL AND \"path_registry\".\"collection_id\" IS NULL)\n OR (\"path_registry\".\"post_id\" IS NULL AND \"path_registry\".\"collection_id\" IS NOT NULL)\n )\n AND \"path_registry\".\"redirect_to_path\" IS NULL\n AND \"path_registry\".\"redirect_type\" IS NULL\n AND \"path_registry\".\"archive_query\" IS NULL\n ) OR (\n \"path_registry\".\"kind\" = 'redirect'\n AND \"path_registry\".\"post_id\" IS NULL\n AND \"path_registry\".\"collection_id\" IS NULL\n AND \"path_registry\".\"redirect_to_path\" IS NOT NULL\n AND \"path_registry\".\"redirect_type\" IN (301, 302)\n AND \"path_registry\".\"archive_query\" IS NULL\n ) OR (\n \"path_registry\".\"kind\" = 'archive'\n AND \"path_registry\".\"post_id\" IS NULL\n AND \"path_registry\".\"collection_id\" IS NULL\n AND \"path_registry\".\"redirect_to_path\" IS NULL\n AND \"path_registry\".\"redirect_type\" IS NULL\n AND \"path_registry\".\"archive_query\" IS NOT NULL\n )"
1295
+ }
1296
+ },
1297
+ "isRLSEnabled": false
1298
+ },
1299
+ "public.post": {
1300
+ "name": "post",
1301
+ "schema": "",
1302
+ "columns": {
1303
+ "id": {
1304
+ "name": "id",
1305
+ "type": "text",
1306
+ "primaryKey": true,
1307
+ "notNull": true
1308
+ },
1309
+ "site_id": {
1310
+ "name": "site_id",
1311
+ "type": "text",
1312
+ "primaryKey": false,
1313
+ "notNull": true
1314
+ },
1315
+ "format": {
1316
+ "name": "format",
1317
+ "type": "text",
1318
+ "primaryKey": false,
1319
+ "notNull": true
1320
+ },
1321
+ "status": {
1322
+ "name": "status",
1323
+ "type": "text",
1324
+ "primaryKey": false,
1325
+ "notNull": true,
1326
+ "default": "'published'"
1327
+ },
1328
+ "visibility": {
1329
+ "name": "visibility",
1330
+ "type": "text",
1331
+ "primaryKey": false,
1332
+ "notNull": false,
1333
+ "default": "'public'"
1334
+ },
1335
+ "pinned_at": {
1336
+ "name": "pinned_at",
1337
+ "type": "integer",
1338
+ "primaryKey": false,
1339
+ "notNull": false
1340
+ },
1341
+ "featured_at": {
1342
+ "name": "featured_at",
1343
+ "type": "integer",
1344
+ "primaryKey": false,
1345
+ "notNull": false
1346
+ },
1347
+ "title": {
1348
+ "name": "title",
1349
+ "type": "text",
1350
+ "primaryKey": false,
1351
+ "notNull": false
1352
+ },
1353
+ "url": {
1354
+ "name": "url",
1355
+ "type": "text",
1356
+ "primaryKey": false,
1357
+ "notNull": false
1358
+ },
1359
+ "body": {
1360
+ "name": "body",
1361
+ "type": "text",
1362
+ "primaryKey": false,
1363
+ "notNull": false
1364
+ },
1365
+ "body_html": {
1366
+ "name": "body_html",
1367
+ "type": "text",
1368
+ "primaryKey": false,
1369
+ "notNull": false
1370
+ },
1371
+ "body_html_version": {
1372
+ "name": "body_html_version",
1373
+ "type": "integer",
1374
+ "primaryKey": false,
1375
+ "notNull": true,
1376
+ "default": 1
1377
+ },
1378
+ "body_text": {
1379
+ "name": "body_text",
1380
+ "type": "text",
1381
+ "primaryKey": false,
1382
+ "notNull": false
1383
+ },
1384
+ "quote_text": {
1385
+ "name": "quote_text",
1386
+ "type": "text",
1387
+ "primaryKey": false,
1388
+ "notNull": false
1389
+ },
1390
+ "summary": {
1391
+ "name": "summary",
1392
+ "type": "text",
1393
+ "primaryKey": false,
1394
+ "notNull": false
1395
+ },
1396
+ "search_text": {
1397
+ "name": "search_text",
1398
+ "type": "text",
1399
+ "primaryKey": false,
1400
+ "notNull": false,
1401
+ "generated": {
1402
+ "as": "coalesce(\"title\", '') || ' ' || coalesce(\"url\", '') || ' ' || coalesce(\"quote_text\", '') || ' ' || coalesce(\"body_text\", '')",
1403
+ "type": "stored"
1404
+ }
1405
+ },
1406
+ "search_document": {
1407
+ "name": "search_document",
1408
+ "type": "tsvector",
1409
+ "primaryKey": false,
1410
+ "notNull": false,
1411
+ "generated": {
1412
+ "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')",
1413
+ "type": "stored"
1414
+ }
1415
+ },
1416
+ "rating": {
1417
+ "name": "rating",
1418
+ "type": "integer",
1419
+ "primaryKey": false,
1420
+ "notNull": false
1421
+ },
1422
+ "preview_image_key": {
1423
+ "name": "preview_image_key",
1424
+ "type": "text",
1425
+ "primaryKey": false,
1426
+ "notNull": false
1427
+ },
1428
+ "preview_kind": {
1429
+ "name": "preview_kind",
1430
+ "type": "text",
1431
+ "primaryKey": false,
1432
+ "notNull": false
1433
+ },
1434
+ "preview_provider": {
1435
+ "name": "preview_provider",
1436
+ "type": "text",
1437
+ "primaryKey": false,
1438
+ "notNull": false
1439
+ },
1440
+ "reply_to_id": {
1441
+ "name": "reply_to_id",
1442
+ "type": "text",
1443
+ "primaryKey": false,
1444
+ "notNull": false
1445
+ },
1446
+ "thread_id": {
1447
+ "name": "thread_id",
1448
+ "type": "text",
1449
+ "primaryKey": false,
1450
+ "notNull": true
1451
+ },
1452
+ "language": {
1453
+ "name": "language",
1454
+ "type": "text",
1455
+ "primaryKey": false,
1456
+ "notNull": false
1457
+ },
1458
+ "translation_group_id": {
1459
+ "name": "translation_group_id",
1460
+ "type": "text",
1461
+ "primaryKey": false,
1462
+ "notNull": false
1463
+ },
1464
+ "quiet_reply": {
1465
+ "name": "quiet_reply",
1466
+ "type": "boolean",
1467
+ "primaryKey": false,
1468
+ "notNull": true,
1469
+ "default": false
1470
+ },
1471
+ "published_at": {
1472
+ "name": "published_at",
1473
+ "type": "integer",
1474
+ "primaryKey": false,
1475
+ "notNull": false
1476
+ },
1477
+ "last_activity_at": {
1478
+ "name": "last_activity_at",
1479
+ "type": "integer",
1480
+ "primaryKey": false,
1481
+ "notNull": false
1482
+ },
1483
+ "thread_updated_at": {
1484
+ "name": "thread_updated_at",
1485
+ "type": "integer",
1486
+ "primaryKey": false,
1487
+ "notNull": false
1488
+ },
1489
+ "created_at": {
1490
+ "name": "created_at",
1491
+ "type": "integer",
1492
+ "primaryKey": false,
1493
+ "notNull": true
1494
+ },
1495
+ "updated_at": {
1496
+ "name": "updated_at",
1497
+ "type": "integer",
1498
+ "primaryKey": false,
1499
+ "notNull": true
1500
+ }
1501
+ },
1502
+ "indexes": {
1503
+ "idx_post_site_thread_id": {
1504
+ "name": "idx_post_site_thread_id",
1505
+ "columns": [
1506
+ {
1507
+ "expression": "site_id",
1508
+ "isExpression": false,
1509
+ "asc": true,
1510
+ "nulls": "last"
1511
+ },
1512
+ {
1513
+ "expression": "thread_id",
1514
+ "isExpression": false,
1515
+ "asc": true,
1516
+ "nulls": "last"
1517
+ }
1518
+ ],
1519
+ "isUnique": false,
1520
+ "concurrently": false,
1521
+ "method": "btree",
1522
+ "with": {}
1523
+ },
1524
+ "idx_post_site_thread_created": {
1525
+ "name": "idx_post_site_thread_created",
1526
+ "columns": [
1527
+ {
1528
+ "expression": "site_id",
1529
+ "isExpression": false,
1530
+ "asc": true,
1531
+ "nulls": "last"
1532
+ },
1533
+ {
1534
+ "expression": "thread_id",
1535
+ "isExpression": false,
1536
+ "asc": true,
1537
+ "nulls": "last"
1538
+ },
1539
+ {
1540
+ "expression": "created_at",
1541
+ "isExpression": false,
1542
+ "asc": true,
1543
+ "nulls": "last"
1544
+ },
1545
+ {
1546
+ "expression": "id",
1547
+ "isExpression": false,
1548
+ "asc": true,
1549
+ "nulls": "last"
1550
+ }
1551
+ ],
1552
+ "isUnique": false,
1553
+ "concurrently": false,
1554
+ "method": "btree",
1555
+ "with": {}
1556
+ },
1557
+ "idx_post_site_status_published": {
1558
+ "name": "idx_post_site_status_published",
1559
+ "columns": [
1560
+ {
1561
+ "expression": "site_id",
1562
+ "isExpression": false,
1563
+ "asc": true,
1564
+ "nulls": "last"
1565
+ },
1566
+ {
1567
+ "expression": "status",
1568
+ "isExpression": false,
1569
+ "asc": true,
1570
+ "nulls": "last"
1571
+ },
1572
+ {
1573
+ "expression": "published_at",
1574
+ "isExpression": false,
1575
+ "asc": true,
1576
+ "nulls": "last"
1577
+ }
1578
+ ],
1579
+ "isUnique": false,
1580
+ "concurrently": false,
1581
+ "method": "btree",
1582
+ "with": {}
1583
+ },
1584
+ "idx_post_site_status_activity": {
1585
+ "name": "idx_post_site_status_activity",
1586
+ "columns": [
1587
+ {
1588
+ "expression": "site_id",
1589
+ "isExpression": false,
1590
+ "asc": true,
1591
+ "nulls": "last"
1592
+ },
1593
+ {
1594
+ "expression": "status",
1595
+ "isExpression": false,
1596
+ "asc": true,
1597
+ "nulls": "last"
1598
+ },
1599
+ {
1600
+ "expression": "last_activity_at",
1601
+ "isExpression": false,
1602
+ "asc": true,
1603
+ "nulls": "last"
1604
+ }
1605
+ ],
1606
+ "isUnique": false,
1607
+ "concurrently": false,
1608
+ "method": "btree",
1609
+ "with": {}
1610
+ },
1611
+ "idx_post_site_root_published_activity": {
1612
+ "name": "idx_post_site_root_published_activity",
1613
+ "columns": [
1614
+ {
1615
+ "expression": "site_id",
1616
+ "isExpression": false,
1617
+ "asc": true,
1618
+ "nulls": "last"
1619
+ },
1620
+ {
1621
+ "expression": "last_activity_at",
1622
+ "isExpression": false,
1623
+ "asc": true,
1624
+ "nulls": "last"
1625
+ },
1626
+ {
1627
+ "expression": "id",
1628
+ "isExpression": false,
1629
+ "asc": true,
1630
+ "nulls": "last"
1631
+ }
1632
+ ],
1633
+ "isUnique": false,
1634
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'",
1635
+ "concurrently": false,
1636
+ "method": "btree",
1637
+ "with": {}
1638
+ },
1639
+ "idx_post_site_root_thread_updated": {
1640
+ "name": "idx_post_site_root_thread_updated",
1641
+ "columns": [
1642
+ {
1643
+ "expression": "site_id",
1644
+ "isExpression": false,
1645
+ "asc": true,
1646
+ "nulls": "last"
1647
+ },
1648
+ {
1649
+ "expression": "thread_updated_at",
1650
+ "isExpression": false,
1651
+ "asc": true,
1652
+ "nulls": "last"
1653
+ },
1654
+ {
1655
+ "expression": "id",
1656
+ "isExpression": false,
1657
+ "asc": true,
1658
+ "nulls": "last"
1659
+ }
1660
+ ],
1661
+ "isUnique": false,
1662
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'",
1663
+ "concurrently": false,
1664
+ "method": "btree",
1665
+ "with": {}
1666
+ },
1667
+ "idx_post_site_root_draft_updated": {
1668
+ "name": "idx_post_site_root_draft_updated",
1669
+ "columns": [
1670
+ {
1671
+ "expression": "site_id",
1672
+ "isExpression": false,
1673
+ "asc": true,
1674
+ "nulls": "last"
1675
+ },
1676
+ {
1677
+ "expression": "updated_at",
1678
+ "isExpression": false,
1679
+ "asc": true,
1680
+ "nulls": "last"
1681
+ },
1682
+ {
1683
+ "expression": "id",
1684
+ "isExpression": false,
1685
+ "asc": true,
1686
+ "nulls": "last"
1687
+ }
1688
+ ],
1689
+ "isUnique": false,
1690
+ "where": "\"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'draft'",
1691
+ "concurrently": false,
1692
+ "method": "btree",
1693
+ "with": {}
1694
+ },
1695
+ "idx_post_site_reply_thread_created": {
1696
+ "name": "idx_post_site_reply_thread_created",
1697
+ "columns": [
1698
+ {
1699
+ "expression": "site_id",
1700
+ "isExpression": false,
1701
+ "asc": true,
1702
+ "nulls": "last"
1703
+ },
1704
+ {
1705
+ "expression": "thread_id",
1706
+ "isExpression": false,
1707
+ "asc": true,
1708
+ "nulls": "last"
1709
+ },
1710
+ {
1711
+ "expression": "created_at",
1712
+ "isExpression": false,
1713
+ "asc": true,
1714
+ "nulls": "last"
1715
+ },
1716
+ {
1717
+ "expression": "id",
1718
+ "isExpression": false,
1719
+ "asc": true,
1720
+ "nulls": "last"
1721
+ }
1722
+ ],
1723
+ "isUnique": false,
1724
+ "where": "\"post\".\"reply_to_id\" IS NOT NULL AND \"post\".\"status\" = 'published'",
1725
+ "concurrently": false,
1726
+ "method": "btree",
1727
+ "with": {}
1728
+ },
1729
+ "idx_post_site_featured_thread_published": {
1730
+ "name": "idx_post_site_featured_thread_published",
1731
+ "columns": [
1732
+ {
1733
+ "expression": "site_id",
1734
+ "isExpression": false,
1735
+ "asc": true,
1736
+ "nulls": "last"
1737
+ },
1738
+ {
1739
+ "expression": "thread_id",
1740
+ "isExpression": false,
1741
+ "asc": true,
1742
+ "nulls": "last"
1743
+ },
1744
+ {
1745
+ "expression": "published_at",
1746
+ "isExpression": false,
1747
+ "asc": true,
1748
+ "nulls": "last"
1749
+ },
1750
+ {
1751
+ "expression": "id",
1752
+ "isExpression": false,
1753
+ "asc": true,
1754
+ "nulls": "last"
1755
+ }
1756
+ ],
1757
+ "isUnique": false,
1758
+ "where": "\"post\".\"status\" = 'published' AND \"post\".\"featured_at\" IS NOT NULL",
1759
+ "concurrently": false,
1760
+ "method": "btree",
1761
+ "with": {}
1762
+ },
1763
+ "uq_post_site_translation_group_language": {
1764
+ "name": "uq_post_site_translation_group_language",
1765
+ "columns": [
1766
+ {
1767
+ "expression": "site_id",
1768
+ "isExpression": false,
1769
+ "asc": true,
1770
+ "nulls": "last"
1771
+ },
1772
+ {
1773
+ "expression": "translation_group_id",
1774
+ "isExpression": false,
1775
+ "asc": true,
1776
+ "nulls": "last"
1777
+ },
1778
+ {
1779
+ "expression": "language",
1780
+ "isExpression": false,
1781
+ "asc": true,
1782
+ "nulls": "last"
1783
+ }
1784
+ ],
1785
+ "isUnique": true,
1786
+ "where": "\"post\".\"translation_group_id\" IS NOT NULL",
1787
+ "concurrently": false,
1788
+ "method": "btree",
1789
+ "with": {}
1790
+ },
1791
+ "idx_post_search_document": {
1792
+ "name": "idx_post_search_document",
1793
+ "columns": [
1794
+ {
1795
+ "expression": "search_document",
1796
+ "isExpression": false,
1797
+ "asc": true,
1798
+ "nulls": "last"
1799
+ }
1800
+ ],
1801
+ "isUnique": false,
1802
+ "concurrently": false,
1803
+ "method": "gin",
1804
+ "with": {}
1805
+ },
1806
+ "idx_post_search_text_trgm": {
1807
+ "name": "idx_post_search_text_trgm",
1808
+ "columns": [
1809
+ {
1810
+ "expression": "search_text",
1811
+ "isExpression": false,
1812
+ "asc": true,
1813
+ "nulls": "last",
1814
+ "opclass": "gin_trgm_ops"
1815
+ }
1816
+ ],
1817
+ "isUnique": false,
1818
+ "concurrently": false,
1819
+ "method": "gin",
1820
+ "with": {}
1821
+ }
1822
+ },
1823
+ "foreignKeys": {
1824
+ "post_site_id_site_id_fk": {
1825
+ "name": "post_site_id_site_id_fk",
1826
+ "tableFrom": "post",
1827
+ "tableTo": "site",
1828
+ "columnsFrom": ["site_id"],
1829
+ "columnsTo": ["id"],
1830
+ "onDelete": "cascade",
1831
+ "onUpdate": "no action"
1832
+ },
1833
+ "post_site_id_reply_to_id_post_site_id_id_fk": {
1834
+ "name": "post_site_id_reply_to_id_post_site_id_id_fk",
1835
+ "tableFrom": "post",
1836
+ "tableTo": "post",
1837
+ "columnsFrom": ["site_id", "reply_to_id"],
1838
+ "columnsTo": ["site_id", "id"],
1839
+ "onDelete": "no action",
1840
+ "onUpdate": "no action"
1841
+ },
1842
+ "post_site_id_thread_id_post_site_id_id_fk": {
1843
+ "name": "post_site_id_thread_id_post_site_id_id_fk",
1844
+ "tableFrom": "post",
1845
+ "tableTo": "post",
1846
+ "columnsFrom": ["site_id", "thread_id"],
1847
+ "columnsTo": ["site_id", "id"],
1848
+ "onDelete": "no action",
1849
+ "onUpdate": "no action"
1850
+ }
1851
+ },
1852
+ "compositePrimaryKeys": {},
1853
+ "uniqueConstraints": {
1854
+ "uq_post_site_id_id": {
1855
+ "name": "uq_post_site_id_id",
1856
+ "nullsNotDistinct": false,
1857
+ "columns": ["site_id", "id"]
1858
+ }
1859
+ },
1860
+ "policies": {},
1861
+ "checkConstraints": {
1862
+ "chk_post_reply_to_not_self": {
1863
+ "name": "chk_post_reply_to_not_self",
1864
+ "value": "\"post\".\"reply_to_id\" IS NULL OR \"post\".\"reply_to_id\" <> \"post\".\"id\""
1865
+ },
1866
+ "chk_post_thread_shape": {
1867
+ "name": "chk_post_thread_shape",
1868
+ "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 )"
1869
+ }
1870
+ },
1871
+ "isRLSEnabled": false
1872
+ },
1873
+ "public.rate_limit": {
1874
+ "name": "rate_limit",
1875
+ "schema": "",
1876
+ "columns": {
1877
+ "key": {
1878
+ "name": "key",
1879
+ "type": "text",
1880
+ "primaryKey": false,
1881
+ "notNull": true
1882
+ },
1883
+ "window_start": {
1884
+ "name": "window_start",
1885
+ "type": "integer",
1886
+ "primaryKey": false,
1887
+ "notNull": true
1888
+ },
1889
+ "count": {
1890
+ "name": "count",
1891
+ "type": "integer",
1892
+ "primaryKey": false,
1893
+ "notNull": true,
1894
+ "default": 0
1895
+ }
1896
+ },
1897
+ "indexes": {},
1898
+ "foreignKeys": {},
1899
+ "compositePrimaryKeys": {
1900
+ "rate_limit_key_window_start_pk": {
1901
+ "name": "rate_limit_key_window_start_pk",
1902
+ "columns": ["key", "window_start"]
1903
+ }
1904
+ },
1905
+ "uniqueConstraints": {},
1906
+ "policies": {},
1907
+ "checkConstraints": {},
1908
+ "isRLSEnabled": false
1909
+ },
1910
+ "public.session": {
1911
+ "name": "session",
1912
+ "schema": "",
1913
+ "columns": {
1914
+ "id": {
1915
+ "name": "id",
1916
+ "type": "text",
1917
+ "primaryKey": true,
1918
+ "notNull": true
1919
+ },
1920
+ "expires_at": {
1921
+ "name": "expires_at",
1922
+ "type": "timestamp with time zone",
1923
+ "primaryKey": false,
1924
+ "notNull": true
1925
+ },
1926
+ "token": {
1927
+ "name": "token",
1928
+ "type": "text",
1929
+ "primaryKey": false,
1930
+ "notNull": true
1931
+ },
1932
+ "created_at": {
1933
+ "name": "created_at",
1934
+ "type": "timestamp with time zone",
1935
+ "primaryKey": false,
1936
+ "notNull": true
1937
+ },
1938
+ "updated_at": {
1939
+ "name": "updated_at",
1940
+ "type": "timestamp with time zone",
1941
+ "primaryKey": false,
1942
+ "notNull": true
1943
+ },
1944
+ "ip_address": {
1945
+ "name": "ip_address",
1946
+ "type": "text",
1947
+ "primaryKey": false,
1948
+ "notNull": false
1949
+ },
1950
+ "user_agent": {
1951
+ "name": "user_agent",
1952
+ "type": "text",
1953
+ "primaryKey": false,
1954
+ "notNull": false
1955
+ },
1956
+ "user_id": {
1957
+ "name": "user_id",
1958
+ "type": "text",
1959
+ "primaryKey": false,
1960
+ "notNull": true
1961
+ }
1962
+ },
1963
+ "indexes": {
1964
+ "idx_session_user_id": {
1965
+ "name": "idx_session_user_id",
1966
+ "columns": [
1967
+ {
1968
+ "expression": "user_id",
1969
+ "isExpression": false,
1970
+ "asc": true,
1971
+ "nulls": "last"
1972
+ }
1973
+ ],
1974
+ "isUnique": false,
1975
+ "concurrently": false,
1976
+ "method": "btree",
1977
+ "with": {}
1978
+ }
1979
+ },
1980
+ "foreignKeys": {
1981
+ "session_user_id_user_id_fk": {
1982
+ "name": "session_user_id_user_id_fk",
1983
+ "tableFrom": "session",
1984
+ "tableTo": "user",
1985
+ "columnsFrom": ["user_id"],
1986
+ "columnsTo": ["id"],
1987
+ "onDelete": "no action",
1988
+ "onUpdate": "no action"
1989
+ }
1990
+ },
1991
+ "compositePrimaryKeys": {},
1992
+ "uniqueConstraints": {
1993
+ "session_token_unique": {
1994
+ "name": "session_token_unique",
1995
+ "nullsNotDistinct": false,
1996
+ "columns": ["token"]
1997
+ }
1998
+ },
1999
+ "policies": {},
2000
+ "checkConstraints": {},
2001
+ "isRLSEnabled": false
2002
+ },
2003
+ "public.site_setting": {
2004
+ "name": "site_setting",
2005
+ "schema": "",
2006
+ "columns": {
2007
+ "site_id": {
2008
+ "name": "site_id",
2009
+ "type": "text",
2010
+ "primaryKey": false,
2011
+ "notNull": true
2012
+ },
2013
+ "key": {
2014
+ "name": "key",
2015
+ "type": "text",
2016
+ "primaryKey": false,
2017
+ "notNull": true
2018
+ },
2019
+ "value": {
2020
+ "name": "value",
2021
+ "type": "text",
2022
+ "primaryKey": false,
2023
+ "notNull": true
2024
+ },
2025
+ "updated_at": {
2026
+ "name": "updated_at",
2027
+ "type": "integer",
2028
+ "primaryKey": false,
2029
+ "notNull": true
2030
+ }
2031
+ },
2032
+ "indexes": {
2033
+ "idx_site_setting_site_id": {
2034
+ "name": "idx_site_setting_site_id",
2035
+ "columns": [
2036
+ {
2037
+ "expression": "site_id",
2038
+ "isExpression": false,
2039
+ "asc": true,
2040
+ "nulls": "last"
2041
+ }
2042
+ ],
2043
+ "isUnique": false,
2044
+ "concurrently": false,
2045
+ "method": "btree",
2046
+ "with": {}
2047
+ }
2048
+ },
2049
+ "foreignKeys": {
2050
+ "site_setting_site_id_site_id_fk": {
2051
+ "name": "site_setting_site_id_site_id_fk",
2052
+ "tableFrom": "site_setting",
2053
+ "tableTo": "site",
2054
+ "columnsFrom": ["site_id"],
2055
+ "columnsTo": ["id"],
2056
+ "onDelete": "cascade",
2057
+ "onUpdate": "no action"
2058
+ }
2059
+ },
2060
+ "compositePrimaryKeys": {
2061
+ "site_setting_site_id_key_pk": {
2062
+ "name": "site_setting_site_id_key_pk",
2063
+ "columns": ["site_id", "key"]
2064
+ }
2065
+ },
2066
+ "uniqueConstraints": {},
2067
+ "policies": {},
2068
+ "checkConstraints": {},
2069
+ "isRLSEnabled": false
2070
+ },
2071
+ "public.site_domain": {
2072
+ "name": "site_domain",
2073
+ "schema": "",
2074
+ "columns": {
2075
+ "id": {
2076
+ "name": "id",
2077
+ "type": "text",
2078
+ "primaryKey": true,
2079
+ "notNull": true
2080
+ },
2081
+ "site_id": {
2082
+ "name": "site_id",
2083
+ "type": "text",
2084
+ "primaryKey": false,
2085
+ "notNull": true
2086
+ },
2087
+ "host": {
2088
+ "name": "host",
2089
+ "type": "text",
2090
+ "primaryKey": false,
2091
+ "notNull": true
2092
+ },
2093
+ "path_prefix": {
2094
+ "name": "path_prefix",
2095
+ "type": "text",
2096
+ "primaryKey": false,
2097
+ "notNull": false
2098
+ },
2099
+ "kind": {
2100
+ "name": "kind",
2101
+ "type": "text",
2102
+ "primaryKey": false,
2103
+ "notNull": true,
2104
+ "default": "'primary'"
2105
+ },
2106
+ "redirect_to_primary": {
2107
+ "name": "redirect_to_primary",
2108
+ "type": "boolean",
2109
+ "primaryKey": false,
2110
+ "notNull": true,
2111
+ "default": true
2112
+ },
2113
+ "created_at": {
2114
+ "name": "created_at",
2115
+ "type": "integer",
2116
+ "primaryKey": false,
2117
+ "notNull": true
2118
+ },
2119
+ "updated_at": {
2120
+ "name": "updated_at",
2121
+ "type": "integer",
2122
+ "primaryKey": false,
2123
+ "notNull": true
2124
+ }
2125
+ },
2126
+ "indexes": {
2127
+ "uq_site_domain_host": {
2128
+ "name": "uq_site_domain_host",
2129
+ "columns": [
2130
+ {
2131
+ "expression": "host",
2132
+ "isExpression": false,
2133
+ "asc": true,
2134
+ "nulls": "last"
2135
+ }
2136
+ ],
2137
+ "isUnique": true,
2138
+ "concurrently": false,
2139
+ "method": "btree",
2140
+ "with": {}
2141
+ },
2142
+ "idx_site_domain_site_id": {
2143
+ "name": "idx_site_domain_site_id",
2144
+ "columns": [
2145
+ {
2146
+ "expression": "site_id",
2147
+ "isExpression": false,
2148
+ "asc": true,
2149
+ "nulls": "last"
2150
+ }
2151
+ ],
2152
+ "isUnique": false,
2153
+ "concurrently": false,
2154
+ "method": "btree",
2155
+ "with": {}
2156
+ }
2157
+ },
2158
+ "foreignKeys": {
2159
+ "site_domain_site_id_site_id_fk": {
2160
+ "name": "site_domain_site_id_site_id_fk",
2161
+ "tableFrom": "site_domain",
2162
+ "tableTo": "site",
2163
+ "columnsFrom": ["site_id"],
2164
+ "columnsTo": ["id"],
2165
+ "onDelete": "cascade",
2166
+ "onUpdate": "no action"
2167
+ }
2168
+ },
2169
+ "compositePrimaryKeys": {},
2170
+ "uniqueConstraints": {},
2171
+ "policies": {},
2172
+ "checkConstraints": {
2173
+ "chk_site_domain_kind": {
2174
+ "name": "chk_site_domain_kind",
2175
+ "value": "\"site_domain\".\"kind\" IN ('primary', 'alias')"
2176
+ }
2177
+ },
2178
+ "isRLSEnabled": false
2179
+ },
2180
+ "public.site_member": {
2181
+ "name": "site_member",
2182
+ "schema": "",
2183
+ "columns": {
2184
+ "site_id": {
2185
+ "name": "site_id",
2186
+ "type": "text",
2187
+ "primaryKey": false,
2188
+ "notNull": true
2189
+ },
2190
+ "user_id": {
2191
+ "name": "user_id",
2192
+ "type": "text",
2193
+ "primaryKey": false,
2194
+ "notNull": true
2195
+ },
2196
+ "role": {
2197
+ "name": "role",
2198
+ "type": "text",
2199
+ "primaryKey": false,
2200
+ "notNull": true,
2201
+ "default": "'editor'"
2202
+ },
2203
+ "created_at": {
2204
+ "name": "created_at",
2205
+ "type": "integer",
2206
+ "primaryKey": false,
2207
+ "notNull": true
2208
+ },
2209
+ "updated_at": {
2210
+ "name": "updated_at",
2211
+ "type": "integer",
2212
+ "primaryKey": false,
2213
+ "notNull": true
2214
+ }
2215
+ },
2216
+ "indexes": {
2217
+ "idx_site_member_user_id": {
2218
+ "name": "idx_site_member_user_id",
2219
+ "columns": [
2220
+ {
2221
+ "expression": "user_id",
2222
+ "isExpression": false,
2223
+ "asc": true,
2224
+ "nulls": "last"
2225
+ }
2226
+ ],
2227
+ "isUnique": false,
2228
+ "concurrently": false,
2229
+ "method": "btree",
2230
+ "with": {}
2231
+ }
2232
+ },
2233
+ "foreignKeys": {
2234
+ "site_member_site_id_site_id_fk": {
2235
+ "name": "site_member_site_id_site_id_fk",
2236
+ "tableFrom": "site_member",
2237
+ "tableTo": "site",
2238
+ "columnsFrom": ["site_id"],
2239
+ "columnsTo": ["id"],
2240
+ "onDelete": "cascade",
2241
+ "onUpdate": "no action"
2242
+ }
2243
+ },
2244
+ "compositePrimaryKeys": {
2245
+ "site_member_site_id_user_id_pk": {
2246
+ "name": "site_member_site_id_user_id_pk",
2247
+ "columns": ["site_id", "user_id"]
2248
+ }
2249
+ },
2250
+ "uniqueConstraints": {},
2251
+ "policies": {},
2252
+ "checkConstraints": {
2253
+ "chk_site_member_role": {
2254
+ "name": "chk_site_member_role",
2255
+ "value": "\"site_member\".\"role\" IN ('owner', 'admin', 'editor')"
2256
+ }
2257
+ },
2258
+ "isRLSEnabled": false
2259
+ },
2260
+ "public.site": {
2261
+ "name": "site",
2262
+ "schema": "",
2263
+ "columns": {
2264
+ "id": {
2265
+ "name": "id",
2266
+ "type": "text",
2267
+ "primaryKey": true,
2268
+ "notNull": true
2269
+ },
2270
+ "key": {
2271
+ "name": "key",
2272
+ "type": "text",
2273
+ "primaryKey": false,
2274
+ "notNull": true
2275
+ },
2276
+ "status": {
2277
+ "name": "status",
2278
+ "type": "text",
2279
+ "primaryKey": false,
2280
+ "notNull": true,
2281
+ "default": "'active'"
2282
+ },
2283
+ "provisioning_idempotency_key": {
2284
+ "name": "provisioning_idempotency_key",
2285
+ "type": "text",
2286
+ "primaryKey": false,
2287
+ "notNull": false
2288
+ },
2289
+ "created_at": {
2290
+ "name": "created_at",
2291
+ "type": "integer",
2292
+ "primaryKey": false,
2293
+ "notNull": true
2294
+ },
2295
+ "updated_at": {
2296
+ "name": "updated_at",
2297
+ "type": "integer",
2298
+ "primaryKey": false,
2299
+ "notNull": true
2300
+ }
2301
+ },
2302
+ "indexes": {
2303
+ "uq_site_key": {
2304
+ "name": "uq_site_key",
2305
+ "columns": [
2306
+ {
2307
+ "expression": "key",
2308
+ "isExpression": false,
2309
+ "asc": true,
2310
+ "nulls": "last"
2311
+ }
2312
+ ],
2313
+ "isUnique": true,
2314
+ "concurrently": false,
2315
+ "method": "btree",
2316
+ "with": {}
2317
+ },
2318
+ "uq_site_provisioning_idempotency_key": {
2319
+ "name": "uq_site_provisioning_idempotency_key",
2320
+ "columns": [
2321
+ {
2322
+ "expression": "provisioning_idempotency_key",
2323
+ "isExpression": false,
2324
+ "asc": true,
2325
+ "nulls": "last"
2326
+ }
2327
+ ],
2328
+ "isUnique": true,
2329
+ "where": "\"site\".\"provisioning_idempotency_key\" IS NOT NULL",
2330
+ "concurrently": false,
2331
+ "method": "btree",
2332
+ "with": {}
2333
+ }
2334
+ },
2335
+ "foreignKeys": {},
2336
+ "compositePrimaryKeys": {},
2337
+ "uniqueConstraints": {},
2338
+ "policies": {},
2339
+ "checkConstraints": {
2340
+ "chk_site_status": {
2341
+ "name": "chk_site_status",
2342
+ "value": "\"site\".\"status\" IN ('active', 'suspended')"
2343
+ }
2344
+ },
2345
+ "isRLSEnabled": false
2346
+ },
2347
+ "public.storage_purge": {
2348
+ "name": "storage_purge",
2349
+ "schema": "",
2350
+ "columns": {
2351
+ "id": {
2352
+ "name": "id",
2353
+ "type": "text",
2354
+ "primaryKey": true,
2355
+ "notNull": true
2356
+ },
2357
+ "site_id": {
2358
+ "name": "site_id",
2359
+ "type": "text",
2360
+ "primaryKey": false,
2361
+ "notNull": true
2362
+ },
2363
+ "provider": {
2364
+ "name": "provider",
2365
+ "type": "text",
2366
+ "primaryKey": false,
2367
+ "notNull": true
2368
+ },
2369
+ "storage_key": {
2370
+ "name": "storage_key",
2371
+ "type": "text",
2372
+ "primaryKey": false,
2373
+ "notNull": true
2374
+ },
2375
+ "original_key": {
2376
+ "name": "original_key",
2377
+ "type": "text",
2378
+ "primaryKey": false,
2379
+ "notNull": true
2380
+ },
2381
+ "reason": {
2382
+ "name": "reason",
2383
+ "type": "text",
2384
+ "primaryKey": false,
2385
+ "notNull": false
2386
+ },
2387
+ "purge_after": {
2388
+ "name": "purge_after",
2389
+ "type": "integer",
2390
+ "primaryKey": false,
2391
+ "notNull": true
2392
+ },
2393
+ "created_at": {
2394
+ "name": "created_at",
2395
+ "type": "integer",
2396
+ "primaryKey": false,
2397
+ "notNull": true
2398
+ }
2399
+ },
2400
+ "indexes": {
2401
+ "uq_storage_purge_provider_key": {
2402
+ "name": "uq_storage_purge_provider_key",
2403
+ "columns": [
2404
+ {
2405
+ "expression": "provider",
2406
+ "isExpression": false,
2407
+ "asc": true,
2408
+ "nulls": "last"
2409
+ },
2410
+ {
2411
+ "expression": "storage_key",
2412
+ "isExpression": false,
2413
+ "asc": true,
2414
+ "nulls": "last"
2415
+ }
2416
+ ],
2417
+ "isUnique": true,
2418
+ "concurrently": false,
2419
+ "method": "btree",
2420
+ "with": {}
2421
+ },
2422
+ "idx_storage_purge_site_provider_due": {
2423
+ "name": "idx_storage_purge_site_provider_due",
2424
+ "columns": [
2425
+ {
2426
+ "expression": "site_id",
2427
+ "isExpression": false,
2428
+ "asc": true,
2429
+ "nulls": "last"
2430
+ },
2431
+ {
2432
+ "expression": "provider",
2433
+ "isExpression": false,
2434
+ "asc": true,
2435
+ "nulls": "last"
2436
+ },
2437
+ {
2438
+ "expression": "purge_after",
2439
+ "isExpression": false,
2440
+ "asc": true,
2441
+ "nulls": "last"
2442
+ }
2443
+ ],
2444
+ "isUnique": false,
2445
+ "concurrently": false,
2446
+ "method": "btree",
2447
+ "with": {}
2448
+ }
2449
+ },
2450
+ "foreignKeys": {
2451
+ "storage_purge_site_id_site_id_fk": {
2452
+ "name": "storage_purge_site_id_site_id_fk",
2453
+ "tableFrom": "storage_purge",
2454
+ "tableTo": "site",
2455
+ "columnsFrom": ["site_id"],
2456
+ "columnsTo": ["id"],
2457
+ "onDelete": "cascade",
2458
+ "onUpdate": "no action"
2459
+ }
2460
+ },
2461
+ "compositePrimaryKeys": {},
2462
+ "uniqueConstraints": {},
2463
+ "policies": {},
2464
+ "checkConstraints": {},
2465
+ "isRLSEnabled": false
2466
+ },
2467
+ "public.telegram_binding": {
2468
+ "name": "telegram_binding",
2469
+ "schema": "",
2470
+ "columns": {
2471
+ "id": {
2472
+ "name": "id",
2473
+ "type": "text",
2474
+ "primaryKey": true,
2475
+ "notNull": true
2476
+ },
2477
+ "site_id": {
2478
+ "name": "site_id",
2479
+ "type": "text",
2480
+ "primaryKey": false,
2481
+ "notNull": true
2482
+ },
2483
+ "bot_id": {
2484
+ "name": "bot_id",
2485
+ "type": "text",
2486
+ "primaryKey": false,
2487
+ "notNull": true
2488
+ },
2489
+ "telegram_user_id": {
2490
+ "name": "telegram_user_id",
2491
+ "type": "text",
2492
+ "primaryKey": false,
2493
+ "notNull": true
2494
+ },
2495
+ "telegram_username": {
2496
+ "name": "telegram_username",
2497
+ "type": "text",
2498
+ "primaryKey": false,
2499
+ "notNull": false
2500
+ },
2501
+ "last_update_id": {
2502
+ "name": "last_update_id",
2503
+ "type": "integer",
2504
+ "primaryKey": false,
2505
+ "notNull": false
2506
+ },
2507
+ "bound_at": {
2508
+ "name": "bound_at",
2509
+ "type": "integer",
2510
+ "primaryKey": false,
2511
+ "notNull": true
2512
+ }
2513
+ },
2514
+ "indexes": {
2515
+ "uq_telegram_binding_site_id": {
2516
+ "name": "uq_telegram_binding_site_id",
2517
+ "columns": [
2518
+ {
2519
+ "expression": "site_id",
2520
+ "isExpression": false,
2521
+ "asc": true,
2522
+ "nulls": "last"
2523
+ }
2524
+ ],
2525
+ "isUnique": true,
2526
+ "concurrently": false,
2527
+ "method": "btree",
2528
+ "with": {}
2529
+ },
2530
+ "uq_telegram_binding_bot_user": {
2531
+ "name": "uq_telegram_binding_bot_user",
2532
+ "columns": [
2533
+ {
2534
+ "expression": "bot_id",
2535
+ "isExpression": false,
2536
+ "asc": true,
2537
+ "nulls": "last"
2538
+ },
2539
+ {
2540
+ "expression": "telegram_user_id",
2541
+ "isExpression": false,
2542
+ "asc": true,
2543
+ "nulls": "last"
2544
+ }
2545
+ ],
2546
+ "isUnique": true,
2547
+ "concurrently": false,
2548
+ "method": "btree",
2549
+ "with": {}
2550
+ }
2551
+ },
2552
+ "foreignKeys": {
2553
+ "telegram_binding_site_id_site_id_fk": {
2554
+ "name": "telegram_binding_site_id_site_id_fk",
2555
+ "tableFrom": "telegram_binding",
2556
+ "tableTo": "site",
2557
+ "columnsFrom": ["site_id"],
2558
+ "columnsTo": ["id"],
2559
+ "onDelete": "cascade",
2560
+ "onUpdate": "no action"
2561
+ }
2562
+ },
2563
+ "compositePrimaryKeys": {},
2564
+ "uniqueConstraints": {},
2565
+ "policies": {},
2566
+ "checkConstraints": {},
2567
+ "isRLSEnabled": false
2568
+ },
2569
+ "public.telegram_media_group_item": {
2570
+ "name": "telegram_media_group_item",
2571
+ "schema": "",
2572
+ "columns": {
2573
+ "id": {
2574
+ "name": "id",
2575
+ "type": "text",
2576
+ "primaryKey": true,
2577
+ "notNull": true
2578
+ },
2579
+ "site_id": {
2580
+ "name": "site_id",
2581
+ "type": "text",
2582
+ "primaryKey": false,
2583
+ "notNull": true
2584
+ },
2585
+ "bot_id": {
2586
+ "name": "bot_id",
2587
+ "type": "text",
2588
+ "primaryKey": false,
2589
+ "notNull": true
2590
+ },
2591
+ "telegram_user_id": {
2592
+ "name": "telegram_user_id",
2593
+ "type": "text",
2594
+ "primaryKey": false,
2595
+ "notNull": true
2596
+ },
2597
+ "media_group_id": {
2598
+ "name": "media_group_id",
2599
+ "type": "text",
2600
+ "primaryKey": false,
2601
+ "notNull": true
2602
+ },
2603
+ "chat_id": {
2604
+ "name": "chat_id",
2605
+ "type": "integer",
2606
+ "primaryKey": false,
2607
+ "notNull": true
2608
+ },
2609
+ "message_id": {
2610
+ "name": "message_id",
2611
+ "type": "integer",
2612
+ "primaryKey": false,
2613
+ "notNull": true
2614
+ },
2615
+ "update_id": {
2616
+ "name": "update_id",
2617
+ "type": "integer",
2618
+ "primaryKey": false,
2619
+ "notNull": true
2620
+ },
2621
+ "file_id": {
2622
+ "name": "file_id",
2623
+ "type": "text",
2624
+ "primaryKey": false,
2625
+ "notNull": true
2626
+ },
2627
+ "media_kind": {
2628
+ "name": "media_kind",
2629
+ "type": "text",
2630
+ "primaryKey": false,
2631
+ "notNull": true
2632
+ },
2633
+ "mime_type": {
2634
+ "name": "mime_type",
2635
+ "type": "text",
2636
+ "primaryKey": false,
2637
+ "notNull": false
2638
+ },
2639
+ "original_name": {
2640
+ "name": "original_name",
2641
+ "type": "text",
2642
+ "primaryKey": false,
2643
+ "notNull": false
2644
+ },
2645
+ "caption_markdown": {
2646
+ "name": "caption_markdown",
2647
+ "type": "text",
2648
+ "primaryKey": false,
2649
+ "notNull": false
2650
+ },
2651
+ "width": {
2652
+ "name": "width",
2653
+ "type": "integer",
2654
+ "primaryKey": false,
2655
+ "notNull": false
2656
+ },
2657
+ "height": {
2658
+ "name": "height",
2659
+ "type": "integer",
2660
+ "primaryKey": false,
2661
+ "notNull": false
2662
+ },
2663
+ "duration_seconds": {
2664
+ "name": "duration_seconds",
2665
+ "type": "integer",
2666
+ "primaryKey": false,
2667
+ "notNull": false
2668
+ },
2669
+ "poster_file_id": {
2670
+ "name": "poster_file_id",
2671
+ "type": "text",
2672
+ "primaryKey": false,
2673
+ "notNull": false
2674
+ },
2675
+ "created_at": {
2676
+ "name": "created_at",
2677
+ "type": "integer",
2678
+ "primaryKey": false,
2679
+ "notNull": true
2680
+ }
2681
+ },
2682
+ "indexes": {
2683
+ "idx_telegram_media_group_item_group": {
2684
+ "name": "idx_telegram_media_group_item_group",
2685
+ "columns": [
2686
+ {
2687
+ "expression": "bot_id",
2688
+ "isExpression": false,
2689
+ "asc": true,
2690
+ "nulls": "last"
2691
+ },
2692
+ {
2693
+ "expression": "media_group_id",
2694
+ "isExpression": false,
2695
+ "asc": true,
2696
+ "nulls": "last"
2697
+ }
2698
+ ],
2699
+ "isUnique": false,
2700
+ "concurrently": false,
2701
+ "method": "btree",
2702
+ "with": {}
2703
+ },
2704
+ "uq_telegram_media_group_item_message": {
2705
+ "name": "uq_telegram_media_group_item_message",
2706
+ "columns": [
2707
+ {
2708
+ "expression": "bot_id",
2709
+ "isExpression": false,
2710
+ "asc": true,
2711
+ "nulls": "last"
2712
+ },
2713
+ {
2714
+ "expression": "media_group_id",
2715
+ "isExpression": false,
2716
+ "asc": true,
2717
+ "nulls": "last"
2718
+ },
2719
+ {
2720
+ "expression": "message_id",
2721
+ "isExpression": false,
2722
+ "asc": true,
2723
+ "nulls": "last"
2724
+ }
2725
+ ],
2726
+ "isUnique": true,
2727
+ "concurrently": false,
2728
+ "method": "btree",
2729
+ "with": {}
2730
+ }
2731
+ },
2732
+ "foreignKeys": {
2733
+ "telegram_media_group_item_site_id_site_id_fk": {
2734
+ "name": "telegram_media_group_item_site_id_site_id_fk",
2735
+ "tableFrom": "telegram_media_group_item",
2736
+ "tableTo": "site",
2737
+ "columnsFrom": ["site_id"],
2738
+ "columnsTo": ["id"],
2739
+ "onDelete": "cascade",
2740
+ "onUpdate": "no action"
2741
+ }
2742
+ },
2743
+ "compositePrimaryKeys": {},
2744
+ "uniqueConstraints": {},
2745
+ "policies": {},
2746
+ "checkConstraints": {},
2747
+ "isRLSEnabled": false
2748
+ },
2749
+ "public.telegram_pending_binding": {
2750
+ "name": "telegram_pending_binding",
2751
+ "schema": "",
2752
+ "columns": {
2753
+ "id": {
2754
+ "name": "id",
2755
+ "type": "text",
2756
+ "primaryKey": true,
2757
+ "notNull": true
2758
+ },
2759
+ "site_id": {
2760
+ "name": "site_id",
2761
+ "type": "text",
2762
+ "primaryKey": false,
2763
+ "notNull": true
2764
+ },
2765
+ "code": {
2766
+ "name": "code",
2767
+ "type": "text",
2768
+ "primaryKey": false,
2769
+ "notNull": true
2770
+ },
2771
+ "created_at": {
2772
+ "name": "created_at",
2773
+ "type": "integer",
2774
+ "primaryKey": false,
2775
+ "notNull": true
2776
+ },
2777
+ "expires_at": {
2778
+ "name": "expires_at",
2779
+ "type": "integer",
2780
+ "primaryKey": false,
2781
+ "notNull": true
2782
+ }
2783
+ },
2784
+ "indexes": {
2785
+ "uq_telegram_pending_binding_site_id": {
2786
+ "name": "uq_telegram_pending_binding_site_id",
2787
+ "columns": [
2788
+ {
2789
+ "expression": "site_id",
2790
+ "isExpression": false,
2791
+ "asc": true,
2792
+ "nulls": "last"
2793
+ }
2794
+ ],
2795
+ "isUnique": true,
2796
+ "concurrently": false,
2797
+ "method": "btree",
2798
+ "with": {}
2799
+ },
2800
+ "uq_telegram_pending_binding_code": {
2801
+ "name": "uq_telegram_pending_binding_code",
2802
+ "columns": [
2803
+ {
2804
+ "expression": "code",
2805
+ "isExpression": false,
2806
+ "asc": true,
2807
+ "nulls": "last"
2808
+ }
2809
+ ],
2810
+ "isUnique": true,
2811
+ "concurrently": false,
2812
+ "method": "btree",
2813
+ "with": {}
2814
+ }
2815
+ },
2816
+ "foreignKeys": {
2817
+ "telegram_pending_binding_site_id_site_id_fk": {
2818
+ "name": "telegram_pending_binding_site_id_site_id_fk",
2819
+ "tableFrom": "telegram_pending_binding",
2820
+ "tableTo": "site",
2821
+ "columnsFrom": ["site_id"],
2822
+ "columnsTo": ["id"],
2823
+ "onDelete": "cascade",
2824
+ "onUpdate": "no action"
2825
+ }
2826
+ },
2827
+ "compositePrimaryKeys": {},
2828
+ "uniqueConstraints": {},
2829
+ "policies": {},
2830
+ "checkConstraints": {},
2831
+ "isRLSEnabled": false
2832
+ },
2833
+ "public.thread_collection": {
2834
+ "name": "thread_collection",
2835
+ "schema": "",
2836
+ "columns": {
2837
+ "site_id": {
2838
+ "name": "site_id",
2839
+ "type": "text",
2840
+ "primaryKey": false,
2841
+ "notNull": true
2842
+ },
2843
+ "thread_id": {
2844
+ "name": "thread_id",
2845
+ "type": "text",
2846
+ "primaryKey": false,
2847
+ "notNull": true
2848
+ },
2849
+ "collection_id": {
2850
+ "name": "collection_id",
2851
+ "type": "text",
2852
+ "primaryKey": false,
2853
+ "notNull": true
2854
+ },
2855
+ "created_at": {
2856
+ "name": "created_at",
2857
+ "type": "integer",
2858
+ "primaryKey": false,
2859
+ "notNull": true
2860
+ },
2861
+ "position": {
2862
+ "name": "position",
2863
+ "type": "integer",
2864
+ "primaryKey": false,
2865
+ "notNull": true,
2866
+ "default": 0
2867
+ },
2868
+ "pinned_at": {
2869
+ "name": "pinned_at",
2870
+ "type": "integer",
2871
+ "primaryKey": false,
2872
+ "notNull": false
2873
+ }
2874
+ },
2875
+ "indexes": {
2876
+ "idx_thread_collection_site_collection_id": {
2877
+ "name": "idx_thread_collection_site_collection_id",
2878
+ "columns": [
2879
+ {
2880
+ "expression": "site_id",
2881
+ "isExpression": false,
2882
+ "asc": true,
2883
+ "nulls": "last"
2884
+ },
2885
+ {
2886
+ "expression": "collection_id",
2887
+ "isExpression": false,
2888
+ "asc": true,
2889
+ "nulls": "last"
2890
+ }
2891
+ ],
2892
+ "isUnique": false,
2893
+ "concurrently": false,
2894
+ "method": "btree",
2895
+ "with": {}
2896
+ },
2897
+ "idx_thread_collection_site_collection_created_thread": {
2898
+ "name": "idx_thread_collection_site_collection_created_thread",
2899
+ "columns": [
2900
+ {
2901
+ "expression": "site_id",
2902
+ "isExpression": false,
2903
+ "asc": true,
2904
+ "nulls": "last"
2905
+ },
2906
+ {
2907
+ "expression": "collection_id",
2908
+ "isExpression": false,
2909
+ "asc": true,
2910
+ "nulls": "last"
2911
+ },
2912
+ {
2913
+ "expression": "created_at",
2914
+ "isExpression": false,
2915
+ "asc": true,
2916
+ "nulls": "last"
2917
+ },
2918
+ {
2919
+ "expression": "thread_id",
2920
+ "isExpression": false,
2921
+ "asc": true,
2922
+ "nulls": "last"
2923
+ }
2924
+ ],
2925
+ "isUnique": false,
2926
+ "concurrently": false,
2927
+ "method": "btree",
2928
+ "with": {}
2929
+ }
2930
+ },
2931
+ "foreignKeys": {
2932
+ "thread_collection_site_id_site_id_fk": {
2933
+ "name": "thread_collection_site_id_site_id_fk",
2934
+ "tableFrom": "thread_collection",
2935
+ "tableTo": "site",
2936
+ "columnsFrom": ["site_id"],
2937
+ "columnsTo": ["id"],
2938
+ "onDelete": "cascade",
2939
+ "onUpdate": "no action"
2940
+ },
2941
+ "thread_collection_thread_id_post_id_fk": {
2942
+ "name": "thread_collection_thread_id_post_id_fk",
2943
+ "tableFrom": "thread_collection",
2944
+ "tableTo": "post",
2945
+ "columnsFrom": ["thread_id"],
2946
+ "columnsTo": ["id"],
2947
+ "onDelete": "cascade",
2948
+ "onUpdate": "no action"
2949
+ },
2950
+ "thread_collection_collection_id_collection_id_fk": {
2951
+ "name": "thread_collection_collection_id_collection_id_fk",
2952
+ "tableFrom": "thread_collection",
2953
+ "tableTo": "collection",
2954
+ "columnsFrom": ["collection_id"],
2955
+ "columnsTo": ["id"],
2956
+ "onDelete": "cascade",
2957
+ "onUpdate": "no action"
2958
+ }
2959
+ },
2960
+ "compositePrimaryKeys": {
2961
+ "thread_collection_site_id_thread_id_collection_id_pk": {
2962
+ "name": "thread_collection_site_id_thread_id_collection_id_pk",
2963
+ "columns": ["site_id", "thread_id", "collection_id"]
2964
+ }
2965
+ },
2966
+ "uniqueConstraints": {},
2967
+ "policies": {},
2968
+ "checkConstraints": {},
2969
+ "isRLSEnabled": false
2970
+ },
2971
+ "public.upload_session": {
2972
+ "name": "upload_session",
2973
+ "schema": "",
2974
+ "columns": {
2975
+ "id": {
2976
+ "name": "id",
2977
+ "type": "text",
2978
+ "primaryKey": true,
2979
+ "notNull": true
2980
+ },
2981
+ "site_id": {
2982
+ "name": "site_id",
2983
+ "type": "text",
2984
+ "primaryKey": false,
2985
+ "notNull": true
2986
+ },
2987
+ "media_id": {
2988
+ "name": "media_id",
2989
+ "type": "text",
2990
+ "primaryKey": false,
2991
+ "notNull": true
2992
+ },
2993
+ "original_name": {
2994
+ "name": "original_name",
2995
+ "type": "text",
2996
+ "primaryKey": false,
2997
+ "notNull": true
2998
+ },
2999
+ "filename": {
3000
+ "name": "filename",
3001
+ "type": "text",
3002
+ "primaryKey": false,
3003
+ "notNull": true
3004
+ },
3005
+ "provider": {
3006
+ "name": "provider",
3007
+ "type": "text",
3008
+ "primaryKey": false,
3009
+ "notNull": true
3010
+ },
3011
+ "expected_content_type": {
3012
+ "name": "expected_content_type",
3013
+ "type": "text",
3014
+ "primaryKey": false,
3015
+ "notNull": true
3016
+ },
3017
+ "expected_size": {
3018
+ "name": "expected_size",
3019
+ "type": "integer",
3020
+ "primaryKey": false,
3021
+ "notNull": true
3022
+ },
3023
+ "expected_checksum_sha256": {
3024
+ "name": "expected_checksum_sha256",
3025
+ "type": "text",
3026
+ "primaryKey": false,
3027
+ "notNull": false
3028
+ },
3029
+ "content_disposition": {
3030
+ "name": "content_disposition",
3031
+ "type": "text",
3032
+ "primaryKey": false,
3033
+ "notNull": true,
3034
+ "default": "'inline'"
3035
+ },
3036
+ "temp_storage_key": {
3037
+ "name": "temp_storage_key",
3038
+ "type": "text",
3039
+ "primaryKey": false,
3040
+ "notNull": true
3041
+ },
3042
+ "final_storage_key": {
3043
+ "name": "final_storage_key",
3044
+ "type": "text",
3045
+ "primaryKey": false,
3046
+ "notNull": true
3047
+ },
3048
+ "multipart_upload_id": {
3049
+ "name": "multipart_upload_id",
3050
+ "type": "text",
3051
+ "primaryKey": false,
3052
+ "notNull": false
3053
+ },
3054
+ "state": {
3055
+ "name": "state",
3056
+ "type": "text",
3057
+ "primaryKey": false,
3058
+ "notNull": true,
3059
+ "default": "'pending'"
3060
+ },
3061
+ "expires_at": {
3062
+ "name": "expires_at",
3063
+ "type": "integer",
3064
+ "primaryKey": false,
3065
+ "notNull": true
3066
+ },
3067
+ "created_at": {
3068
+ "name": "created_at",
3069
+ "type": "integer",
3070
+ "primaryKey": false,
3071
+ "notNull": true
3072
+ },
3073
+ "updated_at": {
3074
+ "name": "updated_at",
3075
+ "type": "integer",
3076
+ "primaryKey": false,
3077
+ "notNull": true
3078
+ }
3079
+ },
3080
+ "indexes": {
3081
+ "uq_upload_session_media_id": {
3082
+ "name": "uq_upload_session_media_id",
3083
+ "columns": [
3084
+ {
3085
+ "expression": "media_id",
3086
+ "isExpression": false,
3087
+ "asc": true,
3088
+ "nulls": "last"
3089
+ }
3090
+ ],
3091
+ "isUnique": true,
3092
+ "concurrently": false,
3093
+ "method": "btree",
3094
+ "with": {}
3095
+ },
3096
+ "uq_upload_session_temp_storage_key": {
3097
+ "name": "uq_upload_session_temp_storage_key",
3098
+ "columns": [
3099
+ {
3100
+ "expression": "temp_storage_key",
3101
+ "isExpression": false,
3102
+ "asc": true,
3103
+ "nulls": "last"
3104
+ }
3105
+ ],
3106
+ "isUnique": true,
3107
+ "concurrently": false,
3108
+ "method": "btree",
3109
+ "with": {}
3110
+ },
3111
+ "uq_upload_session_final_storage_key": {
3112
+ "name": "uq_upload_session_final_storage_key",
3113
+ "columns": [
3114
+ {
3115
+ "expression": "final_storage_key",
3116
+ "isExpression": false,
3117
+ "asc": true,
3118
+ "nulls": "last"
3119
+ }
3120
+ ],
3121
+ "isUnique": true,
3122
+ "concurrently": false,
3123
+ "method": "btree",
3124
+ "with": {}
3125
+ },
3126
+ "idx_upload_session_site_state": {
3127
+ "name": "idx_upload_session_site_state",
3128
+ "columns": [
3129
+ {
3130
+ "expression": "site_id",
3131
+ "isExpression": false,
3132
+ "asc": true,
3133
+ "nulls": "last"
3134
+ },
3135
+ {
3136
+ "expression": "state",
3137
+ "isExpression": false,
3138
+ "asc": true,
3139
+ "nulls": "last"
3140
+ }
3141
+ ],
3142
+ "isUnique": false,
3143
+ "concurrently": false,
3144
+ "method": "btree",
3145
+ "with": {}
3146
+ },
3147
+ "idx_upload_session_site_expires_at": {
3148
+ "name": "idx_upload_session_site_expires_at",
3149
+ "columns": [
3150
+ {
3151
+ "expression": "site_id",
3152
+ "isExpression": false,
3153
+ "asc": true,
3154
+ "nulls": "last"
3155
+ },
3156
+ {
3157
+ "expression": "expires_at",
3158
+ "isExpression": false,
3159
+ "asc": true,
3160
+ "nulls": "last"
3161
+ }
3162
+ ],
3163
+ "isUnique": false,
3164
+ "concurrently": false,
3165
+ "method": "btree",
3166
+ "with": {}
3167
+ }
3168
+ },
3169
+ "foreignKeys": {
3170
+ "upload_session_site_id_site_id_fk": {
3171
+ "name": "upload_session_site_id_site_id_fk",
3172
+ "tableFrom": "upload_session",
3173
+ "tableTo": "site",
3174
+ "columnsFrom": ["site_id"],
3175
+ "columnsTo": ["id"],
3176
+ "onDelete": "cascade",
3177
+ "onUpdate": "no action"
3178
+ }
3179
+ },
3180
+ "compositePrimaryKeys": {},
3181
+ "uniqueConstraints": {},
3182
+ "policies": {},
3183
+ "checkConstraints": {
3184
+ "chk_upload_session_expected_size_positive": {
3185
+ "name": "chk_upload_session_expected_size_positive",
3186
+ "value": "\"upload_session\".\"expected_size\" > 0"
3187
+ },
3188
+ "chk_upload_session_state": {
3189
+ "name": "chk_upload_session_state",
3190
+ "value": "\"upload_session\".\"state\" IN ('pending', 'uploaded', 'completed', 'aborted', 'failed')"
3191
+ },
3192
+ "chk_upload_session_content_disposition": {
3193
+ "name": "chk_upload_session_content_disposition",
3194
+ "value": "\"upload_session\".\"content_disposition\" IN ('inline', 'attachment')"
3195
+ }
3196
+ },
3197
+ "isRLSEnabled": false
3198
+ },
3199
+ "public.user": {
3200
+ "name": "user",
3201
+ "schema": "",
3202
+ "columns": {
3203
+ "id": {
3204
+ "name": "id",
3205
+ "type": "text",
3206
+ "primaryKey": true,
3207
+ "notNull": true
3208
+ },
3209
+ "name": {
3210
+ "name": "name",
3211
+ "type": "text",
3212
+ "primaryKey": false,
3213
+ "notNull": true
3214
+ },
3215
+ "email": {
3216
+ "name": "email",
3217
+ "type": "text",
3218
+ "primaryKey": false,
3219
+ "notNull": true
3220
+ },
3221
+ "email_verified": {
3222
+ "name": "email_verified",
3223
+ "type": "boolean",
3224
+ "primaryKey": false,
3225
+ "notNull": true,
3226
+ "default": false
3227
+ },
3228
+ "image": {
3229
+ "name": "image",
3230
+ "type": "text",
3231
+ "primaryKey": false,
3232
+ "notNull": false
3233
+ },
3234
+ "role": {
3235
+ "name": "role",
3236
+ "type": "text",
3237
+ "primaryKey": false,
3238
+ "notNull": false,
3239
+ "default": "'member'"
3240
+ },
3241
+ "created_at": {
3242
+ "name": "created_at",
3243
+ "type": "timestamp with time zone",
3244
+ "primaryKey": false,
3245
+ "notNull": true
3246
+ },
3247
+ "updated_at": {
3248
+ "name": "updated_at",
3249
+ "type": "timestamp with time zone",
3250
+ "primaryKey": false,
3251
+ "notNull": true
3252
+ }
3253
+ },
3254
+ "indexes": {},
3255
+ "foreignKeys": {},
3256
+ "compositePrimaryKeys": {},
3257
+ "uniqueConstraints": {
3258
+ "user_email_unique": {
3259
+ "name": "user_email_unique",
3260
+ "nullsNotDistinct": false,
3261
+ "columns": ["email"]
3262
+ }
3263
+ },
3264
+ "policies": {},
3265
+ "checkConstraints": {},
3266
+ "isRLSEnabled": false
3267
+ },
3268
+ "public.verification": {
3269
+ "name": "verification",
3270
+ "schema": "",
3271
+ "columns": {
3272
+ "id": {
3273
+ "name": "id",
3274
+ "type": "text",
3275
+ "primaryKey": true,
3276
+ "notNull": true
3277
+ },
3278
+ "identifier": {
3279
+ "name": "identifier",
3280
+ "type": "text",
3281
+ "primaryKey": false,
3282
+ "notNull": true
3283
+ },
3284
+ "value": {
3285
+ "name": "value",
3286
+ "type": "text",
3287
+ "primaryKey": false,
3288
+ "notNull": true
3289
+ },
3290
+ "expires_at": {
3291
+ "name": "expires_at",
3292
+ "type": "timestamp with time zone",
3293
+ "primaryKey": false,
3294
+ "notNull": true
3295
+ },
3296
+ "created_at": {
3297
+ "name": "created_at",
3298
+ "type": "timestamp with time zone",
3299
+ "primaryKey": false,
3300
+ "notNull": false
3301
+ },
3302
+ "updated_at": {
3303
+ "name": "updated_at",
3304
+ "type": "timestamp with time zone",
3305
+ "primaryKey": false,
3306
+ "notNull": false
3307
+ }
3308
+ },
3309
+ "indexes": {},
3310
+ "foreignKeys": {},
3311
+ "compositePrimaryKeys": {},
3312
+ "uniqueConstraints": {},
3313
+ "policies": {},
3314
+ "checkConstraints": {},
3315
+ "isRLSEnabled": false
3316
+ }
3317
+ },
3318
+ "enums": {},
3319
+ "schemas": {},
3320
+ "sequences": {},
3321
+ "roles": {},
3322
+ "policies": {},
3323
+ "views": {},
3324
+ "_meta": {
3325
+ "columns": {},
3326
+ "schemas": {},
3327
+ "tables": {}
3328
+ }
3329
+ }