@jant/core 0.3.36 → 0.3.38

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 (271) hide show
  1. package/bin/commands/export.js +1 -1
  2. package/bin/commands/import-site.js +529 -0
  3. package/bin/commands/reset-password.js +3 -2
  4. package/dist/client/assets/heic-to-DIRPI3VF.js +1 -0
  5. package/dist/client/assets/url-FWFqPJPb.js +1 -0
  6. package/dist/client/client.css +1 -1
  7. package/dist/client/client.js +4012 -3276
  8. package/dist/index.js +10285 -5809
  9. package/package.json +11 -3
  10. package/src/__tests__/helpers/app.ts +9 -9
  11. package/src/__tests__/helpers/db.ts +91 -93
  12. package/src/app.tsx +157 -27
  13. package/src/auth.ts +20 -2
  14. package/src/client/archive-nav.js +187 -0
  15. package/src/client/audio-player.ts +478 -0
  16. package/src/client/audio-processor.ts +84 -0
  17. package/src/client/avatar-upload.ts +3 -2
  18. package/src/client/components/__tests__/jant-compose-dialog.test.ts +645 -49
  19. package/src/client/components/__tests__/jant-compose-editor.test.ts +208 -16
  20. package/src/client/components/__tests__/jant-post-form.test.ts +19 -9
  21. package/src/client/components/__tests__/jant-settings-avatar.test.ts +2 -2
  22. package/src/client/components/__tests__/jant-settings-general.test.ts +3 -3
  23. package/src/client/components/collection-sidebar-types.ts +7 -9
  24. package/src/client/components/compose-types.ts +101 -4
  25. package/src/client/components/jant-collection-form.ts +43 -7
  26. package/src/client/components/jant-collection-sidebar.ts +88 -84
  27. package/src/client/components/jant-compose-dialog.ts +1655 -219
  28. package/src/client/components/jant-compose-editor.ts +732 -168
  29. package/src/client/components/jant-compose-fullscreen.ts +23 -78
  30. package/src/client/components/jant-media-lightbox.ts +2 -0
  31. package/src/client/components/jant-nav-manager.ts +24 -284
  32. package/src/client/components/jant-post-form.ts +89 -9
  33. package/src/client/components/jant-post-menu.ts +1019 -0
  34. package/src/client/components/jant-settings-avatar.ts +3 -3
  35. package/src/client/components/jant-settings-general.ts +38 -4
  36. package/src/client/components/jant-text-preview.ts +232 -0
  37. package/src/client/components/nav-manager-types.ts +4 -19
  38. package/src/client/components/post-form-template.ts +107 -12
  39. package/src/client/components/post-form-types.ts +11 -4
  40. package/src/client/compose-bridge.ts +410 -109
  41. package/src/client/image-processor.ts +26 -8
  42. package/src/client/media-metadata.ts +247 -0
  43. package/src/client/multipart-upload.ts +160 -0
  44. package/src/client/post-form-bridge.ts +52 -1
  45. package/src/client/settings-bridge.ts +0 -12
  46. package/src/client/thread-context.ts +140 -0
  47. package/src/client/tiptap/create-editor.ts +46 -0
  48. package/src/client/tiptap/extensions.ts +5 -0
  49. package/src/client/tiptap/image-node.ts +2 -8
  50. package/src/client/tiptap/paste-image.ts +2 -13
  51. package/src/client/tiptap/slash-commands.ts +173 -63
  52. package/src/client/toast.ts +101 -3
  53. package/src/client/types/sortablejs.d.ts +15 -0
  54. package/src/client/upload-with-metadata.ts +54 -0
  55. package/src/client/video-processor.ts +207 -0
  56. package/src/client.ts +5 -2
  57. package/src/db/__tests__/migrations.test.ts +118 -0
  58. package/src/db/index.ts +52 -0
  59. package/src/db/migrations/0000_baseline.sql +269 -0
  60. package/src/db/migrations/0001_fts_setup.sql +31 -0
  61. package/src/db/migrations/meta/0000_snapshot.json +703 -119
  62. package/src/db/migrations/meta/0001_snapshot.json +1337 -0
  63. package/src/db/migrations/meta/_journal.json +4 -39
  64. package/src/db/schema.ts +409 -145
  65. package/src/i18n/__tests__/detect.test.ts +115 -0
  66. package/src/i18n/context.tsx +2 -2
  67. package/src/i18n/detect.ts +85 -1
  68. package/src/i18n/i18n.ts +1 -1
  69. package/src/i18n/index.ts +2 -1
  70. package/src/i18n/locales/en.po +487 -1217
  71. package/src/i18n/locales/en.ts +1 -1
  72. package/src/i18n/locales/zh-Hans.po +613 -996
  73. package/src/i18n/locales/zh-Hans.ts +1 -1
  74. package/src/i18n/locales/zh-Hant.po +624 -1007
  75. package/src/i18n/locales/zh-Hant.ts +1 -1
  76. package/src/i18n/middleware.ts +6 -0
  77. package/src/index.ts +5 -7
  78. package/src/lib/__tests__/blurhash-placeholder.test.ts +75 -0
  79. package/src/lib/__tests__/constants.test.ts +0 -1
  80. package/src/lib/__tests__/markdown-to-tiptap.test.ts +358 -0
  81. package/src/lib/__tests__/nanoid.test.ts +26 -0
  82. package/src/lib/__tests__/schemas.test.ts +181 -63
  83. package/src/lib/__tests__/slug.test.ts +126 -0
  84. package/src/lib/__tests__/sse.test.ts +6 -6
  85. package/src/lib/__tests__/summary.test.ts +264 -0
  86. package/src/lib/__tests__/theme.test.ts +1 -1
  87. package/src/lib/__tests__/timeline.test.ts +33 -30
  88. package/src/lib/__tests__/tiptap-to-markdown.test.ts +346 -0
  89. package/src/lib/__tests__/view.test.ts +141 -66
  90. package/src/lib/blurhash-placeholder.ts +102 -0
  91. package/src/lib/constants.ts +3 -1
  92. package/src/lib/emoji-catalog.ts +885 -68
  93. package/src/lib/errors.ts +11 -8
  94. package/src/lib/feed.ts +78 -32
  95. package/src/lib/html.ts +2 -1
  96. package/src/lib/icon-catalog.ts +5033 -1
  97. package/src/lib/icons.ts +3 -2
  98. package/src/lib/index.ts +0 -1
  99. package/src/lib/markdown-to-tiptap.ts +286 -0
  100. package/src/lib/media-helpers.ts +12 -3
  101. package/src/lib/nanoid.ts +29 -0
  102. package/src/lib/navigation.ts +1 -1
  103. package/src/lib/render.tsx +20 -2
  104. package/src/lib/resolve-config.ts +6 -2
  105. package/src/lib/schemas.ts +224 -55
  106. package/src/lib/search-snippet.ts +34 -0
  107. package/src/lib/slug.ts +96 -0
  108. package/src/lib/sse.ts +6 -6
  109. package/src/lib/storage.ts +115 -7
  110. package/src/lib/summary.ts +66 -0
  111. package/src/lib/theme.ts +11 -8
  112. package/src/lib/timeline.ts +74 -34
  113. package/src/lib/tiptap-render.ts +5 -10
  114. package/src/lib/tiptap-to-markdown.ts +305 -0
  115. package/src/lib/upload.ts +190 -29
  116. package/src/lib/url.ts +31 -0
  117. package/src/lib/view.ts +204 -37
  118. package/src/middleware/__tests__/auth.test.ts +191 -11
  119. package/src/middleware/__tests__/onboarding.test.ts +12 -10
  120. package/src/middleware/auth.ts +63 -9
  121. package/src/middleware/onboarding.ts +1 -1
  122. package/src/middleware/secure-headers.ts +40 -0
  123. package/src/preset.css +45 -2
  124. package/src/routes/__tests__/compose.test.ts +17 -24
  125. package/src/routes/api/__tests__/collections.test.ts +109 -61
  126. package/src/routes/api/__tests__/nav-items.test.ts +46 -29
  127. package/src/routes/api/__tests__/posts.test.ts +132 -68
  128. package/src/routes/api/__tests__/search.test.ts +15 -2
  129. package/src/routes/api/__tests__/upload-multipart.test.ts +534 -0
  130. package/src/routes/api/collections.ts +51 -42
  131. package/src/routes/api/custom-urls.ts +80 -0
  132. package/src/routes/api/export.ts +31 -0
  133. package/src/routes/api/nav-items.ts +23 -19
  134. package/src/routes/api/posts.ts +43 -39
  135. package/src/routes/api/search.ts +3 -4
  136. package/src/routes/api/upload-multipart.ts +245 -0
  137. package/src/routes/api/upload.ts +85 -19
  138. package/src/routes/auth/__tests__/setup.test.ts +20 -60
  139. package/src/routes/auth/setup.tsx +26 -33
  140. package/src/routes/auth/signin.tsx +3 -7
  141. package/src/routes/compose.tsx +10 -55
  142. package/src/routes/dash/__tests__/settings-avatar.test.ts +1 -1
  143. package/src/routes/dash/custom-urls.tsx +414 -0
  144. package/src/routes/dash/settings.tsx +304 -232
  145. package/src/routes/feed/__tests__/rss.test.ts +27 -28
  146. package/src/routes/feed/rss.ts +6 -4
  147. package/src/routes/feed/sitemap.ts +2 -12
  148. package/src/routes/pages/__tests__/collections.test.ts +5 -6
  149. package/src/routes/pages/__tests__/featured.test.ts +41 -22
  150. package/src/routes/pages/archive.tsx +175 -39
  151. package/src/routes/pages/collection.tsx +22 -10
  152. package/src/routes/pages/collections.tsx +3 -3
  153. package/src/routes/pages/featured.tsx +28 -4
  154. package/src/routes/pages/home.tsx +16 -15
  155. package/src/routes/pages/latest.tsx +1 -11
  156. package/src/routes/pages/new.tsx +39 -0
  157. package/src/routes/pages/page.tsx +95 -49
  158. package/src/routes/pages/search.tsx +1 -1
  159. package/src/services/__tests__/api-token.test.ts +135 -0
  160. package/src/services/__tests__/collection.test.ts +275 -227
  161. package/src/services/__tests__/custom-url.test.ts +213 -0
  162. package/src/services/__tests__/media.test.ts +162 -22
  163. package/src/services/__tests__/navigation.test.ts +109 -68
  164. package/src/services/__tests__/post-timeline.test.ts +205 -32
  165. package/src/services/__tests__/post.test.ts +713 -234
  166. package/src/services/__tests__/search.test.ts +67 -10
  167. package/src/services/api-token.ts +166 -0
  168. package/src/services/auth.ts +17 -2
  169. package/src/services/collection.ts +397 -131
  170. package/src/services/custom-url.ts +188 -0
  171. package/src/services/export.ts +802 -0
  172. package/src/services/index.ts +26 -19
  173. package/src/services/media.ts +100 -22
  174. package/src/services/navigation.ts +158 -47
  175. package/src/services/path.ts +339 -0
  176. package/src/services/post.ts +687 -154
  177. package/src/services/search.ts +160 -75
  178. package/src/styles/components.css +58 -7
  179. package/src/styles/tokens.css +84 -6
  180. package/src/styles/ui.css +2964 -457
  181. package/src/types/bindings.ts +4 -1
  182. package/src/types/config.ts +12 -4
  183. package/src/types/constants.ts +15 -3
  184. package/src/types/entities.ts +74 -35
  185. package/src/types/operations.ts +11 -24
  186. package/src/types/props.ts +51 -16
  187. package/src/types/views.ts +45 -22
  188. package/src/ui/color-themes.ts +133 -23
  189. package/src/ui/compose/ComposeDialog.tsx +239 -17
  190. package/src/ui/compose/ComposePrompt.tsx +1 -1
  191. package/src/ui/dash/CrudPageHeader.tsx +1 -1
  192. package/src/ui/dash/ListItemRow.tsx +1 -1
  193. package/src/ui/dash/StatusBadge.tsx +3 -1
  194. package/src/ui/dash/appearance/AdvancedContent.tsx +22 -1
  195. package/src/ui/dash/appearance/ColorThemeContent.tsx +22 -2
  196. package/src/ui/dash/appearance/FontThemeContent.tsx +1 -1
  197. package/src/ui/dash/appearance/NavigationContent.tsx +5 -45
  198. package/src/ui/dash/index.ts +0 -3
  199. package/src/ui/dash/settings/AccountContent.tsx +3 -57
  200. package/src/ui/dash/settings/AccountMenuContent.tsx +147 -0
  201. package/src/ui/dash/settings/ApiTokensContent.tsx +232 -0
  202. package/src/ui/dash/settings/AvatarContent.tsx +8 -0
  203. package/src/ui/dash/settings/SessionsContent.tsx +159 -0
  204. package/src/ui/dash/settings/SettingsRootContent.tsx +45 -15
  205. package/src/ui/feed/LinkCard.tsx +89 -40
  206. package/src/ui/feed/NoteCard.tsx +39 -25
  207. package/src/ui/feed/PostStatusBadges.tsx +67 -0
  208. package/src/ui/feed/QuoteCard.tsx +38 -23
  209. package/src/ui/feed/ThreadPreview.tsx +90 -26
  210. package/src/ui/feed/TimelineFeed.tsx +3 -2
  211. package/src/ui/feed/TimelineItem.tsx +15 -6
  212. package/src/ui/feed/__tests__/thread-preview.test.ts +107 -0
  213. package/src/ui/feed/thread-preview-state.ts +61 -0
  214. package/src/ui/font-themes.ts +2 -2
  215. package/src/ui/layouts/BaseLayout.tsx +2 -2
  216. package/src/ui/layouts/SiteLayout.tsx +105 -92
  217. package/src/ui/pages/ArchivePage.tsx +923 -98
  218. package/src/ui/pages/ComposePage.tsx +54 -0
  219. package/src/ui/pages/PostPage.tsx +30 -45
  220. package/src/ui/pages/SearchPage.tsx +181 -37
  221. package/src/ui/shared/AdminBreadcrumb.tsx +29 -0
  222. package/src/ui/shared/CollectionsSidebar.tsx +47 -37
  223. package/src/ui/shared/MediaGallery.tsx +445 -149
  224. package/src/ui/shared/PostFooter.tsx +204 -0
  225. package/src/ui/shared/StarRating.tsx +27 -0
  226. package/src/ui/shared/__tests__/format-chars.test.ts +35 -0
  227. package/src/ui/shared/index.ts +0 -1
  228. package/dist/client/assets/url-8Dj-5CLW.js +0 -1
  229. package/src/client/media-upload.ts +0 -161
  230. package/src/client/page-slug-bridge.ts +0 -42
  231. package/src/db/migrations/0000_square_wallflower.sql +0 -118
  232. package/src/db/migrations/0001_add_search_fts.sql +0 -34
  233. package/src/db/migrations/0002_add_media_attachments.sql +0 -3
  234. package/src/db/migrations/0003_add_navigation_links.sql +0 -8
  235. package/src/db/migrations/0004_add_storage_provider.sql +0 -3
  236. package/src/db/migrations/0005_v2_schema_migration.sql +0 -268
  237. package/src/db/migrations/0006_rename_slug_to_path.sql +0 -5
  238. package/src/db/migrations/0007_post_collections_m2m.sql +0 -94
  239. package/src/db/migrations/0008_add_collection_dividers.sql +0 -8
  240. package/src/db/migrations/0009_drop_collection_show_divider.sql +0 -2
  241. package/src/db/migrations/0010_add_performance_indexes.sql +0 -16
  242. package/src/db/migrations/0011_add_path_registry.sql +0 -23
  243. package/src/db/migrations/0012_add_tiptap_columns.sql +0 -2
  244. package/src/db/migrations/0013_replace_featured_with_visibility.sql +0 -8
  245. package/src/db/migrations/meta/0003_snapshot.json +0 -821
  246. package/src/lib/__tests__/sqid.test.ts +0 -65
  247. package/src/lib/sqid.ts +0 -79
  248. package/src/routes/api/__tests__/pages.test.ts +0 -218
  249. package/src/routes/api/pages.ts +0 -73
  250. package/src/routes/dash/__tests__/pages.test.ts +0 -226
  251. package/src/routes/dash/index.tsx +0 -109
  252. package/src/routes/dash/media.tsx +0 -135
  253. package/src/routes/dash/pages.tsx +0 -245
  254. package/src/routes/dash/posts.tsx +0 -338
  255. package/src/routes/dash/redirects.tsx +0 -263
  256. package/src/routes/pages/post.tsx +0 -59
  257. package/src/services/__tests__/page.test.ts +0 -298
  258. package/src/services/__tests__/path-registry.test.ts +0 -165
  259. package/src/services/__tests__/redirect.test.ts +0 -159
  260. package/src/services/page.ts +0 -216
  261. package/src/services/path-registry.ts +0 -160
  262. package/src/services/redirect.ts +0 -97
  263. package/src/ui/dash/PageForm.tsx +0 -187
  264. package/src/ui/dash/PostList.tsx +0 -95
  265. package/src/ui/dash/media/MediaListContent.tsx +0 -206
  266. package/src/ui/dash/media/ViewMediaContent.tsx +0 -208
  267. package/src/ui/dash/pages/PagesContent.tsx +0 -75
  268. package/src/ui/dash/posts/PostForm.tsx +0 -260
  269. package/src/ui/layouts/DashLayout.tsx +0 -247
  270. package/src/ui/pages/SinglePage.tsx +0 -23
  271. package/src/ui/shared/ThreadView.tsx +0 -136
