@0x0501/mystack 0.0.0-stage → 0.1.0-bootstrap.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 (211) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -2
  3. package/assets/auth.sqlite.schema.ts +479 -0
  4. package/assets/bun-sqlite.test.ts +46 -0
  5. package/assets/d1.test.ts +41 -0
  6. package/assets/drizzle.config.ts +2 -0
  7. package/assets/generate-auth-schema.mjs +25 -0
  8. package/assets/platform.sqlite.schema.ts +46 -0
  9. package/assets/polar-checkout.ts +10 -0
  10. package/assets/polar-route.ts +19 -0
  11. package/assets/polar.test.ts +30 -0
  12. package/assets/polar.ts +12 -0
  13. package/assets/purchase.bun-sqlite.ts +38 -0
  14. package/assets/purchase.sqlite.ts +39 -0
  15. package/assets/sqlite-migrations/0000_thin_phalanx.sql +295 -0
  16. package/assets/sqlite-migrations/meta/0000_snapshot.json +2058 -0
  17. package/assets/sqlite-migrations/meta/_journal.json +13 -0
  18. package/assets/turso.test.ts +40 -0
  19. package/package.json +44 -5
  20. package/src/adapters/database.mjs +448 -0
  21. package/src/adapters/deployment.mjs +101 -0
  22. package/src/adapters/email.mjs +75 -0
  23. package/src/adapters/payments.mjs +270 -0
  24. package/src/catalog.mjs +128 -0
  25. package/src/cli.mjs +294 -0
  26. package/src/generate.mjs +183 -0
  27. package/src/template.mjs +93 -0
  28. package/template/.env.docker +16 -0
  29. package/template/.env.example +67 -0
  30. package/template/DESIGN.md +58 -0
  31. package/template/LICENSE +21 -0
  32. package/template/biome.json +46 -0
  33. package/template/docker-compose.yml +47 -0
  34. package/template/docs/project-guide.md +61 -0
  35. package/template/drizzle/0000_create-app-role.sql +54 -0
  36. package/template/drizzle/0001_add-rls-context.sql +21 -0
  37. package/template/drizzle/0002_platform_tables.sql +320 -0
  38. package/template/drizzle/meta/0002_snapshot.json +2125 -0
  39. package/template/drizzle/meta/_journal.json +27 -0
  40. package/template/drizzle.config.ts +25 -0
  41. package/template/e2e/authenticated-ui.spec.ts +40 -0
  42. package/template/e2e/headless-design.spec.ts +66 -0
  43. package/template/e2e/navigation-loading.spec.ts +70 -0
  44. package/template/e2e/theme-responsive.spec.ts +260 -0
  45. package/template/gitignore +24 -0
  46. package/template/messages/de.json +212 -0
  47. package/template/messages/en.json +212 -0
  48. package/template/package.json +101 -0
  49. package/template/paraglide.config.ts +49 -0
  50. package/template/playwright.config.ts +58 -0
  51. package/template/project.inlang/settings.json +12 -0
  52. package/template/public/drizzle.svg +1 -0
  53. package/template/public/favicon.ico +0 -0
  54. package/template/public/logo192.png +0 -0
  55. package/template/public/logo512.png +0 -0
  56. package/template/public/manifest.json +25 -0
  57. package/template/public/robots.txt +3 -0
  58. package/template/scripts/check-client-bundle.ts +150 -0
  59. package/template/scripts/check-server-fns.ts +290 -0
  60. package/template/scripts/check-sql-raw.ts +50 -0
  61. package/template/scripts/compile-paraglide.ts +12 -0
  62. package/template/scripts/postgres/README.md +76 -0
  63. package/template/scripts/postgres/create-app-role.sh +60 -0
  64. package/template/scripts/seed-local.ts +331 -0
  65. package/template/scripts/validate-prod-env.ts +53 -0
  66. package/template/src/__tests__/README.md +9 -0
  67. package/template/src/__tests__/account-security.test.ts +664 -0
  68. package/template/src/__tests__/admin-http-surface.test.ts +311 -0
  69. package/template/src/__tests__/admin-peer-protection.test.ts +178 -0
  70. package/template/src/__tests__/auth-harness.ts +104 -0
  71. package/template/src/__tests__/auth-rate-limit.test.ts +43 -0
  72. package/template/src/__tests__/auth-redirect.test.ts +120 -0
  73. package/template/src/__tests__/body-limit.test.ts +47 -0
  74. package/template/src/__tests__/creem.test.ts +62 -0
  75. package/template/src/__tests__/demo-checkout.test.ts +141 -0
  76. package/template/src/__tests__/email-locale.test.ts +110 -0
  77. package/template/src/__tests__/global-setup.ts +80 -0
  78. package/template/src/__tests__/input-rules.test.ts +0 -0
  79. package/template/src/__tests__/message-parity.test.ts +38 -0
  80. package/template/src/__tests__/navigation-loading.test.tsx +252 -0
  81. package/template/src/__tests__/nowpayments.test.ts +106 -0
  82. package/template/src/__tests__/paraglide-url-contract.test.ts +87 -0
  83. package/template/src/__tests__/purchase-fulfillment.test.ts +204 -0
  84. package/template/src/__tests__/query-unauthorized-redirect.test.ts +95 -0
  85. package/template/src/__tests__/rls-policy.test.ts +120 -0
  86. package/template/src/__tests__/same-page-locale-href.test.ts +47 -0
  87. package/template/src/__tests__/search-params-oauth.test.ts +57 -0
  88. package/template/src/__tests__/security-headers.test.ts +12 -0
  89. package/template/src/__tests__/server-fn-error-contract.test.ts +173 -0
  90. package/template/src/__tests__/stripe.test.ts +84 -0
  91. package/template/src/__tests__/test-db.ts +32 -0
  92. package/template/src/__tests__/test-rls-db.ts +23 -0
  93. package/template/src/__tests__/user-update-guard.test.ts +109 -0
  94. package/template/src/components/LocaleSwitcher.tsx +79 -0
  95. package/template/src/components/ThemeToggle.tsx +47 -0
  96. package/template/src/components/auth/social.tsx +90 -0
  97. package/template/src/components/auth/turnstile.tsx +67 -0
  98. package/template/src/components/root/navigation-progress.tsx +32 -0
  99. package/template/src/components/root/not-found.tsx +20 -0
  100. package/template/src/components/root/pending.tsx +9 -0
  101. package/template/src/components/root/root-document.tsx +37 -0
  102. package/template/src/components/root/root-error.tsx +34 -0
  103. package/template/src/components/shells.tsx +201 -0
  104. package/template/src/components/ui/styles.ts +9 -0
  105. package/template/src/db/auth.schema.ts +455 -0
  106. package/template/src/db/helper.ts +38 -0
  107. package/template/src/db/index.ts +15 -0
  108. package/template/src/db/platform.schema.ts +122 -0
  109. package/template/src/db/schema.ts +2 -0
  110. package/template/src/env.ts +65 -0
  111. package/template/src/hooks/use-theme.ts +32 -0
  112. package/template/src/integrations/better-auth/header-user.tsx +36 -0
  113. package/template/src/integrations/better-auth/session-query.ts +11 -0
  114. package/template/src/integrations/react-email/PasswordOtpEmail.tsx +62 -0
  115. package/template/src/integrations/react-email/ResetPasswordEmail.tsx +64 -0
  116. package/template/src/integrations/react-email/VerifyEmail.tsx +72 -0
  117. package/template/src/integrations/react-email/theme.ts +75 -0
  118. package/template/src/integrations/tanstack-query/devtools.tsx +6 -0
  119. package/template/src/integrations/tanstack-query/root-provider.tsx +60 -0
  120. package/template/src/lib/auth-client.ts +27 -0
  121. package/template/src/lib/auth-paths.ts +94 -0
  122. package/template/src/lib/auth-plugins/existing-email-signup.ts +86 -0
  123. package/template/src/lib/auth-plugins/field-rules.ts +84 -0
  124. package/template/src/lib/auth-plugins/social-two-factor.ts +194 -0
  125. package/template/src/lib/auth-timing.ts +9 -0
  126. package/template/src/lib/auth.ts +279 -0
  127. package/template/src/lib/captcha.ts +11 -0
  128. package/template/src/lib/email.tsx +162 -0
  129. package/template/src/lib/github.ts +18 -0
  130. package/template/src/lib/locale-cookie.ts +12 -0
  131. package/template/src/lib/localized-pages.ts +25 -0
  132. package/template/src/lib/oauth-metadata.ts +19 -0
  133. package/template/src/lib/permissions.ts +29 -0
  134. package/template/src/lib/security-headers.ts +20 -0
  135. package/template/src/lib/site.ts +59 -0
  136. package/template/src/lib/theme.ts +42 -0
  137. package/template/src/lib/user-update-guard.ts +35 -0
  138. package/template/src/middlewares/admin.ts +46 -0
  139. package/template/src/middlewares/auth-rate-limit.ts +37 -0
  140. package/template/src/middlewares/better-auth.ts +15 -0
  141. package/template/src/middlewares/body-limit.ts +62 -0
  142. package/template/src/middlewares/database.ts +13 -0
  143. package/template/src/middlewares/protected.ts +45 -0
  144. package/template/src/routeTree.gen.ts +536 -0
  145. package/template/src/router.tsx +53 -0
  146. package/template/src/routes/[.]well-known/oauth-authorization-server/api/auth.ts +18 -0
  147. package/template/src/routes/[.]well-known/oauth-protected-resource/index.ts +32 -0
  148. package/template/src/routes/__root.tsx +175 -0
  149. package/template/src/routes/admin/audit.tsx +74 -0
  150. package/template/src/routes/admin/index.tsx +7 -0
  151. package/template/src/routes/admin/oauth-apps.tsx +164 -0
  152. package/template/src/routes/admin/route.tsx +27 -0
  153. package/template/src/routes/admin/users.tsx +215 -0
  154. package/template/src/routes/api/auth/$.ts +14 -0
  155. package/template/src/routes/api/auth/[.]well-known/openid-configuration.ts +15 -0
  156. package/template/src/routes/api/webhooks/creem.ts +69 -0
  157. package/template/src/routes/api/webhooks/nowpayments.ts +62 -0
  158. package/template/src/routes/api/webhooks/stripe.ts +74 -0
  159. package/template/src/routes/dashboard/account.tsx +430 -0
  160. package/template/src/routes/dashboard/index.tsx +128 -0
  161. package/template/src/routes/dashboard/route.tsx +17 -0
  162. package/template/src/routes/forgot-password.tsx +65 -0
  163. package/template/src/routes/index.tsx +85 -0
  164. package/template/src/routes/oauth/consent.tsx +77 -0
  165. package/template/src/routes/reset-password.tsx +78 -0
  166. package/template/src/routes/sign-in.tsx +174 -0
  167. package/template/src/routes/sign-up.tsx +135 -0
  168. package/template/src/routes/two-factor.tsx +74 -0
  169. package/template/src/server/README.md +3 -0
  170. package/template/src/server/account-security.ts +163 -0
  171. package/template/src/server/admin-audit.ts +37 -0
  172. package/template/src/server/admin-users.ts +112 -0
  173. package/template/src/server/auth.ts +44 -0
  174. package/template/src/server/demo-checkout.ts +67 -0
  175. package/template/src/server/oauth-clients.ts +83 -0
  176. package/template/src/server/payment-toggles.ts +39 -0
  177. package/template/src/server.ts +20 -0
  178. package/template/src/services/README.md +3 -0
  179. package/template/src/services/account-security.ts +893 -0
  180. package/template/src/services/admin-security.ts +164 -0
  181. package/template/src/services/admin-users.ts +181 -0
  182. package/template/src/services/auth-rate-limit.ts +32 -0
  183. package/template/src/services/creem.ts +83 -0
  184. package/template/src/services/demo-checkout.ts +100 -0
  185. package/template/src/services/nowpayments.ts +154 -0
  186. package/template/src/services/oauth-client.ts +85 -0
  187. package/template/src/services/oauth-clients.ts +15 -0
  188. package/template/src/services/payment-providers.ts +157 -0
  189. package/template/src/services/payment-toggles.ts +48 -0
  190. package/template/src/services/purchase.ts +233 -0
  191. package/template/src/services/stripe.ts +106 -0
  192. package/template/src/start.ts +35 -0
  193. package/template/src/styles/layout.css +93 -0
  194. package/template/src/styles/theme.css +84 -0
  195. package/template/src/styles/ui.css +233 -0
  196. package/template/src/styles.css +90 -0
  197. package/template/src/utils/api-error.ts +129 -0
  198. package/template/src/utils/auth-errors.ts +157 -0
  199. package/template/src/utils/auth-redirect.ts +61 -0
  200. package/template/src/utils/body-limit.ts +84 -0
  201. package/template/src/utils/cn.ts +6 -0
  202. package/template/src/utils/input-rules.ts +172 -0
  203. package/template/src/utils/locale-paths.ts +18 -0
  204. package/template/src/utils/same-page-locale-href.ts +20 -0
  205. package/template/src/utils/search-params.ts +71 -0
  206. package/template/tsconfig.json +30 -0
  207. package/template/tsr.config.json +6 -0
  208. package/template/vite.config.ts +24 -0
  209. package/template/vitest.config.ts +26 -0
  210. package/template/worker-configuration.d.ts +14660 -0
  211. package/template/wrangler.jsonc +39 -0