@@ -0,0 +1,1337 @@
1
+ {
2
+ "id": "8ec15936-3334-40bc-9823-82c818d45d96",
3
+ "prevId": "6387f30b-c6d3-4ad1-a627-1ec026abed4a",
4
+ "version": "6",
5
+ "dialect": "sqlite",
6
+ "tables": {
7
+ "account": {
8
+ "name": "account",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "account_id": {
18
+ "name": "account_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "provider_id": {
25
+ "name": "provider_id",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "user_id": {
32
+ "name": "user_id",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "access_token": {
39
+ "name": "access_token",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "refresh_token": {
46
+ "name": "refresh_token",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": false,
50
+ "autoincrement": false
51
+ },
52
+ "id_token": {
53
+ "name": "id_token",
54
+ "type": "text",
55
+ "primaryKey": false,
56
+ "notNull": false,
57
+ "autoincrement": false
58
+ },
59
+ "access_token_expires_at": {
60
+ "name": "access_token_expires_at",
61
+ "type": "integer",
62
+ "primaryKey": false,
63
+ "notNull": false,
64
+ "autoincrement": false
65
+ },
66
+ "refresh_token_expires_at": {
67
+ "name": "refresh_token_expires_at",
68
+ "type": "integer",
69
+ "primaryKey": false,
70
+ "notNull": false,
71
+ "autoincrement": false
72
+ },
73
+ "scope": {
74
+ "name": "scope",
75
+ "type": "text",
76
+ "primaryKey": false,
77
+ "notNull": false,
78
+ "autoincrement": false
79
+ },
80
+ "password": {
81
+ "name": "password",
82
+ "type": "text",
83
+ "primaryKey": false,
84
+ "notNull": false,
85
+ "autoincrement": false
86
+ },
87
+ "created_at": {
88
+ "name": "created_at",
89
+ "type": "integer",
90
+ "primaryKey": false,
91
+ "notNull": true,
92
+ "autoincrement": false
93
+ },
94
+ "updated_at": {
95
+ "name": "updated_at",
96
+ "type": "integer",
97
+ "primaryKey": false,
98
+ "notNull": true,
99
+ "autoincrement": false
100
+ }
101
+ },
102
+ "indexes": {},
103
+ "foreignKeys": {
104
+ "account_user_id_user_id_fk": {
105
+ "name": "account_user_id_user_id_fk",
106
+ "tableFrom": "account",
107
+ "columnsFrom": ["user_id"],
108
+ "tableTo": "user",
109
+ "columnsTo": ["id"],
110
+ "onUpdate": "no action",
111
+ "onDelete": "no action"
112
+ }
113
+ },
114
+ "compositePrimaryKeys": {},
115
+ "uniqueConstraints": {},
116
+ "checkConstraints": {}
117
+ },
118
+ "api_token": {
119
+ "name": "api_token",
120
+ "columns": {
121
+ "id": {
122
+ "name": "id",
123
+ "type": "text",
124
+ "primaryKey": true,
125
+ "notNull": true,
126
+ "autoincrement": false
127
+ },
128
+ "name": {
129
+ "name": "name",
130
+ "type": "text",
131
+ "primaryKey": false,
132
+ "notNull": true,
133
+ "autoincrement": false
134
+ },
135
+ "token_hash": {
136
+ "name": "token_hash",
137
+ "type": "text",
138
+ "primaryKey": false,
139
+ "notNull": true,
140
+ "autoincrement": false
141
+ },
142
+ "prefix": {
143
+ "name": "prefix",
144
+ "type": "text",
145
+ "primaryKey": false,
146
+ "notNull": true,
147
+ "autoincrement": false
148
+ },
149
+ "last_used_at": {
150
+ "name": "last_used_at",
151
+ "type": "integer",
152
+ "primaryKey": false,
153
+ "notNull": false,
154
+ "autoincrement": false
155
+ },
156
+ "created_at": {
157
+ "name": "created_at",
158
+ "type": "integer",
159
+ "primaryKey": false,
160
+ "notNull": true,
161
+ "autoincrement": false
162
+ },
163
+ "updated_at": {
164
+ "name": "updated_at",
165
+ "type": "integer",
166
+ "primaryKey": false,
167
+ "notNull": true,
168
+ "autoincrement": false
169
+ }
170
+ },
171
+ "indexes": {
172
+ "api_token_token_hash_unique": {
173
+ "name": "api_token_token_hash_unique",
174
+ "columns": ["token_hash"],
175
+ "isUnique": true
176
+ }
177
+ },
178
+ "foreignKeys": {},
179
+ "compositePrimaryKeys": {},
180
+ "uniqueConstraints": {},
181
+ "checkConstraints": {}
182
+ },
183
+ "collection": {
184
+ "name": "collection",
185
+ "columns": {
186
+ "id": {
187
+ "name": "id",
188
+ "type": "text",
189
+ "primaryKey": true,
190
+ "notNull": true,
191
+ "autoincrement": false
192
+ },
193
+ "title": {
194
+ "name": "title",
195
+ "type": "text",
196
+ "primaryKey": false,
197
+ "notNull": true,
198
+ "autoincrement": false
199
+ },
200
+ "description": {
201
+ "name": "description",
202
+ "type": "text",
203
+ "primaryKey": false,
204
+ "notNull": false,
205
+ "autoincrement": false
206
+ },
207
+ "icon": {
208
+ "name": "icon",
209
+ "type": "text",
210
+ "primaryKey": false,
211
+ "notNull": false,
212
+ "autoincrement": false
213
+ },
214
+ "sort_order": {
215
+ "name": "sort_order",
216
+ "type": "text",
217
+ "primaryKey": false,
218
+ "notNull": true,
219
+ "autoincrement": false,
220
+ "default": "'newest'"
221
+ },
222
+ "created_at": {
223
+ "name": "created_at",
224
+ "type": "integer",
225
+ "primaryKey": false,
226
+ "notNull": true,
227
+ "autoincrement": false
228
+ },
229
+ "updated_at": {
230
+ "name": "updated_at",
231
+ "type": "integer",
232
+ "primaryKey": false,
233
+ "notNull": true,
234
+ "autoincrement": false
235
+ }
236
+ },
237
+ "indexes": {},
238
+ "foreignKeys": {},
239
+ "compositePrimaryKeys": {},
240
+ "uniqueConstraints": {},
241
+ "checkConstraints": {
242
+ "chk_collection_sort_order": {
243
+ "name": "chk_collection_sort_order",
244
+ "value": "\"collection\".\"sort_order\" IN ('newest', 'oldest', 'rating_desc', 'rating_asc')"
245
+ }
246
+ }
247
+ },
248
+ "media": {
249
+ "name": "media",
250
+ "columns": {
251
+ "id": {
252
+ "name": "id",
253
+ "type": "text",
254
+ "primaryKey": true,
255
+ "notNull": true,
256
+ "autoincrement": false
257
+ },
258
+ "post_id": {
259
+ "name": "post_id",
260
+ "type": "text",
261
+ "primaryKey": false,
262
+ "notNull": false,
263
+ "autoincrement": false
264
+ },
265
+ "filename": {
266
+ "name": "filename",
267
+ "type": "text",
268
+ "primaryKey": false,
269
+ "notNull": true,
270
+ "autoincrement": false
271
+ },
272
+ "original_name": {
273
+ "name": "original_name",
274
+ "type": "text",
275
+ "primaryKey": false,
276
+ "notNull": true,
277
+ "autoincrement": false
278
+ },
279
+ "mime_type": {
280
+ "name": "mime_type",
281
+ "type": "text",
282
+ "primaryKey": false,
283
+ "notNull": true,
284
+ "autoincrement": false
285
+ },
286
+ "size": {
287
+ "name": "size",
288
+ "type": "integer",
289
+ "primaryKey": false,
290
+ "notNull": true,
291
+ "autoincrement": false
292
+ },
293
+ "storage_key": {
294
+ "name": "storage_key",
295
+ "type": "text",
296
+ "primaryKey": false,
297
+ "notNull": true,
298
+ "autoincrement": false
299
+ },
300
+ "provider": {
301
+ "name": "provider",
302
+ "type": "text",
303
+ "primaryKey": false,
304
+ "notNull": true,
305
+ "autoincrement": false,
306
+ "default": "'r2'"
307
+ },
308
+ "width": {
309
+ "name": "width",
310
+ "type": "integer",
311
+ "primaryKey": false,
312
+ "notNull": false,
313
+ "autoincrement": false
314
+ },
315
+ "height": {
316
+ "name": "height",
317
+ "type": "integer",
318
+ "primaryKey": false,
319
+ "notNull": false,
320
+ "autoincrement": false
321
+ },
322
+ "alt": {
323
+ "name": "alt",
324
+ "type": "text",
325
+ "primaryKey": false,
326
+ "notNull": false,
327
+ "autoincrement": false
328
+ },
329
+ "position": {
330
+ "name": "position",
331
+ "type": "text",
332
+ "primaryKey": false,
333
+ "notNull": true,
334
+ "autoincrement": false,
335
+ "default": "'a0'"
336
+ },
337
+ "blurhash": {
338
+ "name": "blurhash",
339
+ "type": "text",
340
+ "primaryKey": false,
341
+ "notNull": false,
342
+ "autoincrement": false
343
+ },
344
+ "waveform": {
345
+ "name": "waveform",
346
+ "type": "text",
347
+ "primaryKey": false,
348
+ "notNull": false,
349
+ "autoincrement": false
350
+ },
351
+ "poster_key": {
352
+ "name": "poster_key",
353
+ "type": "text",
354
+ "primaryKey": false,
355
+ "notNull": false,
356
+ "autoincrement": false
357
+ },
358
+ "summary": {
359
+ "name": "summary",
360
+ "type": "text",
361
+ "primaryKey": false,
362
+ "notNull": false,
363
+ "autoincrement": false
364
+ },
365
+ "chars": {
366
+ "name": "chars",
367
+ "type": "integer",
368
+ "primaryKey": false,
369
+ "notNull": false,
370
+ "autoincrement": false
371
+ },
372
+ "media_kind": {
373
+ "name": "media_kind",
374
+ "type": "text",
375
+ "primaryKey": false,
376
+ "notNull": true,
377
+ "autoincrement": false,
378
+ "default": "'document'"
379
+ },
380
+ "created_at": {
381
+ "name": "created_at",
382
+ "type": "integer",
383
+ "primaryKey": false,
384
+ "notNull": true,
385
+ "autoincrement": false
386
+ },
387
+ "updated_at": {
388
+ "name": "updated_at",
389
+ "type": "integer",
390
+ "primaryKey": false,
391
+ "notNull": true,
392
+ "autoincrement": false
393
+ }
394
+ },
395
+ "indexes": {
396
+ "idx_media_post_id_position": {
397
+ "name": "idx_media_post_id_position",
398
+ "columns": ["post_id", "position"],
399
+ "isUnique": false
400
+ },
401
+ "uq_media_post_position": {
402
+ "name": "uq_media_post_position",
403
+ "columns": ["post_id", "position"],
404
+ "where": "\"media\".\"post_id\" IS NOT NULL",
405
+ "isUnique": true
406
+ },
407
+ "uq_media_provider_storage_key": {
408
+ "name": "uq_media_provider_storage_key",
409
+ "columns": ["provider", "storage_key"],
410
+ "isUnique": true
411
+ },
412
+ "idx_media_media_kind_post_id": {
413
+ "name": "idx_media_media_kind_post_id",
414
+ "columns": ["media_kind", "post_id"],
415
+ "isUnique": false
416
+ }
417
+ },
418
+ "foreignKeys": {
419
+ "media_post_id_post_id_fk": {
420
+ "name": "media_post_id_post_id_fk",
421
+ "tableFrom": "media",
422
+ "columnsFrom": ["post_id"],
423
+ "tableTo": "post",
424
+ "columnsTo": ["id"],
425
+ "onUpdate": "no action",
426
+ "onDelete": "set null"
427
+ }
428
+ },
429
+ "compositePrimaryKeys": {},
430
+ "uniqueConstraints": {},
431
+ "checkConstraints": {
432
+ "chk_media_provider": {
433
+ "name": "chk_media_provider",
434
+ "value": "\"media\".\"provider\" IN ('r2', 's3')"
435
+ },
436
+ "chk_media_media_kind": {
437
+ "name": "chk_media_media_kind",
438
+ "value": "\"media\".\"media_kind\" IN ('image', 'video', 'audio', 'text', 'document')"
439
+ },
440
+ "chk_media_size_positive": {
441
+ "name": "chk_media_size_positive",
442
+ "value": "\"media\".\"size\" > 0"
443
+ },
444
+ "chk_media_position_not_blank": {
445
+ "name": "chk_media_position_not_blank",
446
+ "value": "trim(\"media\".\"position\") <> ''"
447
+ },
448
+ "chk_media_dimensions_positive": {
449
+ "name": "chk_media_dimensions_positive",
450
+ "value": "(\n \"media\".\"width\" IS NULL OR \"media\".\"width\" > 0\n ) AND (\n \"media\".\"height\" IS NULL OR \"media\".\"height\" > 0\n )"
451
+ },
452
+ "chk_media_chars_nonnegative": {
453
+ "name": "chk_media_chars_nonnegative",
454
+ "value": "\"media\".\"chars\" IS NULL OR \"media\".\"chars\" >= 0"
455
+ }
456
+ }
457
+ },
458
+ "nav_item": {
459
+ "name": "nav_item",
460
+ "columns": {
461
+ "id": {
462
+ "name": "id",
463
+ "type": "text",
464
+ "primaryKey": true,
465
+ "notNull": true,
466
+ "autoincrement": false
467
+ },
468
+ "type": {
469
+ "name": "type",
470
+ "type": "text",
471
+ "primaryKey": false,
472
+ "notNull": true,
473
+ "autoincrement": false,
474
+ "default": "'link'"
475
+ },
476
+ "label": {
477
+ "name": "label",
478
+ "type": "text",
479
+ "primaryKey": false,
480
+ "notNull": true,
481
+ "autoincrement": false
482
+ },
483
+ "url": {
484
+ "name": "url",
485
+ "type": "text",
486
+ "primaryKey": false,
487
+ "notNull": true,
488
+ "autoincrement": false
489
+ },
490
+ "position": {
491
+ "name": "position",
492
+ "type": "text",
493
+ "primaryKey": false,
494
+ "notNull": true,
495
+ "autoincrement": false,
496
+ "default": "'a0'"
497
+ },
498
+ "created_at": {
499
+ "name": "created_at",
500
+ "type": "integer",
501
+ "primaryKey": false,
502
+ "notNull": true,
503
+ "autoincrement": false
504
+ },
505
+ "updated_at": {
506
+ "name": "updated_at",
507
+ "type": "integer",
508
+ "primaryKey": false,
509
+ "notNull": true,
510
+ "autoincrement": false
511
+ }
512
+ },
513
+ "indexes": {
514
+ "uq_nav_item_position": {
515
+ "name": "uq_nav_item_position",
516
+ "columns": ["position"],
517
+ "isUnique": true
518
+ }
519
+ },
520
+ "foreignKeys": {},
521
+ "compositePrimaryKeys": {},
522
+ "uniqueConstraints": {},
523
+ "checkConstraints": {
524
+ "chk_nav_item_type": {
525
+ "name": "chk_nav_item_type",
526
+ "value": "\"nav_item\".\"type\" IN ('link', 'system')"
527
+ }
528
+ }
529
+ },
530
+ "path_registry": {
531
+ "name": "path_registry",
532
+ "columns": {
533
+ "id": {
534
+ "name": "id",
535
+ "type": "text",
536
+ "primaryKey": true,
537
+ "notNull": true,
538
+ "autoincrement": false
539
+ },
540
+ "path": {
541
+ "name": "path",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true,
545
+ "autoincrement": false
546
+ },
547
+ "kind": {
548
+ "name": "kind",
549
+ "type": "text",
550
+ "primaryKey": false,
551
+ "notNull": true,
552
+ "autoincrement": false
553
+ },
554
+ "post_id": {
555
+ "name": "post_id",
556
+ "type": "text",
557
+ "primaryKey": false,
558
+ "notNull": false,
559
+ "autoincrement": false
560
+ },
561
+ "collection_id": {
562
+ "name": "collection_id",
563
+ "type": "text",
564
+ "primaryKey": false,
565
+ "notNull": false,
566
+ "autoincrement": false
567
+ },
568
+ "redirect_to_path": {
569
+ "name": "redirect_to_path",
570
+ "type": "text",
571
+ "primaryKey": false,
572
+ "notNull": false,
573
+ "autoincrement": false
574
+ },
575
+ "redirect_type": {
576
+ "name": "redirect_type",
577
+ "type": "integer",
578
+ "primaryKey": false,
579
+ "notNull": false,
580
+ "autoincrement": false
581
+ },
582
+ "created_at": {
583
+ "name": "created_at",
584
+ "type": "integer",
585
+ "primaryKey": false,
586
+ "notNull": true,
587
+ "autoincrement": false
588
+ },
589
+ "updated_at": {
590
+ "name": "updated_at",
591
+ "type": "integer",
592
+ "primaryKey": false,
593
+ "notNull": true,
594
+ "autoincrement": false
595
+ }
596
+ },
597
+ "indexes": {
598
+ "path_registry_path_unique": {
599
+ "name": "path_registry_path_unique",
600
+ "columns": ["path"],
601
+ "isUnique": true
602
+ },
603
+ "uq_path_registry_post_slug": {
604
+ "name": "uq_path_registry_post_slug",
605
+ "columns": ["post_id"],
606
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"post_id\" IS NOT NULL",
607
+ "isUnique": true
608
+ },
609
+ "uq_path_registry_collection_slug": {
610
+ "name": "uq_path_registry_collection_slug",
611
+ "columns": ["collection_id"],
612
+ "where": "\"path_registry\".\"kind\" = 'slug' AND \"path_registry\".\"collection_id\" IS NOT NULL",
613
+ "isUnique": true
614
+ },
615
+ "idx_path_registry_post_id": {
616
+ "name": "idx_path_registry_post_id",
617
+ "columns": ["post_id"],
618
+ "isUnique": false
619
+ },
620
+ "idx_path_registry_collection_id": {
621
+ "name": "idx_path_registry_collection_id",
622
+ "columns": ["collection_id"],
623
+ "isUnique": false
624
+ }
625
+ },
626
+ "foreignKeys": {
627
+ "path_registry_post_id_post_id_fk": {
628
+ "name": "path_registry_post_id_post_id_fk",
629
+ "tableFrom": "path_registry",
630
+ "columnsFrom": ["post_id"],
631
+ "tableTo": "post",
632
+ "columnsTo": ["id"],
633
+ "onUpdate": "no action",
634
+ "onDelete": "cascade"
635
+ },
636
+ "path_registry_collection_id_collection_id_fk": {
637
+ "name": "path_registry_collection_id_collection_id_fk",
638
+ "tableFrom": "path_registry",
639
+ "columnsFrom": ["collection_id"],
640
+ "tableTo": "collection",
641
+ "columnsTo": ["id"],
642
+ "onUpdate": "no action",
643
+ "onDelete": "cascade"
644
+ }
645
+ },
646
+ "compositePrimaryKeys": {},
647
+ "uniqueConstraints": {},
648
+ "checkConstraints": {
649
+ "chk_path_registry_kind": {
650
+ "name": "chk_path_registry_kind",
651
+ "value": "\"path_registry\".\"kind\" IN ('slug', 'alias', 'redirect')"
652
+ },
653
+ "chk_path_registry_shape": {
654
+ "name": "chk_path_registry_shape",
655
+ "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 ) 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 )"
656
+ }
657
+ }
658
+ },
659
+ "post_collection": {
660
+ "name": "post_collection",
661
+ "columns": {
662
+ "post_id": {
663
+ "name": "post_id",
664
+ "type": "text",
665
+ "primaryKey": false,
666
+ "notNull": true,
667
+ "autoincrement": false
668
+ },
669
+ "collection_id": {
670
+ "name": "collection_id",
671
+ "type": "text",
672
+ "primaryKey": false,
673
+ "notNull": true,
674
+ "autoincrement": false
675
+ },
676
+ "created_at": {
677
+ "name": "created_at",
678
+ "type": "integer",
679
+ "primaryKey": false,
680
+ "notNull": true,
681
+ "autoincrement": false
682
+ }
683
+ },
684
+ "indexes": {
685
+ "idx_post_collection_collection_id": {
686
+ "name": "idx_post_collection_collection_id",
687
+ "columns": ["collection_id"],
688
+ "isUnique": false
689
+ }
690
+ },
691
+ "foreignKeys": {
692
+ "post_collection_post_id_post_id_fk": {
693
+ "name": "post_collection_post_id_post_id_fk",
694
+ "tableFrom": "post_collection",
695
+ "columnsFrom": ["post_id"],
696
+ "tableTo": "post",
697
+ "columnsTo": ["id"],
698
+ "onUpdate": "no action",
699
+ "onDelete": "cascade"
700
+ },
701
+ "post_collection_collection_id_collection_id_fk": {
702
+ "name": "post_collection_collection_id_collection_id_fk",
703
+ "tableFrom": "post_collection",
704
+ "columnsFrom": ["collection_id"],
705
+ "tableTo": "collection",
706
+ "columnsTo": ["id"],
707
+ "onUpdate": "no action",
708
+ "onDelete": "cascade"
709
+ }
710
+ },
711
+ "compositePrimaryKeys": {
712
+ "post_collection_post_id_collection_id_pk": {
713
+ "columns": ["post_id", "collection_id"],
714
+ "name": "post_collection_post_id_collection_id_pk"
715
+ }
716
+ },
717
+ "uniqueConstraints": {},
718
+ "checkConstraints": {}
719
+ },
720
+ "post": {
721
+ "name": "post",
722
+ "columns": {
723
+ "id": {
724
+ "name": "id",
725
+ "type": "text",
726
+ "primaryKey": true,
727
+ "notNull": true,
728
+ "autoincrement": false
729
+ },
730
+ "format": {
731
+ "name": "format",
732
+ "type": "text",
733
+ "primaryKey": false,
734
+ "notNull": true,
735
+ "autoincrement": false
736
+ },
737
+ "status": {
738
+ "name": "status",
739
+ "type": "text",
740
+ "primaryKey": false,
741
+ "notNull": true,
742
+ "autoincrement": false,
743
+ "default": "'published'"
744
+ },
745
+ "visibility": {
746
+ "name": "visibility",
747
+ "type": "text",
748
+ "primaryKey": false,
749
+ "notNull": false,
750
+ "autoincrement": false,
751
+ "default": "'public'"
752
+ },
753
+ "pinned_at": {
754
+ "name": "pinned_at",
755
+ "type": "integer",
756
+ "primaryKey": false,
757
+ "notNull": false,
758
+ "autoincrement": false
759
+ },
760
+ "featured_at": {
761
+ "name": "featured_at",
762
+ "type": "integer",
763
+ "primaryKey": false,
764
+ "notNull": false,
765
+ "autoincrement": false
766
+ },
767
+ "title": {
768
+ "name": "title",
769
+ "type": "text",
770
+ "primaryKey": false,
771
+ "notNull": false,
772
+ "autoincrement": false
773
+ },
774
+ "url": {
775
+ "name": "url",
776
+ "type": "text",
777
+ "primaryKey": false,
778
+ "notNull": false,
779
+ "autoincrement": false
780
+ },
781
+ "body": {
782
+ "name": "body",
783
+ "type": "text",
784
+ "primaryKey": false,
785
+ "notNull": false,
786
+ "autoincrement": false
787
+ },
788
+ "body_html": {
789
+ "name": "body_html",
790
+ "type": "text",
791
+ "primaryKey": false,
792
+ "notNull": false,
793
+ "autoincrement": false
794
+ },
795
+ "body_text": {
796
+ "name": "body_text",
797
+ "type": "text",
798
+ "primaryKey": false,
799
+ "notNull": false,
800
+ "autoincrement": false
801
+ },
802
+ "quote_text": {
803
+ "name": "quote_text",
804
+ "type": "text",
805
+ "primaryKey": false,
806
+ "notNull": false,
807
+ "autoincrement": false
808
+ },
809
+ "summary": {
810
+ "name": "summary",
811
+ "type": "text",
812
+ "primaryKey": false,
813
+ "notNull": false,
814
+ "autoincrement": false
815
+ },
816
+ "rating": {
817
+ "name": "rating",
818
+ "type": "integer",
819
+ "primaryKey": false,
820
+ "notNull": false,
821
+ "autoincrement": false
822
+ },
823
+ "reply_to_id": {
824
+ "name": "reply_to_id",
825
+ "type": "text",
826
+ "primaryKey": false,
827
+ "notNull": false,
828
+ "autoincrement": false
829
+ },
830
+ "thread_id": {
831
+ "name": "thread_id",
832
+ "type": "text",
833
+ "primaryKey": false,
834
+ "notNull": true,
835
+ "autoincrement": false
836
+ },
837
+ "deleted_at": {
838
+ "name": "deleted_at",
839
+ "type": "integer",
840
+ "primaryKey": false,
841
+ "notNull": false,
842
+ "autoincrement": false
843
+ },
844
+ "published_at": {
845
+ "name": "published_at",
846
+ "type": "integer",
847
+ "primaryKey": false,
848
+ "notNull": false,
849
+ "autoincrement": false
850
+ },
851
+ "last_activity_at": {
852
+ "name": "last_activity_at",
853
+ "type": "integer",
854
+ "primaryKey": false,
855
+ "notNull": false,
856
+ "autoincrement": false
857
+ },
858
+ "created_at": {
859
+ "name": "created_at",
860
+ "type": "integer",
861
+ "primaryKey": false,
862
+ "notNull": true,
863
+ "autoincrement": false
864
+ },
865
+ "updated_at": {
866
+ "name": "updated_at",
867
+ "type": "integer",
868
+ "primaryKey": false,
869
+ "notNull": true,
870
+ "autoincrement": false
871
+ }
872
+ },
873
+ "indexes": {
874
+ "uq_post_id_thread_id": {
875
+ "name": "uq_post_id_thread_id",
876
+ "columns": ["id", "thread_id"],
877
+ "isUnique": true
878
+ },
879
+ "idx_post_thread_id": {
880
+ "name": "idx_post_thread_id",
881
+ "columns": ["thread_id"],
882
+ "isUnique": false
883
+ },
884
+ "idx_post_thread_live_created": {
885
+ "name": "idx_post_thread_live_created",
886
+ "columns": ["thread_id", "created_at", "id"],
887
+ "where": "\"post\".\"deleted_at\" IS NULL",
888
+ "isUnique": false
889
+ },
890
+ "idx_post_status_deleted_published": {
891
+ "name": "idx_post_status_deleted_published",
892
+ "columns": ["status", "deleted_at", "published_at"],
893
+ "isUnique": false
894
+ },
895
+ "idx_post_status_deleted_activity": {
896
+ "name": "idx_post_status_deleted_activity",
897
+ "columns": ["status", "deleted_at", "last_activity_at"],
898
+ "isUnique": false
899
+ },
900
+ "idx_post_root_live_published_activity": {
901
+ "name": "idx_post_root_live_published_activity",
902
+ "columns": ["last_activity_at", "id"],
903
+ "where": "\"post\".\"deleted_at\" IS NULL AND \"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'published'",
904
+ "isUnique": false
905
+ },
906
+ "idx_post_root_live_draft_updated": {
907
+ "name": "idx_post_root_live_draft_updated",
908
+ "columns": ["updated_at", "id"],
909
+ "where": "\"post\".\"deleted_at\" IS NULL AND \"post\".\"reply_to_id\" IS NULL AND \"post\".\"status\" = 'draft'",
910
+ "isUnique": false
911
+ },
912
+ "idx_post_reply_live_thread_created": {
913
+ "name": "idx_post_reply_live_thread_created",
914
+ "columns": ["thread_id", "created_at", "id"],
915
+ "where": "\"post\".\"deleted_at\" IS NULL AND \"post\".\"reply_to_id\" IS NOT NULL AND \"post\".\"status\" = 'published'",
916
+ "isUnique": false
917
+ }
918
+ },
919
+ "foreignKeys": {
920
+ "post_reply_to_id_post_id_fk": {
921
+ "name": "post_reply_to_id_post_id_fk",
922
+ "tableFrom": "post",
923
+ "columnsFrom": ["reply_to_id"],
924
+ "tableTo": "post",
925
+ "columnsTo": ["id"],
926
+ "onUpdate": "no action",
927
+ "onDelete": "no action"
928
+ },
929
+ "post_thread_id_post_id_fk": {
930
+ "name": "post_thread_id_post_id_fk",
931
+ "tableFrom": "post",
932
+ "columnsFrom": ["thread_id"],
933
+ "tableTo": "post",
934
+ "columnsTo": ["id"],
935
+ "onUpdate": "no action",
936
+ "onDelete": "no action"
937
+ },
938
+ "post_reply_to_id_thread_id_post_id_thread_id_fk": {
939
+ "name": "post_reply_to_id_thread_id_post_id_thread_id_fk",
940
+ "tableFrom": "post",
941
+ "columnsFrom": ["reply_to_id", "thread_id"],
942
+ "tableTo": "post",
943
+ "columnsTo": ["id", "thread_id"],
944
+ "onUpdate": "no action",
945
+ "onDelete": "no action"
946
+ }
947
+ },
948
+ "compositePrimaryKeys": {},
949
+ "uniqueConstraints": {},
950
+ "checkConstraints": {
951
+ "chk_post_format": {
952
+ "name": "chk_post_format",
953
+ "value": "\"post\".\"format\" IN ('note', 'link', 'quote')"
954
+ },
955
+ "chk_post_status": {
956
+ "name": "chk_post_status",
957
+ "value": "\"post\".\"status\" IN ('draft', 'published')"
958
+ },
959
+ "chk_post_visibility": {
960
+ "name": "chk_post_visibility",
961
+ "value": "\"post\".\"visibility\" IN ('public', 'unlisted', 'private')"
962
+ },
963
+ "chk_post_root_visibility_present": {
964
+ "name": "chk_post_root_visibility_present",
965
+ "value": "(\n \"post\".\"reply_to_id\" IS NULL\n AND \"post\".\"visibility\" IS NOT NULL\n ) OR (\n \"post\".\"reply_to_id\" IS NOT NULL\n AND \"post\".\"visibility\" IS NULL\n )"
966
+ },
967
+ "chk_post_reply_to_not_self": {
968
+ "name": "chk_post_reply_to_not_self",
969
+ "value": "\"post\".\"reply_to_id\" IS NULL OR \"post\".\"reply_to_id\" <> \"post\".\"id\""
970
+ },
971
+ "chk_post_thread_shape": {
972
+ "name": "chk_post_thread_shape",
973
+ "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 )"
974
+ },
975
+ "chk_post_reply_not_pinned": {
976
+ "name": "chk_post_reply_not_pinned",
977
+ "value": "\"post\".\"pinned_at\" IS NULL OR \"post\".\"reply_to_id\" IS NULL"
978
+ },
979
+ "chk_post_format_shape": {
980
+ "name": "chk_post_format_shape",
981
+ "value": "(\n \"post\".\"format\" = 'note'\n AND (\"post\".\"url\" IS NULL OR trim(\"post\".\"url\") = '')\n AND (\"post\".\"quote_text\" IS NULL OR trim(\"post\".\"quote_text\") = '')\n ) OR (\n \"post\".\"format\" = 'link'\n AND \"post\".\"url\" IS NOT NULL\n AND trim(\"post\".\"url\") <> ''\n AND (\"post\".\"quote_text\" IS NULL OR trim(\"post\".\"quote_text\") = '')\n ) OR (\n \"post\".\"format\" = 'quote'\n AND \"post\".\"quote_text\" IS NOT NULL\n AND trim(\"post\".\"quote_text\") <> ''\n )"
982
+ },
983
+ "chk_post_rating_range": {
984
+ "name": "chk_post_rating_range",
985
+ "value": "\"post\".\"rating\" IS NULL OR \"post\".\"rating\" BETWEEN 1 AND 5"
986
+ },
987
+ "chk_post_status_published_at": {
988
+ "name": "chk_post_status_published_at",
989
+ "value": "(\n \"post\".\"status\" = 'draft'\n AND \"post\".\"published_at\" IS NULL\n ) OR (\n \"post\".\"status\" = 'published'\n AND \"post\".\"published_at\" IS NOT NULL\n )"
990
+ }
991
+ }
992
+ },
993
+ "session": {
994
+ "name": "session",
995
+ "columns": {
996
+ "id": {
997
+ "name": "id",
998
+ "type": "text",
999
+ "primaryKey": true,
1000
+ "notNull": true,
1001
+ "autoincrement": false
1002
+ },
1003
+ "expires_at": {
1004
+ "name": "expires_at",
1005
+ "type": "integer",
1006
+ "primaryKey": false,
1007
+ "notNull": true,
1008
+ "autoincrement": false
1009
+ },
1010
+ "token": {
1011
+ "name": "token",
1012
+ "type": "text",
1013
+ "primaryKey": false,
1014
+ "notNull": true,
1015
+ "autoincrement": false
1016
+ },
1017
+ "created_at": {
1018
+ "name": "created_at",
1019
+ "type": "integer",
1020
+ "primaryKey": false,
1021
+ "notNull": true,
1022
+ "autoincrement": false
1023
+ },
1024
+ "updated_at": {
1025
+ "name": "updated_at",
1026
+ "type": "integer",
1027
+ "primaryKey": false,
1028
+ "notNull": true,
1029
+ "autoincrement": false
1030
+ },
1031
+ "ip_address": {
1032
+ "name": "ip_address",
1033
+ "type": "text",
1034
+ "primaryKey": false,
1035
+ "notNull": false,
1036
+ "autoincrement": false
1037
+ },
1038
+ "user_agent": {
1039
+ "name": "user_agent",
1040
+ "type": "text",
1041
+ "primaryKey": false,
1042
+ "notNull": false,
1043
+ "autoincrement": false
1044
+ },
1045
+ "user_id": {
1046
+ "name": "user_id",
1047
+ "type": "text",
1048
+ "primaryKey": false,
1049
+ "notNull": true,
1050
+ "autoincrement": false
1051
+ }
1052
+ },
1053
+ "indexes": {
1054
+ "session_token_unique": {
1055
+ "name": "session_token_unique",
1056
+ "columns": ["token"],
1057
+ "isUnique": true
1058
+ },
1059
+ "idx_session_user_id": {
1060
+ "name": "idx_session_user_id",
1061
+ "columns": ["user_id"],
1062
+ "isUnique": false
1063
+ }
1064
+ },
1065
+ "foreignKeys": {
1066
+ "session_user_id_user_id_fk": {
1067
+ "name": "session_user_id_user_id_fk",
1068
+ "tableFrom": "session",
1069
+ "columnsFrom": ["user_id"],
1070
+ "tableTo": "user",
1071
+ "columnsTo": ["id"],
1072
+ "onUpdate": "no action",
1073
+ "onDelete": "no action"
1074
+ }
1075
+ },
1076
+ "compositePrimaryKeys": {},
1077
+ "uniqueConstraints": {},
1078
+ "checkConstraints": {}
1079
+ },
1080
+ "setting": {
1081
+ "name": "setting",
1082
+ "columns": {
1083
+ "key": {
1084
+ "name": "key",
1085
+ "type": "text",
1086
+ "primaryKey": true,
1087
+ "notNull": true,
1088
+ "autoincrement": false
1089
+ },
1090
+ "value": {
1091
+ "name": "value",
1092
+ "type": "text",
1093
+ "primaryKey": false,
1094
+ "notNull": true,
1095
+ "autoincrement": false
1096
+ },
1097
+ "updated_at": {
1098
+ "name": "updated_at",
1099
+ "type": "integer",
1100
+ "primaryKey": false,
1101
+ "notNull": true,
1102
+ "autoincrement": false
1103
+ }
1104
+ },
1105
+ "indexes": {},
1106
+ "foreignKeys": {},
1107
+ "compositePrimaryKeys": {},
1108
+ "uniqueConstraints": {},
1109
+ "checkConstraints": {}
1110
+ },
1111
+ "sidebar_item": {
1112
+ "name": "sidebar_item",
1113
+ "columns": {
1114
+ "id": {
1115
+ "name": "id",
1116
+ "type": "text",
1117
+ "primaryKey": true,
1118
+ "notNull": true,
1119
+ "autoincrement": false
1120
+ },
1121
+ "type": {
1122
+ "name": "type",
1123
+ "type": "text",
1124
+ "primaryKey": false,
1125
+ "notNull": true,
1126
+ "autoincrement": false
1127
+ },
1128
+ "collection_id": {
1129
+ "name": "collection_id",
1130
+ "type": "text",
1131
+ "primaryKey": false,
1132
+ "notNull": false,
1133
+ "autoincrement": false
1134
+ },
1135
+ "position": {
1136
+ "name": "position",
1137
+ "type": "text",
1138
+ "primaryKey": false,
1139
+ "notNull": true,
1140
+ "autoincrement": false,
1141
+ "default": "'a0'"
1142
+ },
1143
+ "created_at": {
1144
+ "name": "created_at",
1145
+ "type": "integer",
1146
+ "primaryKey": false,
1147
+ "notNull": true,
1148
+ "autoincrement": false
1149
+ },
1150
+ "updated_at": {
1151
+ "name": "updated_at",
1152
+ "type": "integer",
1153
+ "primaryKey": false,
1154
+ "notNull": true,
1155
+ "autoincrement": false
1156
+ }
1157
+ },
1158
+ "indexes": {
1159
+ "idx_sidebar_item_collection_id": {
1160
+ "name": "idx_sidebar_item_collection_id",
1161
+ "columns": ["collection_id"],
1162
+ "isUnique": false
1163
+ },
1164
+ "uq_sidebar_item_position": {
1165
+ "name": "uq_sidebar_item_position",
1166
+ "columns": ["position"],
1167
+ "isUnique": true
1168
+ },
1169
+ "uq_sidebar_item_collection_once": {
1170
+ "name": "uq_sidebar_item_collection_once",
1171
+ "columns": ["collection_id"],
1172
+ "where": "\"sidebar_item\".\"type\" = 'collection' AND \"sidebar_item\".\"collection_id\" IS NOT NULL",
1173
+ "isUnique": true
1174
+ }
1175
+ },
1176
+ "foreignKeys": {
1177
+ "sidebar_item_collection_id_collection_id_fk": {
1178
+ "name": "sidebar_item_collection_id_collection_id_fk",
1179
+ "tableFrom": "sidebar_item",
1180
+ "columnsFrom": ["collection_id"],
1181
+ "tableTo": "collection",
1182
+ "columnsTo": ["id"],
1183
+ "onUpdate": "no action",
1184
+ "onDelete": "cascade"
1185
+ }
1186
+ },
1187
+ "compositePrimaryKeys": {},
1188
+ "uniqueConstraints": {},
1189
+ "checkConstraints": {
1190
+ "chk_sidebar_item_type": {
1191
+ "name": "chk_sidebar_item_type",
1192
+ "value": "\"sidebar_item\".\"type\" IN ('collection', 'divider')"
1193
+ },
1194
+ "chk_sidebar_item_shape": {
1195
+ "name": "chk_sidebar_item_shape",
1196
+ "value": "(\n \"sidebar_item\".\"type\" = 'collection' AND \"sidebar_item\".\"collection_id\" IS NOT NULL\n ) OR (\n \"sidebar_item\".\"type\" = 'divider' AND \"sidebar_item\".\"collection_id\" IS NULL\n )"
1197
+ }
1198
+ }
1199
+ },
1200
+ "user": {
1201
+ "name": "user",
1202
+ "columns": {
1203
+ "id": {
1204
+ "name": "id",
1205
+ "type": "text",
1206
+ "primaryKey": true,
1207
+ "notNull": true,
1208
+ "autoincrement": false
1209
+ },
1210
+ "name": {
1211
+ "name": "name",
1212
+ "type": "text",
1213
+ "primaryKey": false,
1214
+ "notNull": true,
1215
+ "autoincrement": false
1216
+ },
1217
+ "email": {
1218
+ "name": "email",
1219
+ "type": "text",
1220
+ "primaryKey": false,
1221
+ "notNull": true,
1222
+ "autoincrement": false
1223
+ },
1224
+ "email_verified": {
1225
+ "name": "email_verified",
1226
+ "type": "integer",
1227
+ "primaryKey": false,
1228
+ "notNull": true,
1229
+ "autoincrement": false,
1230
+ "default": false
1231
+ },
1232
+ "image": {
1233
+ "name": "image",
1234
+ "type": "text",
1235
+ "primaryKey": false,
1236
+ "notNull": false,
1237
+ "autoincrement": false
1238
+ },
1239
+ "role": {
1240
+ "name": "role",
1241
+ "type": "text",
1242
+ "primaryKey": false,
1243
+ "notNull": false,
1244
+ "autoincrement": false,
1245
+ "default": "'member'"
1246
+ },
1247
+ "created_at": {
1248
+ "name": "created_at",
1249
+ "type": "integer",
1250
+ "primaryKey": false,
1251
+ "notNull": true,
1252
+ "autoincrement": false
1253
+ },
1254
+ "updated_at": {
1255
+ "name": "updated_at",
1256
+ "type": "integer",
1257
+ "primaryKey": false,
1258
+ "notNull": true,
1259
+ "autoincrement": false
1260
+ }
1261
+ },
1262
+ "indexes": {
1263
+ "user_email_unique": {
1264
+ "name": "user_email_unique",
1265
+ "columns": ["email"],
1266
+ "isUnique": true
1267
+ }
1268
+ },
1269
+ "foreignKeys": {},
1270
+ "compositePrimaryKeys": {},
1271
+ "uniqueConstraints": {},
1272
+ "checkConstraints": {}
1273
+ },
1274
+ "verification": {
1275
+ "name": "verification",
1276
+ "columns": {
1277
+ "id": {
1278
+ "name": "id",
1279
+ "type": "text",
1280
+ "primaryKey": true,
1281
+ "notNull": true,
1282
+ "autoincrement": false
1283
+ },
1284
+ "identifier": {
1285
+ "name": "identifier",
1286
+ "type": "text",
1287
+ "primaryKey": false,
1288
+ "notNull": true,
1289
+ "autoincrement": false
1290
+ },
1291
+ "value": {
1292
+ "name": "value",
1293
+ "type": "text",
1294
+ "primaryKey": false,
1295
+ "notNull": true,
1296
+ "autoincrement": false
1297
+ },
1298
+ "expires_at": {
1299
+ "name": "expires_at",
1300
+ "type": "integer",
1301
+ "primaryKey": false,
1302
+ "notNull": true,
1303
+ "autoincrement": false
1304
+ },
1305
+ "created_at": {
1306
+ "name": "created_at",
1307
+ "type": "integer",
1308
+ "primaryKey": false,
1309
+ "notNull": false,
1310
+ "autoincrement": false
1311
+ },
1312
+ "updated_at": {
1313
+ "name": "updated_at",
1314
+ "type": "integer",
1315
+ "primaryKey": false,
1316
+ "notNull": false,
1317
+ "autoincrement": false
1318
+ }
1319
+ },
1320
+ "indexes": {},
1321
+ "foreignKeys": {},
1322
+ "compositePrimaryKeys": {},
1323
+ "uniqueConstraints": {},
1324
+ "checkConstraints": {}
1325
+ }
1326
+ },
1327
+ "views": {},
1328
+ "enums": {},
1329
+ "_meta": {
1330
+ "columns": {},
1331
+ "schemas": {},
1332
+ "tables": {}
1333
+ },
1334
+ "internal": {
1335
+ "indexes": {}
1336
+ }
1337
+ }