@@ -0,0 +1,2125 @@
1
+ {
2
+ "id": "54da3e01-2a37-4490-83f8-3f9f2e7714ad",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
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",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "refresh_token_expires_at": {
60
+ "name": "refresh_token_expires_at",
61
+ "type": "timestamp",
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",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true
89
+ }
90
+ },
91
+ "indexes": {
92
+ "account_userId_idx": {
93
+ "name": "account_userId_idx",
94
+ "columns": [
95
+ {
96
+ "expression": "user_id",
97
+ "isExpression": false,
98
+ "asc": true,
99
+ "nulls": "last"
100
+ }
101
+ ],
102
+ "isUnique": false,
103
+ "concurrently": false,
104
+ "method": "btree",
105
+ "with": {}
106
+ }
107
+ },
108
+ "foreignKeys": {
109
+ "account_user_id_user_id_fk": {
110
+ "name": "account_user_id_user_id_fk",
111
+ "tableFrom": "account",
112
+ "tableTo": "user",
113
+ "columnsFrom": [
114
+ "user_id"
115
+ ],
116
+ "columnsTo": [
117
+ "id"
118
+ ],
119
+ "onDelete": "cascade",
120
+ "onUpdate": "no action"
121
+ }
122
+ },
123
+ "compositePrimaryKeys": {},
124
+ "uniqueConstraints": {},
125
+ "policies": {},
126
+ "checkConstraints": {},
127
+ "isRLSEnabled": false
128
+ },
129
+ "public.jwks": {
130
+ "name": "jwks",
131
+ "schema": "",
132
+ "columns": {
133
+ "id": {
134
+ "name": "id",
135
+ "type": "text",
136
+ "primaryKey": true,
137
+ "notNull": true
138
+ },
139
+ "public_key": {
140
+ "name": "public_key",
141
+ "type": "text",
142
+ "primaryKey": false,
143
+ "notNull": true
144
+ },
145
+ "private_key": {
146
+ "name": "private_key",
147
+ "type": "text",
148
+ "primaryKey": false,
149
+ "notNull": true
150
+ },
151
+ "created_at": {
152
+ "name": "created_at",
153
+ "type": "timestamp",
154
+ "primaryKey": false,
155
+ "notNull": true
156
+ },
157
+ "expires_at": {
158
+ "name": "expires_at",
159
+ "type": "timestamp",
160
+ "primaryKey": false,
161
+ "notNull": false
162
+ },
163
+ "alg": {
164
+ "name": "alg",
165
+ "type": "text",
166
+ "primaryKey": false,
167
+ "notNull": false
168
+ },
169
+ "crv": {
170
+ "name": "crv",
171
+ "type": "text",
172
+ "primaryKey": false,
173
+ "notNull": false
174
+ }
175
+ },
176
+ "indexes": {},
177
+ "foreignKeys": {},
178
+ "compositePrimaryKeys": {},
179
+ "uniqueConstraints": {},
180
+ "policies": {},
181
+ "checkConstraints": {},
182
+ "isRLSEnabled": false
183
+ },
184
+ "public.oauth_access_token": {
185
+ "name": "oauth_access_token",
186
+ "schema": "",
187
+ "columns": {
188
+ "id": {
189
+ "name": "id",
190
+ "type": "text",
191
+ "primaryKey": true,
192
+ "notNull": true
193
+ },
194
+ "token": {
195
+ "name": "token",
196
+ "type": "text",
197
+ "primaryKey": false,
198
+ "notNull": true
199
+ },
200
+ "client_id": {
201
+ "name": "client_id",
202
+ "type": "text",
203
+ "primaryKey": false,
204
+ "notNull": true
205
+ },
206
+ "session_id": {
207
+ "name": "session_id",
208
+ "type": "text",
209
+ "primaryKey": false,
210
+ "notNull": false
211
+ },
212
+ "user_id": {
213
+ "name": "user_id",
214
+ "type": "text",
215
+ "primaryKey": false,
216
+ "notNull": false
217
+ },
218
+ "reference_id": {
219
+ "name": "reference_id",
220
+ "type": "text",
221
+ "primaryKey": false,
222
+ "notNull": false
223
+ },
224
+ "authorization_code_id": {
225
+ "name": "authorization_code_id",
226
+ "type": "text",
227
+ "primaryKey": false,
228
+ "notNull": false
229
+ },
230
+ "resources": {
231
+ "name": "resources",
232
+ "type": "text[]",
233
+ "primaryKey": false,
234
+ "notNull": false
235
+ },
236
+ "requested_user_info_claims": {
237
+ "name": "requested_user_info_claims",
238
+ "type": "text[]",
239
+ "primaryKey": false,
240
+ "notNull": false
241
+ },
242
+ "refresh_id": {
243
+ "name": "refresh_id",
244
+ "type": "text",
245
+ "primaryKey": false,
246
+ "notNull": false
247
+ },
248
+ "expires_at": {
249
+ "name": "expires_at",
250
+ "type": "timestamp",
251
+ "primaryKey": false,
252
+ "notNull": true
253
+ },
254
+ "created_at": {
255
+ "name": "created_at",
256
+ "type": "timestamp",
257
+ "primaryKey": false,
258
+ "notNull": true
259
+ },
260
+ "revoked": {
261
+ "name": "revoked",
262
+ "type": "timestamp",
263
+ "primaryKey": false,
264
+ "notNull": false
265
+ },
266
+ "confirmation": {
267
+ "name": "confirmation",
268
+ "type": "jsonb",
269
+ "primaryKey": false,
270
+ "notNull": false
271
+ },
272
+ "scopes": {
273
+ "name": "scopes",
274
+ "type": "text[]",
275
+ "primaryKey": false,
276
+ "notNull": true
277
+ }
278
+ },
279
+ "indexes": {
280
+ "oauthAccessToken_clientId_idx": {
281
+ "name": "oauthAccessToken_clientId_idx",
282
+ "columns": [
283
+ {
284
+ "expression": "client_id",
285
+ "isExpression": false,
286
+ "asc": true,
287
+ "nulls": "last"
288
+ }
289
+ ],
290
+ "isUnique": false,
291
+ "concurrently": false,
292
+ "method": "btree",
293
+ "with": {}
294
+ },
295
+ "oauthAccessToken_sessionId_idx": {
296
+ "name": "oauthAccessToken_sessionId_idx",
297
+ "columns": [
298
+ {
299
+ "expression": "session_id",
300
+ "isExpression": false,
301
+ "asc": true,
302
+ "nulls": "last"
303
+ }
304
+ ],
305
+ "isUnique": false,
306
+ "concurrently": false,
307
+ "method": "btree",
308
+ "with": {}
309
+ },
310
+ "oauthAccessToken_userId_idx": {
311
+ "name": "oauthAccessToken_userId_idx",
312
+ "columns": [
313
+ {
314
+ "expression": "user_id",
315
+ "isExpression": false,
316
+ "asc": true,
317
+ "nulls": "last"
318
+ }
319
+ ],
320
+ "isUnique": false,
321
+ "concurrently": false,
322
+ "method": "btree",
323
+ "with": {}
324
+ },
325
+ "oauthAccessToken_authorizationCodeId_idx": {
326
+ "name": "oauthAccessToken_authorizationCodeId_idx",
327
+ "columns": [
328
+ {
329
+ "expression": "authorization_code_id",
330
+ "isExpression": false,
331
+ "asc": true,
332
+ "nulls": "last"
333
+ }
334
+ ],
335
+ "isUnique": false,
336
+ "concurrently": false,
337
+ "method": "btree",
338
+ "with": {}
339
+ },
340
+ "oauthAccessToken_refreshId_idx": {
341
+ "name": "oauthAccessToken_refreshId_idx",
342
+ "columns": [
343
+ {
344
+ "expression": "refresh_id",
345
+ "isExpression": false,
346
+ "asc": true,
347
+ "nulls": "last"
348
+ }
349
+ ],
350
+ "isUnique": false,
351
+ "concurrently": false,
352
+ "method": "btree",
353
+ "with": {}
354
+ }
355
+ },
356
+ "foreignKeys": {
357
+ "oauth_access_token_client_id_oauth_client_client_id_fk": {
358
+ "name": "oauth_access_token_client_id_oauth_client_client_id_fk",
359
+ "tableFrom": "oauth_access_token",
360
+ "tableTo": "oauth_client",
361
+ "columnsFrom": [
362
+ "client_id"
363
+ ],
364
+ "columnsTo": [
365
+ "client_id"
366
+ ],
367
+ "onDelete": "cascade",
368
+ "onUpdate": "no action"
369
+ },
370
+ "oauth_access_token_session_id_session_id_fk": {
371
+ "name": "oauth_access_token_session_id_session_id_fk",
372
+ "tableFrom": "oauth_access_token",
373
+ "tableTo": "session",
374
+ "columnsFrom": [
375
+ "session_id"
376
+ ],
377
+ "columnsTo": [
378
+ "id"
379
+ ],
380
+ "onDelete": "set null",
381
+ "onUpdate": "no action"
382
+ },
383
+ "oauth_access_token_user_id_user_id_fk": {
384
+ "name": "oauth_access_token_user_id_user_id_fk",
385
+ "tableFrom": "oauth_access_token",
386
+ "tableTo": "user",
387
+ "columnsFrom": [
388
+ "user_id"
389
+ ],
390
+ "columnsTo": [
391
+ "id"
392
+ ],
393
+ "onDelete": "cascade",
394
+ "onUpdate": "no action"
395
+ },
396
+ "oauth_access_token_refresh_id_oauth_refresh_token_id_fk": {
397
+ "name": "oauth_access_token_refresh_id_oauth_refresh_token_id_fk",
398
+ "tableFrom": "oauth_access_token",
399
+ "tableTo": "oauth_refresh_token",
400
+ "columnsFrom": [
401
+ "refresh_id"
402
+ ],
403
+ "columnsTo": [
404
+ "id"
405
+ ],
406
+ "onDelete": "cascade",
407
+ "onUpdate": "no action"
408
+ }
409
+ },
410
+ "compositePrimaryKeys": {},
411
+ "uniqueConstraints": {
412
+ "oauth_access_token_token_unique": {
413
+ "name": "oauth_access_token_token_unique",
414
+ "nullsNotDistinct": false,
415
+ "columns": [
416
+ "token"
417
+ ]
418
+ }
419
+ },
420
+ "policies": {},
421
+ "checkConstraints": {},
422
+ "isRLSEnabled": false
423
+ },
424
+ "public.oauth_client": {
425
+ "name": "oauth_client",
426
+ "schema": "",
427
+ "columns": {
428
+ "id": {
429
+ "name": "id",
430
+ "type": "text",
431
+ "primaryKey": true,
432
+ "notNull": true
433
+ },
434
+ "client_id": {
435
+ "name": "client_id",
436
+ "type": "text",
437
+ "primaryKey": false,
438
+ "notNull": true
439
+ },
440
+ "client_secret": {
441
+ "name": "client_secret",
442
+ "type": "text",
443
+ "primaryKey": false,
444
+ "notNull": false
445
+ },
446
+ "client_discovery_id": {
447
+ "name": "client_discovery_id",
448
+ "type": "text",
449
+ "primaryKey": false,
450
+ "notNull": false
451
+ },
452
+ "disabled": {
453
+ "name": "disabled",
454
+ "type": "boolean",
455
+ "primaryKey": false,
456
+ "notNull": false,
457
+ "default": false
458
+ },
459
+ "skip_consent": {
460
+ "name": "skip_consent",
461
+ "type": "boolean",
462
+ "primaryKey": false,
463
+ "notNull": false
464
+ },
465
+ "enable_end_session": {
466
+ "name": "enable_end_session",
467
+ "type": "boolean",
468
+ "primaryKey": false,
469
+ "notNull": false
470
+ },
471
+ "subject_type": {
472
+ "name": "subject_type",
473
+ "type": "text",
474
+ "primaryKey": false,
475
+ "notNull": false
476
+ },
477
+ "scopes": {
478
+ "name": "scopes",
479
+ "type": "text[]",
480
+ "primaryKey": false,
481
+ "notNull": false
482
+ },
483
+ "client_credentials_scopes": {
484
+ "name": "client_credentials_scopes",
485
+ "type": "text[]",
486
+ "primaryKey": false,
487
+ "notNull": false,
488
+ "default": "'{}'"
489
+ },
490
+ "user_id": {
491
+ "name": "user_id",
492
+ "type": "text",
493
+ "primaryKey": false,
494
+ "notNull": false
495
+ },
496
+ "created_at": {
497
+ "name": "created_at",
498
+ "type": "timestamp",
499
+ "primaryKey": false,
500
+ "notNull": false
501
+ },
502
+ "updated_at": {
503
+ "name": "updated_at",
504
+ "type": "timestamp",
505
+ "primaryKey": false,
506
+ "notNull": false
507
+ },
508
+ "name": {
509
+ "name": "name",
510
+ "type": "text",
511
+ "primaryKey": false,
512
+ "notNull": false
513
+ },
514
+ "uri": {
515
+ "name": "uri",
516
+ "type": "text",
517
+ "primaryKey": false,
518
+ "notNull": false
519
+ },
520
+ "icon": {
521
+ "name": "icon",
522
+ "type": "text",
523
+ "primaryKey": false,
524
+ "notNull": false
525
+ },
526
+ "contacts": {
527
+ "name": "contacts",
528
+ "type": "text[]",
529
+ "primaryKey": false,
530
+ "notNull": false
531
+ },
532
+ "tos": {
533
+ "name": "tos",
534
+ "type": "text",
535
+ "primaryKey": false,
536
+ "notNull": false
537
+ },
538
+ "policy": {
539
+ "name": "policy",
540
+ "type": "text",
541
+ "primaryKey": false,
542
+ "notNull": false
543
+ },
544
+ "software_id": {
545
+ "name": "software_id",
546
+ "type": "text",
547
+ "primaryKey": false,
548
+ "notNull": false
549
+ },
550
+ "software_version": {
551
+ "name": "software_version",
552
+ "type": "text",
553
+ "primaryKey": false,
554
+ "notNull": false
555
+ },
556
+ "software_statement": {
557
+ "name": "software_statement",
558
+ "type": "text",
559
+ "primaryKey": false,
560
+ "notNull": false
561
+ },
562
+ "redirect_uris": {
563
+ "name": "redirect_uris",
564
+ "type": "text[]",
565
+ "primaryKey": false,
566
+ "notNull": true
567
+ },
568
+ "post_logout_redirect_uris": {
569
+ "name": "post_logout_redirect_uris",
570
+ "type": "text[]",
571
+ "primaryKey": false,
572
+ "notNull": false
573
+ },
574
+ "backchannel_logout_uri": {
575
+ "name": "backchannel_logout_uri",
576
+ "type": "text",
577
+ "primaryKey": false,
578
+ "notNull": false
579
+ },
580
+ "backchannel_logout_session_required": {
581
+ "name": "backchannel_logout_session_required",
582
+ "type": "boolean",
583
+ "primaryKey": false,
584
+ "notNull": false
585
+ },
586
+ "token_endpoint_auth_method": {
587
+ "name": "token_endpoint_auth_method",
588
+ "type": "text",
589
+ "primaryKey": false,
590
+ "notNull": false
591
+ },
592
+ "application_type": {
593
+ "name": "application_type",
594
+ "type": "text",
595
+ "primaryKey": false,
596
+ "notNull": false
597
+ },
598
+ "jwks": {
599
+ "name": "jwks",
600
+ "type": "text",
601
+ "primaryKey": false,
602
+ "notNull": false
603
+ },
604
+ "jwks_uri": {
605
+ "name": "jwks_uri",
606
+ "type": "text",
607
+ "primaryKey": false,
608
+ "notNull": false
609
+ },
610
+ "grant_types": {
611
+ "name": "grant_types",
612
+ "type": "text[]",
613
+ "primaryKey": false,
614
+ "notNull": false
615
+ },
616
+ "response_types": {
617
+ "name": "response_types",
618
+ "type": "text[]",
619
+ "primaryKey": false,
620
+ "notNull": false
621
+ },
622
+ "require_pkce": {
623
+ "name": "require_pkce",
624
+ "type": "boolean",
625
+ "primaryKey": false,
626
+ "notNull": false
627
+ },
628
+ "dpop_bound_access_tokens": {
629
+ "name": "dpop_bound_access_tokens",
630
+ "type": "boolean",
631
+ "primaryKey": false,
632
+ "notNull": false,
633
+ "default": false
634
+ },
635
+ "reference_id": {
636
+ "name": "reference_id",
637
+ "type": "text",
638
+ "primaryKey": false,
639
+ "notNull": false
640
+ },
641
+ "metadata": {
642
+ "name": "metadata",
643
+ "type": "jsonb",
644
+ "primaryKey": false,
645
+ "notNull": false
646
+ }
647
+ },
648
+ "indexes": {
649
+ "oauthClient_userId_idx": {
650
+ "name": "oauthClient_userId_idx",
651
+ "columns": [
652
+ {
653
+ "expression": "user_id",
654
+ "isExpression": false,
655
+ "asc": true,
656
+ "nulls": "last"
657
+ }
658
+ ],
659
+ "isUnique": false,
660
+ "concurrently": false,
661
+ "method": "btree",
662
+ "with": {}
663
+ }
664
+ },
665
+ "foreignKeys": {
666
+ "oauth_client_user_id_user_id_fk": {
667
+ "name": "oauth_client_user_id_user_id_fk",
668
+ "tableFrom": "oauth_client",
669
+ "tableTo": "user",
670
+ "columnsFrom": [
671
+ "user_id"
672
+ ],
673
+ "columnsTo": [
674
+ "id"
675
+ ],
676
+ "onDelete": "cascade",
677
+ "onUpdate": "no action"
678
+ }
679
+ },
680
+ "compositePrimaryKeys": {},
681
+ "uniqueConstraints": {
682
+ "oauth_client_client_id_unique": {
683
+ "name": "oauth_client_client_id_unique",
684
+ "nullsNotDistinct": false,
685
+ "columns": [
686
+ "client_id"
687
+ ]
688
+ }
689
+ },
690
+ "policies": {},
691
+ "checkConstraints": {},
692
+ "isRLSEnabled": false
693
+ },
694
+ "public.oauth_client_assertion": {
695
+ "name": "oauth_client_assertion",
696
+ "schema": "",
697
+ "columns": {
698
+ "id": {
699
+ "name": "id",
700
+ "type": "text",
701
+ "primaryKey": true,
702
+ "notNull": true
703
+ },
704
+ "expires_at": {
705
+ "name": "expires_at",
706
+ "type": "timestamp",
707
+ "primaryKey": false,
708
+ "notNull": true
709
+ }
710
+ },
711
+ "indexes": {},
712
+ "foreignKeys": {},
713
+ "compositePrimaryKeys": {},
714
+ "uniqueConstraints": {},
715
+ "policies": {},
716
+ "checkConstraints": {},
717
+ "isRLSEnabled": false
718
+ },
719
+ "public.oauth_client_resource": {
720
+ "name": "oauth_client_resource",
721
+ "schema": "",
722
+ "columns": {
723
+ "id": {
724
+ "name": "id",
725
+ "type": "text",
726
+ "primaryKey": true,
727
+ "notNull": true
728
+ },
729
+ "client_id": {
730
+ "name": "client_id",
731
+ "type": "text",
732
+ "primaryKey": false,
733
+ "notNull": true
734
+ },
735
+ "resource_id": {
736
+ "name": "resource_id",
737
+ "type": "text",
738
+ "primaryKey": false,
739
+ "notNull": true
740
+ },
741
+ "metadata": {
742
+ "name": "metadata",
743
+ "type": "jsonb",
744
+ "primaryKey": false,
745
+ "notNull": false
746
+ },
747
+ "created_at": {
748
+ "name": "created_at",
749
+ "type": "timestamp",
750
+ "primaryKey": false,
751
+ "notNull": false
752
+ }
753
+ },
754
+ "indexes": {
755
+ "oauthClientResource_clientId_resourceId_uidx": {
756
+ "name": "oauthClientResource_clientId_resourceId_uidx",
757
+ "columns": [
758
+ {
759
+ "expression": "client_id",
760
+ "isExpression": false,
761
+ "asc": true,
762
+ "nulls": "last"
763
+ },
764
+ {
765
+ "expression": "resource_id",
766
+ "isExpression": false,
767
+ "asc": true,
768
+ "nulls": "last"
769
+ }
770
+ ],
771
+ "isUnique": true,
772
+ "concurrently": false,
773
+ "method": "btree",
774
+ "with": {}
775
+ },
776
+ "oauthClientResource_clientId_idx": {
777
+ "name": "oauthClientResource_clientId_idx",
778
+ "columns": [
779
+ {
780
+ "expression": "client_id",
781
+ "isExpression": false,
782
+ "asc": true,
783
+ "nulls": "last"
784
+ }
785
+ ],
786
+ "isUnique": false,
787
+ "concurrently": false,
788
+ "method": "btree",
789
+ "with": {}
790
+ },
791
+ "oauthClientResource_resourceId_idx": {
792
+ "name": "oauthClientResource_resourceId_idx",
793
+ "columns": [
794
+ {
795
+ "expression": "resource_id",
796
+ "isExpression": false,
797
+ "asc": true,
798
+ "nulls": "last"
799
+ }
800
+ ],
801
+ "isUnique": false,
802
+ "concurrently": false,
803
+ "method": "btree",
804
+ "with": {}
805
+ }
806
+ },
807
+ "foreignKeys": {
808
+ "oauth_client_resource_client_id_oauth_client_client_id_fk": {
809
+ "name": "oauth_client_resource_client_id_oauth_client_client_id_fk",
810
+ "tableFrom": "oauth_client_resource",
811
+ "tableTo": "oauth_client",
812
+ "columnsFrom": [
813
+ "client_id"
814
+ ],
815
+ "columnsTo": [
816
+ "client_id"
817
+ ],
818
+ "onDelete": "cascade",
819
+ "onUpdate": "no action"
820
+ },
821
+ "oauth_client_resource_resource_id_oauth_resource_identifier_fk": {
822
+ "name": "oauth_client_resource_resource_id_oauth_resource_identifier_fk",
823
+ "tableFrom": "oauth_client_resource",
824
+ "tableTo": "oauth_resource",
825
+ "columnsFrom": [
826
+ "resource_id"
827
+ ],
828
+ "columnsTo": [
829
+ "identifier"
830
+ ],
831
+ "onDelete": "cascade",
832
+ "onUpdate": "no action"
833
+ }
834
+ },
835
+ "compositePrimaryKeys": {},
836
+ "uniqueConstraints": {},
837
+ "policies": {},
838
+ "checkConstraints": {},
839
+ "isRLSEnabled": false
840
+ },
841
+ "public.oauth_consent": {
842
+ "name": "oauth_consent",
843
+ "schema": "",
844
+ "columns": {
845
+ "id": {
846
+ "name": "id",
847
+ "type": "text",
848
+ "primaryKey": true,
849
+ "notNull": true
850
+ },
851
+ "client_id": {
852
+ "name": "client_id",
853
+ "type": "text",
854
+ "primaryKey": false,
855
+ "notNull": true
856
+ },
857
+ "user_id": {
858
+ "name": "user_id",
859
+ "type": "text",
860
+ "primaryKey": false,
861
+ "notNull": false
862
+ },
863
+ "reference_id": {
864
+ "name": "reference_id",
865
+ "type": "text",
866
+ "primaryKey": false,
867
+ "notNull": false
868
+ },
869
+ "resources": {
870
+ "name": "resources",
871
+ "type": "text[]",
872
+ "primaryKey": false,
873
+ "notNull": false
874
+ },
875
+ "requested_user_info_claims": {
876
+ "name": "requested_user_info_claims",
877
+ "type": "text[]",
878
+ "primaryKey": false,
879
+ "notNull": false
880
+ },
881
+ "scopes": {
882
+ "name": "scopes",
883
+ "type": "text[]",
884
+ "primaryKey": false,
885
+ "notNull": true
886
+ },
887
+ "created_at": {
888
+ "name": "created_at",
889
+ "type": "timestamp",
890
+ "primaryKey": false,
891
+ "notNull": true
892
+ },
893
+ "updated_at": {
894
+ "name": "updated_at",
895
+ "type": "timestamp",
896
+ "primaryKey": false,
897
+ "notNull": true
898
+ }
899
+ },
900
+ "indexes": {
901
+ "oauthConsent_clientId_idx": {
902
+ "name": "oauthConsent_clientId_idx",
903
+ "columns": [
904
+ {
905
+ "expression": "client_id",
906
+ "isExpression": false,
907
+ "asc": true,
908
+ "nulls": "last"
909
+ }
910
+ ],
911
+ "isUnique": false,
912
+ "concurrently": false,
913
+ "method": "btree",
914
+ "with": {}
915
+ },
916
+ "oauthConsent_userId_idx": {
917
+ "name": "oauthConsent_userId_idx",
918
+ "columns": [
919
+ {
920
+ "expression": "user_id",
921
+ "isExpression": false,
922
+ "asc": true,
923
+ "nulls": "last"
924
+ }
925
+ ],
926
+ "isUnique": false,
927
+ "concurrently": false,
928
+ "method": "btree",
929
+ "with": {}
930
+ }
931
+ },
932
+ "foreignKeys": {
933
+ "oauth_consent_client_id_oauth_client_client_id_fk": {
934
+ "name": "oauth_consent_client_id_oauth_client_client_id_fk",
935
+ "tableFrom": "oauth_consent",
936
+ "tableTo": "oauth_client",
937
+ "columnsFrom": [
938
+ "client_id"
939
+ ],
940
+ "columnsTo": [
941
+ "client_id"
942
+ ],
943
+ "onDelete": "cascade",
944
+ "onUpdate": "no action"
945
+ },
946
+ "oauth_consent_user_id_user_id_fk": {
947
+ "name": "oauth_consent_user_id_user_id_fk",
948
+ "tableFrom": "oauth_consent",
949
+ "tableTo": "user",
950
+ "columnsFrom": [
951
+ "user_id"
952
+ ],
953
+ "columnsTo": [
954
+ "id"
955
+ ],
956
+ "onDelete": "cascade",
957
+ "onUpdate": "no action"
958
+ }
959
+ },
960
+ "compositePrimaryKeys": {},
961
+ "uniqueConstraints": {},
962
+ "policies": {},
963
+ "checkConstraints": {},
964
+ "isRLSEnabled": false
965
+ },
966
+ "public.oauth_refresh_token": {
967
+ "name": "oauth_refresh_token",
968
+ "schema": "",
969
+ "columns": {
970
+ "id": {
971
+ "name": "id",
972
+ "type": "text",
973
+ "primaryKey": true,
974
+ "notNull": true
975
+ },
976
+ "token": {
977
+ "name": "token",
978
+ "type": "text",
979
+ "primaryKey": false,
980
+ "notNull": true
981
+ },
982
+ "client_id": {
983
+ "name": "client_id",
984
+ "type": "text",
985
+ "primaryKey": false,
986
+ "notNull": true
987
+ },
988
+ "session_id": {
989
+ "name": "session_id",
990
+ "type": "text",
991
+ "primaryKey": false,
992
+ "notNull": false
993
+ },
994
+ "user_id": {
995
+ "name": "user_id",
996
+ "type": "text",
997
+ "primaryKey": false,
998
+ "notNull": true
999
+ },
1000
+ "reference_id": {
1001
+ "name": "reference_id",
1002
+ "type": "text",
1003
+ "primaryKey": false,
1004
+ "notNull": false
1005
+ },
1006
+ "authorization_code_id": {
1007
+ "name": "authorization_code_id",
1008
+ "type": "text",
1009
+ "primaryKey": false,
1010
+ "notNull": false
1011
+ },
1012
+ "resources": {
1013
+ "name": "resources",
1014
+ "type": "text[]",
1015
+ "primaryKey": false,
1016
+ "notNull": false
1017
+ },
1018
+ "requested_user_info_claims": {
1019
+ "name": "requested_user_info_claims",
1020
+ "type": "text[]",
1021
+ "primaryKey": false,
1022
+ "notNull": false
1023
+ },
1024
+ "expires_at": {
1025
+ "name": "expires_at",
1026
+ "type": "timestamp",
1027
+ "primaryKey": false,
1028
+ "notNull": true
1029
+ },
1030
+ "created_at": {
1031
+ "name": "created_at",
1032
+ "type": "timestamp",
1033
+ "primaryKey": false,
1034
+ "notNull": true
1035
+ },
1036
+ "revoked": {
1037
+ "name": "revoked",
1038
+ "type": "timestamp",
1039
+ "primaryKey": false,
1040
+ "notNull": false
1041
+ },
1042
+ "rotated_at": {
1043
+ "name": "rotated_at",
1044
+ "type": "timestamp",
1045
+ "primaryKey": false,
1046
+ "notNull": false
1047
+ },
1048
+ "rotation_replay_response": {
1049
+ "name": "rotation_replay_response",
1050
+ "type": "text",
1051
+ "primaryKey": false,
1052
+ "notNull": false
1053
+ },
1054
+ "rotation_replay_expires_at": {
1055
+ "name": "rotation_replay_expires_at",
1056
+ "type": "timestamp",
1057
+ "primaryKey": false,
1058
+ "notNull": false
1059
+ },
1060
+ "auth_time": {
1061
+ "name": "auth_time",
1062
+ "type": "timestamp",
1063
+ "primaryKey": false,
1064
+ "notNull": false
1065
+ },
1066
+ "confirmation": {
1067
+ "name": "confirmation",
1068
+ "type": "jsonb",
1069
+ "primaryKey": false,
1070
+ "notNull": false
1071
+ },
1072
+ "scopes": {
1073
+ "name": "scopes",
1074
+ "type": "text[]",
1075
+ "primaryKey": false,
1076
+ "notNull": true
1077
+ }
1078
+ },
1079
+ "indexes": {
1080
+ "oauthRefreshToken_clientId_idx": {
1081
+ "name": "oauthRefreshToken_clientId_idx",
1082
+ "columns": [
1083
+ {
1084
+ "expression": "client_id",
1085
+ "isExpression": false,
1086
+ "asc": true,
1087
+ "nulls": "last"
1088
+ }
1089
+ ],
1090
+ "isUnique": false,
1091
+ "concurrently": false,
1092
+ "method": "btree",
1093
+ "with": {}
1094
+ },
1095
+ "oauthRefreshToken_sessionId_idx": {
1096
+ "name": "oauthRefreshToken_sessionId_idx",
1097
+ "columns": [
1098
+ {
1099
+ "expression": "session_id",
1100
+ "isExpression": false,
1101
+ "asc": true,
1102
+ "nulls": "last"
1103
+ }
1104
+ ],
1105
+ "isUnique": false,
1106
+ "concurrently": false,
1107
+ "method": "btree",
1108
+ "with": {}
1109
+ },
1110
+ "oauthRefreshToken_userId_idx": {
1111
+ "name": "oauthRefreshToken_userId_idx",
1112
+ "columns": [
1113
+ {
1114
+ "expression": "user_id",
1115
+ "isExpression": false,
1116
+ "asc": true,
1117
+ "nulls": "last"
1118
+ }
1119
+ ],
1120
+ "isUnique": false,
1121
+ "concurrently": false,
1122
+ "method": "btree",
1123
+ "with": {}
1124
+ },
1125
+ "oauthRefreshToken_authorizationCodeId_idx": {
1126
+ "name": "oauthRefreshToken_authorizationCodeId_idx",
1127
+ "columns": [
1128
+ {
1129
+ "expression": "authorization_code_id",
1130
+ "isExpression": false,
1131
+ "asc": true,
1132
+ "nulls": "last"
1133
+ }
1134
+ ],
1135
+ "isUnique": false,
1136
+ "concurrently": false,
1137
+ "method": "btree",
1138
+ "with": {}
1139
+ }
1140
+ },
1141
+ "foreignKeys": {
1142
+ "oauth_refresh_token_client_id_oauth_client_client_id_fk": {
1143
+ "name": "oauth_refresh_token_client_id_oauth_client_client_id_fk",
1144
+ "tableFrom": "oauth_refresh_token",
1145
+ "tableTo": "oauth_client",
1146
+ "columnsFrom": [
1147
+ "client_id"
1148
+ ],
1149
+ "columnsTo": [
1150
+ "client_id"
1151
+ ],
1152
+ "onDelete": "cascade",
1153
+ "onUpdate": "no action"
1154
+ },
1155
+ "oauth_refresh_token_session_id_session_id_fk": {
1156
+ "name": "oauth_refresh_token_session_id_session_id_fk",
1157
+ "tableFrom": "oauth_refresh_token",
1158
+ "tableTo": "session",
1159
+ "columnsFrom": [
1160
+ "session_id"
1161
+ ],
1162
+ "columnsTo": [
1163
+ "id"
1164
+ ],
1165
+ "onDelete": "set null",
1166
+ "onUpdate": "no action"
1167
+ },
1168
+ "oauth_refresh_token_user_id_user_id_fk": {
1169
+ "name": "oauth_refresh_token_user_id_user_id_fk",
1170
+ "tableFrom": "oauth_refresh_token",
1171
+ "tableTo": "user",
1172
+ "columnsFrom": [
1173
+ "user_id"
1174
+ ],
1175
+ "columnsTo": [
1176
+ "id"
1177
+ ],
1178
+ "onDelete": "cascade",
1179
+ "onUpdate": "no action"
1180
+ }
1181
+ },
1182
+ "compositePrimaryKeys": {},
1183
+ "uniqueConstraints": {
1184
+ "oauth_refresh_token_token_unique": {
1185
+ "name": "oauth_refresh_token_token_unique",
1186
+ "nullsNotDistinct": false,
1187
+ "columns": [
1188
+ "token"
1189
+ ]
1190
+ }
1191
+ },
1192
+ "policies": {},
1193
+ "checkConstraints": {},
1194
+ "isRLSEnabled": false
1195
+ },
1196
+ "public.oauth_resource": {
1197
+ "name": "oauth_resource",
1198
+ "schema": "",
1199
+ "columns": {
1200
+ "id": {
1201
+ "name": "id",
1202
+ "type": "text",
1203
+ "primaryKey": true,
1204
+ "notNull": true
1205
+ },
1206
+ "identifier": {
1207
+ "name": "identifier",
1208
+ "type": "text",
1209
+ "primaryKey": false,
1210
+ "notNull": true
1211
+ },
1212
+ "name": {
1213
+ "name": "name",
1214
+ "type": "text",
1215
+ "primaryKey": false,
1216
+ "notNull": true
1217
+ },
1218
+ "access_token_ttl": {
1219
+ "name": "access_token_ttl",
1220
+ "type": "integer",
1221
+ "primaryKey": false,
1222
+ "notNull": false
1223
+ },
1224
+ "refresh_token_ttl": {
1225
+ "name": "refresh_token_ttl",
1226
+ "type": "integer",
1227
+ "primaryKey": false,
1228
+ "notNull": false
1229
+ },
1230
+ "signing_algorithm": {
1231
+ "name": "signing_algorithm",
1232
+ "type": "text",
1233
+ "primaryKey": false,
1234
+ "notNull": false
1235
+ },
1236
+ "signing_key_id": {
1237
+ "name": "signing_key_id",
1238
+ "type": "text",
1239
+ "primaryKey": false,
1240
+ "notNull": false
1241
+ },
1242
+ "allowed_scopes": {
1243
+ "name": "allowed_scopes",
1244
+ "type": "text[]",
1245
+ "primaryKey": false,
1246
+ "notNull": false
1247
+ },
1248
+ "custom_claims": {
1249
+ "name": "custom_claims",
1250
+ "type": "jsonb",
1251
+ "primaryKey": false,
1252
+ "notNull": false
1253
+ },
1254
+ "dpop_bound_access_tokens_required": {
1255
+ "name": "dpop_bound_access_tokens_required",
1256
+ "type": "boolean",
1257
+ "primaryKey": false,
1258
+ "notNull": false,
1259
+ "default": false
1260
+ },
1261
+ "disabled": {
1262
+ "name": "disabled",
1263
+ "type": "boolean",
1264
+ "primaryKey": false,
1265
+ "notNull": false,
1266
+ "default": false
1267
+ },
1268
+ "created_at": {
1269
+ "name": "created_at",
1270
+ "type": "timestamp",
1271
+ "primaryKey": false,
1272
+ "notNull": false
1273
+ },
1274
+ "updated_at": {
1275
+ "name": "updated_at",
1276
+ "type": "timestamp",
1277
+ "primaryKey": false,
1278
+ "notNull": false
1279
+ },
1280
+ "policy_version": {
1281
+ "name": "policy_version",
1282
+ "type": "integer",
1283
+ "primaryKey": false,
1284
+ "notNull": false,
1285
+ "default": 1
1286
+ },
1287
+ "metadata": {
1288
+ "name": "metadata",
1289
+ "type": "jsonb",
1290
+ "primaryKey": false,
1291
+ "notNull": false
1292
+ }
1293
+ },
1294
+ "indexes": {},
1295
+ "foreignKeys": {},
1296
+ "compositePrimaryKeys": {},
1297
+ "uniqueConstraints": {
1298
+ "oauth_resource_identifier_unique": {
1299
+ "name": "oauth_resource_identifier_unique",
1300
+ "nullsNotDistinct": false,
1301
+ "columns": [
1302
+ "identifier"
1303
+ ]
1304
+ }
1305
+ },
1306
+ "policies": {},
1307
+ "checkConstraints": {},
1308
+ "isRLSEnabled": false
1309
+ },
1310
+ "public.passkey": {
1311
+ "name": "passkey",
1312
+ "schema": "",
1313
+ "columns": {
1314
+ "id": {
1315
+ "name": "id",
1316
+ "type": "text",
1317
+ "primaryKey": true,
1318
+ "notNull": true
1319
+ },
1320
+ "name": {
1321
+ "name": "name",
1322
+ "type": "text",
1323
+ "primaryKey": false,
1324
+ "notNull": false
1325
+ },
1326
+ "public_key": {
1327
+ "name": "public_key",
1328
+ "type": "text",
1329
+ "primaryKey": false,
1330
+ "notNull": true
1331
+ },
1332
+ "user_id": {
1333
+ "name": "user_id",
1334
+ "type": "text",
1335
+ "primaryKey": false,
1336
+ "notNull": true
1337
+ },
1338
+ "credential_id": {
1339
+ "name": "credential_id",
1340
+ "type": "text",
1341
+ "primaryKey": false,
1342
+ "notNull": true
1343
+ },
1344
+ "counter": {
1345
+ "name": "counter",
1346
+ "type": "integer",
1347
+ "primaryKey": false,
1348
+ "notNull": true
1349
+ },
1350
+ "device_type": {
1351
+ "name": "device_type",
1352
+ "type": "text",
1353
+ "primaryKey": false,
1354
+ "notNull": true
1355
+ },
1356
+ "backed_up": {
1357
+ "name": "backed_up",
1358
+ "type": "boolean",
1359
+ "primaryKey": false,
1360
+ "notNull": true
1361
+ },
1362
+ "transports": {
1363
+ "name": "transports",
1364
+ "type": "text",
1365
+ "primaryKey": false,
1366
+ "notNull": false
1367
+ },
1368
+ "created_at": {
1369
+ "name": "created_at",
1370
+ "type": "timestamp",
1371
+ "primaryKey": false,
1372
+ "notNull": false
1373
+ },
1374
+ "aaguid": {
1375
+ "name": "aaguid",
1376
+ "type": "text",
1377
+ "primaryKey": false,
1378
+ "notNull": false
1379
+ }
1380
+ },
1381
+ "indexes": {
1382
+ "passkey_userId_idx": {
1383
+ "name": "passkey_userId_idx",
1384
+ "columns": [
1385
+ {
1386
+ "expression": "user_id",
1387
+ "isExpression": false,
1388
+ "asc": true,
1389
+ "nulls": "last"
1390
+ }
1391
+ ],
1392
+ "isUnique": false,
1393
+ "concurrently": false,
1394
+ "method": "btree",
1395
+ "with": {}
1396
+ },
1397
+ "passkey_credentialID_idx": {
1398
+ "name": "passkey_credentialID_idx",
1399
+ "columns": [
1400
+ {
1401
+ "expression": "credential_id",
1402
+ "isExpression": false,
1403
+ "asc": true,
1404
+ "nulls": "last"
1405
+ }
1406
+ ],
1407
+ "isUnique": false,
1408
+ "concurrently": false,
1409
+ "method": "btree",
1410
+ "with": {}
1411
+ }
1412
+ },
1413
+ "foreignKeys": {
1414
+ "passkey_user_id_user_id_fk": {
1415
+ "name": "passkey_user_id_user_id_fk",
1416
+ "tableFrom": "passkey",
1417
+ "tableTo": "user",
1418
+ "columnsFrom": [
1419
+ "user_id"
1420
+ ],
1421
+ "columnsTo": [
1422
+ "id"
1423
+ ],
1424
+ "onDelete": "cascade",
1425
+ "onUpdate": "no action"
1426
+ }
1427
+ },
1428
+ "compositePrimaryKeys": {},
1429
+ "uniqueConstraints": {},
1430
+ "policies": {},
1431
+ "checkConstraints": {},
1432
+ "isRLSEnabled": false
1433
+ },
1434
+ "public.session": {
1435
+ "name": "session",
1436
+ "schema": "",
1437
+ "columns": {
1438
+ "id": {
1439
+ "name": "id",
1440
+ "type": "text",
1441
+ "primaryKey": true,
1442
+ "notNull": true
1443
+ },
1444
+ "expires_at": {
1445
+ "name": "expires_at",
1446
+ "type": "timestamp",
1447
+ "primaryKey": false,
1448
+ "notNull": true
1449
+ },
1450
+ "token": {
1451
+ "name": "token",
1452
+ "type": "text",
1453
+ "primaryKey": false,
1454
+ "notNull": true
1455
+ },
1456
+ "created_at": {
1457
+ "name": "created_at",
1458
+ "type": "timestamp",
1459
+ "primaryKey": false,
1460
+ "notNull": true,
1461
+ "default": "now()"
1462
+ },
1463
+ "updated_at": {
1464
+ "name": "updated_at",
1465
+ "type": "timestamp",
1466
+ "primaryKey": false,
1467
+ "notNull": true
1468
+ },
1469
+ "ip_address": {
1470
+ "name": "ip_address",
1471
+ "type": "text",
1472
+ "primaryKey": false,
1473
+ "notNull": false
1474
+ },
1475
+ "user_agent": {
1476
+ "name": "user_agent",
1477
+ "type": "text",
1478
+ "primaryKey": false,
1479
+ "notNull": false
1480
+ },
1481
+ "user_id": {
1482
+ "name": "user_id",
1483
+ "type": "text",
1484
+ "primaryKey": false,
1485
+ "notNull": true
1486
+ },
1487
+ "impersonated_by": {
1488
+ "name": "impersonated_by",
1489
+ "type": "text",
1490
+ "primaryKey": false,
1491
+ "notNull": false
1492
+ }
1493
+ },
1494
+ "indexes": {
1495
+ "session_userId_idx": {
1496
+ "name": "session_userId_idx",
1497
+ "columns": [
1498
+ {
1499
+ "expression": "user_id",
1500
+ "isExpression": false,
1501
+ "asc": true,
1502
+ "nulls": "last"
1503
+ }
1504
+ ],
1505
+ "isUnique": false,
1506
+ "concurrently": false,
1507
+ "method": "btree",
1508
+ "with": {}
1509
+ }
1510
+ },
1511
+ "foreignKeys": {
1512
+ "session_user_id_user_id_fk": {
1513
+ "name": "session_user_id_user_id_fk",
1514
+ "tableFrom": "session",
1515
+ "tableTo": "user",
1516
+ "columnsFrom": [
1517
+ "user_id"
1518
+ ],
1519
+ "columnsTo": [
1520
+ "id"
1521
+ ],
1522
+ "onDelete": "cascade",
1523
+ "onUpdate": "no action"
1524
+ }
1525
+ },
1526
+ "compositePrimaryKeys": {},
1527
+ "uniqueConstraints": {
1528
+ "session_token_unique": {
1529
+ "name": "session_token_unique",
1530
+ "nullsNotDistinct": false,
1531
+ "columns": [
1532
+ "token"
1533
+ ]
1534
+ }
1535
+ },
1536
+ "policies": {},
1537
+ "checkConstraints": {},
1538
+ "isRLSEnabled": false
1539
+ },
1540
+ "public.two_factor": {
1541
+ "name": "two_factor",
1542
+ "schema": "",
1543
+ "columns": {
1544
+ "id": {
1545
+ "name": "id",
1546
+ "type": "text",
1547
+ "primaryKey": true,
1548
+ "notNull": true
1549
+ },
1550
+ "secret": {
1551
+ "name": "secret",
1552
+ "type": "text",
1553
+ "primaryKey": false,
1554
+ "notNull": true
1555
+ },
1556
+ "backup_codes": {
1557
+ "name": "backup_codes",
1558
+ "type": "text",
1559
+ "primaryKey": false,
1560
+ "notNull": true
1561
+ },
1562
+ "user_id": {
1563
+ "name": "user_id",
1564
+ "type": "text",
1565
+ "primaryKey": false,
1566
+ "notNull": true
1567
+ },
1568
+ "verified": {
1569
+ "name": "verified",
1570
+ "type": "boolean",
1571
+ "primaryKey": false,
1572
+ "notNull": false,
1573
+ "default": true
1574
+ },
1575
+ "failed_verification_count": {
1576
+ "name": "failed_verification_count",
1577
+ "type": "integer",
1578
+ "primaryKey": false,
1579
+ "notNull": false,
1580
+ "default": 0
1581
+ },
1582
+ "locked_until": {
1583
+ "name": "locked_until",
1584
+ "type": "timestamp",
1585
+ "primaryKey": false,
1586
+ "notNull": false
1587
+ }
1588
+ },
1589
+ "indexes": {
1590
+ "twoFactor_secret_idx": {
1591
+ "name": "twoFactor_secret_idx",
1592
+ "columns": [
1593
+ {
1594
+ "expression": "secret",
1595
+ "isExpression": false,
1596
+ "asc": true,
1597
+ "nulls": "last"
1598
+ }
1599
+ ],
1600
+ "isUnique": false,
1601
+ "concurrently": false,
1602
+ "method": "btree",
1603
+ "with": {}
1604
+ },
1605
+ "twoFactor_userId_idx": {
1606
+ "name": "twoFactor_userId_idx",
1607
+ "columns": [
1608
+ {
1609
+ "expression": "user_id",
1610
+ "isExpression": false,
1611
+ "asc": true,
1612
+ "nulls": "last"
1613
+ }
1614
+ ],
1615
+ "isUnique": false,
1616
+ "concurrently": false,
1617
+ "method": "btree",
1618
+ "with": {}
1619
+ }
1620
+ },
1621
+ "foreignKeys": {
1622
+ "two_factor_user_id_user_id_fk": {
1623
+ "name": "two_factor_user_id_user_id_fk",
1624
+ "tableFrom": "two_factor",
1625
+ "tableTo": "user",
1626
+ "columnsFrom": [
1627
+ "user_id"
1628
+ ],
1629
+ "columnsTo": [
1630
+ "id"
1631
+ ],
1632
+ "onDelete": "cascade",
1633
+ "onUpdate": "no action"
1634
+ }
1635
+ },
1636
+ "compositePrimaryKeys": {},
1637
+ "uniqueConstraints": {},
1638
+ "policies": {},
1639
+ "checkConstraints": {},
1640
+ "isRLSEnabled": false
1641
+ },
1642
+ "public.user": {
1643
+ "name": "user",
1644
+ "schema": "",
1645
+ "columns": {
1646
+ "id": {
1647
+ "name": "id",
1648
+ "type": "text",
1649
+ "primaryKey": true,
1650
+ "notNull": true
1651
+ },
1652
+ "name": {
1653
+ "name": "name",
1654
+ "type": "text",
1655
+ "primaryKey": false,
1656
+ "notNull": true
1657
+ },
1658
+ "email": {
1659
+ "name": "email",
1660
+ "type": "text",
1661
+ "primaryKey": false,
1662
+ "notNull": true
1663
+ },
1664
+ "email_verified": {
1665
+ "name": "email_verified",
1666
+ "type": "boolean",
1667
+ "primaryKey": false,
1668
+ "notNull": true,
1669
+ "default": false
1670
+ },
1671
+ "image": {
1672
+ "name": "image",
1673
+ "type": "text",
1674
+ "primaryKey": false,
1675
+ "notNull": false
1676
+ },
1677
+ "created_at": {
1678
+ "name": "created_at",
1679
+ "type": "timestamp",
1680
+ "primaryKey": false,
1681
+ "notNull": true,
1682
+ "default": "now()"
1683
+ },
1684
+ "updated_at": {
1685
+ "name": "updated_at",
1686
+ "type": "timestamp",
1687
+ "primaryKey": false,
1688
+ "notNull": true,
1689
+ "default": "now()"
1690
+ },
1691
+ "role": {
1692
+ "name": "role",
1693
+ "type": "text",
1694
+ "primaryKey": false,
1695
+ "notNull": false
1696
+ },
1697
+ "banned": {
1698
+ "name": "banned",
1699
+ "type": "boolean",
1700
+ "primaryKey": false,
1701
+ "notNull": false,
1702
+ "default": false
1703
+ },
1704
+ "ban_reason": {
1705
+ "name": "ban_reason",
1706
+ "type": "text",
1707
+ "primaryKey": false,
1708
+ "notNull": false
1709
+ },
1710
+ "ban_expires": {
1711
+ "name": "ban_expires",
1712
+ "type": "timestamp",
1713
+ "primaryKey": false,
1714
+ "notNull": false
1715
+ },
1716
+ "two_factor_enabled": {
1717
+ "name": "two_factor_enabled",
1718
+ "type": "boolean",
1719
+ "primaryKey": false,
1720
+ "notNull": false,
1721
+ "default": false
1722
+ },
1723
+ "tokens_revoked_at": {
1724
+ "name": "tokens_revoked_at",
1725
+ "type": "timestamp",
1726
+ "primaryKey": false,
1727
+ "notNull": false
1728
+ },
1729
+ "locale": {
1730
+ "name": "locale",
1731
+ "type": "text",
1732
+ "primaryKey": false,
1733
+ "notNull": false
1734
+ }
1735
+ },
1736
+ "indexes": {},
1737
+ "foreignKeys": {},
1738
+ "compositePrimaryKeys": {},
1739
+ "uniqueConstraints": {
1740
+ "user_email_unique": {
1741
+ "name": "user_email_unique",
1742
+ "nullsNotDistinct": false,
1743
+ "columns": [
1744
+ "email"
1745
+ ]
1746
+ }
1747
+ },
1748
+ "policies": {},
1749
+ "checkConstraints": {},
1750
+ "isRLSEnabled": false
1751
+ },
1752
+ "public.verification": {
1753
+ "name": "verification",
1754
+ "schema": "",
1755
+ "columns": {
1756
+ "id": {
1757
+ "name": "id",
1758
+ "type": "text",
1759
+ "primaryKey": true,
1760
+ "notNull": true
1761
+ },
1762
+ "identifier": {
1763
+ "name": "identifier",
1764
+ "type": "text",
1765
+ "primaryKey": false,
1766
+ "notNull": true
1767
+ },
1768
+ "value": {
1769
+ "name": "value",
1770
+ "type": "text",
1771
+ "primaryKey": false,
1772
+ "notNull": true
1773
+ },
1774
+ "expires_at": {
1775
+ "name": "expires_at",
1776
+ "type": "timestamp",
1777
+ "primaryKey": false,
1778
+ "notNull": true
1779
+ },
1780
+ "created_at": {
1781
+ "name": "created_at",
1782
+ "type": "timestamp",
1783
+ "primaryKey": false,
1784
+ "notNull": true,
1785
+ "default": "now()"
1786
+ },
1787
+ "updated_at": {
1788
+ "name": "updated_at",
1789
+ "type": "timestamp",
1790
+ "primaryKey": false,
1791
+ "notNull": true,
1792
+ "default": "now()"
1793
+ }
1794
+ },
1795
+ "indexes": {
1796
+ "verification_identifier_idx": {
1797
+ "name": "verification_identifier_idx",
1798
+ "columns": [
1799
+ {
1800
+ "expression": "identifier",
1801
+ "isExpression": false,
1802
+ "asc": true,
1803
+ "nulls": "last"
1804
+ }
1805
+ ],
1806
+ "isUnique": false,
1807
+ "concurrently": false,
1808
+ "method": "btree",
1809
+ "with": {}
1810
+ }
1811
+ },
1812
+ "foreignKeys": {},
1813
+ "compositePrimaryKeys": {},
1814
+ "uniqueConstraints": {},
1815
+ "policies": {},
1816
+ "checkConstraints": {},
1817
+ "isRLSEnabled": false
1818
+ },
1819
+ "public.admin_action": {
1820
+ "name": "admin_action",
1821
+ "schema": "",
1822
+ "columns": {
1823
+ "id": {
1824
+ "name": "id",
1825
+ "type": "text",
1826
+ "primaryKey": true,
1827
+ "notNull": true
1828
+ },
1829
+ "actor_id": {
1830
+ "name": "actor_id",
1831
+ "type": "text",
1832
+ "primaryKey": false,
1833
+ "notNull": false
1834
+ },
1835
+ "action": {
1836
+ "name": "action",
1837
+ "type": "text",
1838
+ "primaryKey": false,
1839
+ "notNull": true
1840
+ },
1841
+ "target_type": {
1842
+ "name": "target_type",
1843
+ "type": "text",
1844
+ "primaryKey": false,
1845
+ "notNull": false
1846
+ },
1847
+ "target_id": {
1848
+ "name": "target_id",
1849
+ "type": "text",
1850
+ "primaryKey": false,
1851
+ "notNull": false
1852
+ },
1853
+ "detail": {
1854
+ "name": "detail",
1855
+ "type": "jsonb",
1856
+ "primaryKey": false,
1857
+ "notNull": false
1858
+ },
1859
+ "created_at": {
1860
+ "name": "created_at",
1861
+ "type": "timestamp with time zone",
1862
+ "primaryKey": false,
1863
+ "notNull": true,
1864
+ "default": "now()"
1865
+ }
1866
+ },
1867
+ "indexes": {
1868
+ "admin_action_created_idx": {
1869
+ "name": "admin_action_created_idx",
1870
+ "columns": [
1871
+ {
1872
+ "expression": "created_at",
1873
+ "isExpression": false,
1874
+ "asc": false,
1875
+ "nulls": "last"
1876
+ }
1877
+ ],
1878
+ "isUnique": false,
1879
+ "concurrently": false,
1880
+ "method": "btree",
1881
+ "with": {}
1882
+ }
1883
+ },
1884
+ "foreignKeys": {
1885
+ "admin_action_actor_id_user_id_fk": {
1886
+ "name": "admin_action_actor_id_user_id_fk",
1887
+ "tableFrom": "admin_action",
1888
+ "tableTo": "user",
1889
+ "columnsFrom": [
1890
+ "actor_id"
1891
+ ],
1892
+ "columnsTo": [
1893
+ "id"
1894
+ ],
1895
+ "onDelete": "set null",
1896
+ "onUpdate": "no action"
1897
+ }
1898
+ },
1899
+ "compositePrimaryKeys": {},
1900
+ "uniqueConstraints": {},
1901
+ "policies": {
1902
+ "rls_policy": {
1903
+ "name": "rls_policy",
1904
+ "as": "PERMISSIVE",
1905
+ "for": "ALL",
1906
+ "to": [
1907
+ "starter_app"
1908
+ ],
1909
+ "using": "app_private.is_admin()",
1910
+ "withCheck": "app_private.is_admin()"
1911
+ }
1912
+ },
1913
+ "checkConstraints": {},
1914
+ "isRLSEnabled": false
1915
+ },
1916
+ "public.purchase": {
1917
+ "name": "purchase",
1918
+ "schema": "",
1919
+ "columns": {
1920
+ "id": {
1921
+ "name": "id",
1922
+ "type": "text",
1923
+ "primaryKey": true,
1924
+ "notNull": true
1925
+ },
1926
+ "user_id": {
1927
+ "name": "user_id",
1928
+ "type": "text",
1929
+ "primaryKey": false,
1930
+ "notNull": true
1931
+ },
1932
+ "provider": {
1933
+ "name": "provider",
1934
+ "type": "text",
1935
+ "primaryKey": false,
1936
+ "notNull": true
1937
+ },
1938
+ "external_id": {
1939
+ "name": "external_id",
1940
+ "type": "text",
1941
+ "primaryKey": false,
1942
+ "notNull": true
1943
+ },
1944
+ "amount": {
1945
+ "name": "amount",
1946
+ "type": "text",
1947
+ "primaryKey": false,
1948
+ "notNull": true
1949
+ },
1950
+ "currency": {
1951
+ "name": "currency",
1952
+ "type": "text",
1953
+ "primaryKey": false,
1954
+ "notNull": true,
1955
+ "default": "'usd'"
1956
+ },
1957
+ "status": {
1958
+ "name": "status",
1959
+ "type": "text",
1960
+ "primaryKey": false,
1961
+ "notNull": true,
1962
+ "default": "'pending'"
1963
+ },
1964
+ "metadata": {
1965
+ "name": "metadata",
1966
+ "type": "jsonb",
1967
+ "primaryKey": false,
1968
+ "notNull": false
1969
+ },
1970
+ "paid_at": {
1971
+ "name": "paid_at",
1972
+ "type": "timestamp with time zone",
1973
+ "primaryKey": false,
1974
+ "notNull": false
1975
+ },
1976
+ "created_at": {
1977
+ "name": "created_at",
1978
+ "type": "timestamp with time zone",
1979
+ "primaryKey": false,
1980
+ "notNull": true,
1981
+ "default": "now()"
1982
+ },
1983
+ "updated_at": {
1984
+ "name": "updated_at",
1985
+ "type": "timestamp with time zone",
1986
+ "primaryKey": false,
1987
+ "notNull": true,
1988
+ "default": "now()"
1989
+ }
1990
+ },
1991
+ "indexes": {
1992
+ "purchase_provider_external_uq": {
1993
+ "name": "purchase_provider_external_uq",
1994
+ "columns": [
1995
+ {
1996
+ "expression": "provider",
1997
+ "isExpression": false,
1998
+ "asc": true,
1999
+ "nulls": "last"
2000
+ },
2001
+ {
2002
+ "expression": "external_id",
2003
+ "isExpression": false,
2004
+ "asc": true,
2005
+ "nulls": "last"
2006
+ }
2007
+ ],
2008
+ "isUnique": true,
2009
+ "concurrently": false,
2010
+ "method": "btree",
2011
+ "with": {}
2012
+ },
2013
+ "purchase_userId_idx": {
2014
+ "name": "purchase_userId_idx",
2015
+ "columns": [
2016
+ {
2017
+ "expression": "user_id",
2018
+ "isExpression": false,
2019
+ "asc": true,
2020
+ "nulls": "last"
2021
+ }
2022
+ ],
2023
+ "isUnique": false,
2024
+ "concurrently": false,
2025
+ "method": "btree",
2026
+ "with": {}
2027
+ }
2028
+ },
2029
+ "foreignKeys": {
2030
+ "purchase_user_id_user_id_fk": {
2031
+ "name": "purchase_user_id_user_id_fk",
2032
+ "tableFrom": "purchase",
2033
+ "tableTo": "user",
2034
+ "columnsFrom": [
2035
+ "user_id"
2036
+ ],
2037
+ "columnsTo": [
2038
+ "id"
2039
+ ],
2040
+ "onDelete": "cascade",
2041
+ "onUpdate": "no action"
2042
+ }
2043
+ },
2044
+ "compositePrimaryKeys": {},
2045
+ "uniqueConstraints": {},
2046
+ "policies": {
2047
+ "rls_user_read": {
2048
+ "name": "rls_user_read",
2049
+ "as": "PERMISSIVE",
2050
+ "for": "SELECT",
2051
+ "to": [
2052
+ "starter_app"
2053
+ ],
2054
+ "using": "app_private.is_admin() OR user_id = app_private.current_user_id()"
2055
+ },
2056
+ "rls_service_write": {
2057
+ "name": "rls_service_write",
2058
+ "as": "PERMISSIVE",
2059
+ "for": "ALL",
2060
+ "to": [
2061
+ "starter_app"
2062
+ ],
2063
+ "using": "app_private.is_admin()",
2064
+ "withCheck": "app_private.is_admin()"
2065
+ }
2066
+ },
2067
+ "checkConstraints": {},
2068
+ "isRLSEnabled": false
2069
+ },
2070
+ "public.system_config": {
2071
+ "name": "system_config",
2072
+ "schema": "",
2073
+ "columns": {
2074
+ "key": {
2075
+ "name": "key",
2076
+ "type": "text",
2077
+ "primaryKey": true,
2078
+ "notNull": true
2079
+ },
2080
+ "value": {
2081
+ "name": "value",
2082
+ "type": "jsonb",
2083
+ "primaryKey": false,
2084
+ "notNull": true
2085
+ },
2086
+ "updated_at": {
2087
+ "name": "updated_at",
2088
+ "type": "timestamp with time zone",
2089
+ "primaryKey": false,
2090
+ "notNull": true,
2091
+ "default": "now()"
2092
+ }
2093
+ },
2094
+ "indexes": {},
2095
+ "foreignKeys": {},
2096
+ "compositePrimaryKeys": {},
2097
+ "uniqueConstraints": {},
2098
+ "policies": {
2099
+ "rls_policy": {
2100
+ "name": "rls_policy",
2101
+ "as": "PERMISSIVE",
2102
+ "for": "ALL",
2103
+ "to": [
2104
+ "starter_app"
2105
+ ],
2106
+ "using": "app_private.is_admin()",
2107
+ "withCheck": "app_private.is_admin()"
2108
+ }
2109
+ },
2110
+ "checkConstraints": {},
2111
+ "isRLSEnabled": false
2112
+ }
2113
+ },
2114
+ "enums": {},
2115
+ "schemas": {},
2116
+ "sequences": {},
2117
+ "roles": {},
2118
+ "policies": {},
2119
+ "views": {},
2120
+ "_meta": {
2121
+ "columns": {},
2122
+ "schemas": {},
2123
+ "tables": {}
2124
+ }
2125
+ }