@headless-lms/adapter-db 0.1.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 (115) hide show
  1. package/LICENSE +21 -0
  2. package/dist/_virtual/_rolldown/runtime.js +13 -0
  3. package/dist/client.d.ts +17 -0
  4. package/dist/client.js +11 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/index.d.ts +22 -0
  7. package/dist/index.js +22 -0
  8. package/dist/migrate.d.ts +7 -0
  9. package/dist/migrate.js +27 -0
  10. package/dist/migrate.js.map +1 -0
  11. package/dist/repositories/assets.d.ts +17 -0
  12. package/dist/repositories/assets.js +90 -0
  13. package/dist/repositories/assets.js.map +1 -0
  14. package/dist/repositories/automations.d.ts +30 -0
  15. package/dist/repositories/automations.js +165 -0
  16. package/dist/repositories/automations.js.map +1 -0
  17. package/dist/repositories/content.d.ts +52 -0
  18. package/dist/repositories/content.js +350 -0
  19. package/dist/repositories/content.js.map +1 -0
  20. package/dist/repositories/credentials.d.ts +25 -0
  21. package/dist/repositories/credentials.js +86 -0
  22. package/dist/repositories/credentials.js.map +1 -0
  23. package/dist/repositories/dashboard.d.ts +14 -0
  24. package/dist/repositories/dashboard.js +55 -0
  25. package/dist/repositories/dashboard.js.map +1 -0
  26. package/dist/repositories/discussion.d.ts +31 -0
  27. package/dist/repositories/discussion.js +201 -0
  28. package/dist/repositories/discussion.js.map +1 -0
  29. package/dist/repositories/entitlements.d.ts +23 -0
  30. package/dist/repositories/entitlements.js +129 -0
  31. package/dist/repositories/entitlements.js.map +1 -0
  32. package/dist/repositories/identity.d.ts +17 -0
  33. package/dist/repositories/identity.js +44 -0
  34. package/dist/repositories/identity.js.map +1 -0
  35. package/dist/repositories/integrations.d.ts +18 -0
  36. package/dist/repositories/integrations.js +65 -0
  37. package/dist/repositories/integrations.js.map +1 -0
  38. package/dist/repositories/learn.d.ts +19 -0
  39. package/dist/repositories/learn.js +54 -0
  40. package/dist/repositories/learn.js.map +1 -0
  41. package/dist/repositories/members.d.ts +16 -0
  42. package/dist/repositories/members.js +116 -0
  43. package/dist/repositories/members.js.map +1 -0
  44. package/dist/repositories/org-user-profile.d.ts +92 -0
  45. package/dist/repositories/org-user-profile.js +16 -0
  46. package/dist/repositories/org-user-profile.js.map +1 -0
  47. package/dist/repositories/organizations.d.ts +33 -0
  48. package/dist/repositories/organizations.js +198 -0
  49. package/dist/repositories/organizations.js.map +1 -0
  50. package/dist/repositories/outbox.d.ts +24 -0
  51. package/dist/repositories/outbox.js +56 -0
  52. package/dist/repositories/outbox.js.map +1 -0
  53. package/dist/repositories/pg-errors.d.ts +11 -0
  54. package/dist/repositories/pg-errors.js +15 -0
  55. package/dist/repositories/pg-errors.js.map +1 -0
  56. package/dist/repositories/progress.d.ts +18 -0
  57. package/dist/repositories/progress.js +59 -0
  58. package/dist/repositories/progress.js.map +1 -0
  59. package/dist/repositories/settings.d.ts +22 -0
  60. package/dist/repositories/settings.js +73 -0
  61. package/dist/repositories/settings.js.map +1 -0
  62. package/dist/repositories/students.d.ts +15 -0
  63. package/dist/repositories/students.js +83 -0
  64. package/dist/repositories/students.js.map +1 -0
  65. package/dist/schema/assets.d.ts +181 -0
  66. package/dist/schema/assets.js +24 -0
  67. package/dist/schema/assets.js.map +1 -0
  68. package/dist/schema/automations.d.ts +364 -0
  69. package/dist/schema/automations.js +42 -0
  70. package/dist/schema/automations.js.map +1 -0
  71. package/dist/schema/better-auth.d.ts +2311 -0
  72. package/dist/schema/better-auth.js +156 -0
  73. package/dist/schema/better-auth.js.map +1 -0
  74. package/dist/schema/content.d.ts +966 -0
  75. package/dist/schema/content.js +163 -0
  76. package/dist/schema/content.js.map +1 -0
  77. package/dist/schema/credentials.d.ts +113 -0
  78. package/dist/schema/credentials.js +15 -0
  79. package/dist/schema/credentials.js.map +1 -0
  80. package/dist/schema/discussion.d.ts +399 -0
  81. package/dist/schema/discussion.js +89 -0
  82. package/dist/schema/discussion.js.map +1 -0
  83. package/dist/schema/drift.d.ts +9 -0
  84. package/dist/schema/drift.js +1 -0
  85. package/dist/schema/entitlements.d.ts +147 -0
  86. package/dist/schema/entitlements.js +30 -0
  87. package/dist/schema/entitlements.js.map +1 -0
  88. package/dist/schema/identity.d.ts +130 -0
  89. package/dist/schema/identity.js +16 -0
  90. package/dist/schema/identity.js.map +1 -0
  91. package/dist/schema/index.d.ts +18 -0
  92. package/dist/schema/index.js +43 -0
  93. package/dist/schema/index.js.map +1 -0
  94. package/dist/schema/integrations.d.ts +149 -0
  95. package/dist/schema/integrations.js +25 -0
  96. package/dist/schema/integrations.js.map +1 -0
  97. package/dist/schema/organizations.d.ts +416 -0
  98. package/dist/schema/organizations.js +58 -0
  99. package/dist/schema/organizations.js.map +1 -0
  100. package/dist/schema/outbox.d.ts +166 -0
  101. package/dist/schema/outbox.js +19 -0
  102. package/dist/schema/outbox.js.map +1 -0
  103. package/dist/schema/progress.d.ts +166 -0
  104. package/dist/schema/progress.js +30 -0
  105. package/dist/schema/progress.js.map +1 -0
  106. package/dist/schema/settings.d.ts +115 -0
  107. package/dist/schema/settings.js +19 -0
  108. package/dist/schema/settings.js.map +1 -0
  109. package/dist/unit-of-work.d.ts +13 -0
  110. package/dist/unit-of-work.js +16 -0
  111. package/dist/unit-of-work.js.map +1 -0
  112. package/drizzle/0000_baseline.sql +526 -0
  113. package/drizzle/meta/0000_snapshot.json +3925 -0
  114. package/drizzle/meta/_journal.json +13 -0
  115. package/package.json +56 -0
@@ -0,0 +1,3925 @@
1
+ {
2
+ "id": "9d75bc8f-ed96-4e10-8e8c-2b4b683899d5",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.invites": {
8
+ "name": "invites",
9
+ "schema": "",
10
+ "columns": {
11
+ "org_id": {
12
+ "name": "org_id",
13
+ "type": "text",
14
+ "primaryKey": false,
15
+ "notNull": true
16
+ },
17
+ "id": {
18
+ "name": "id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "email": {
24
+ "name": "email",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "role": {
30
+ "name": "role",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "status": {
36
+ "name": "status",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "invited_by": {
42
+ "name": "invited_by",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": true
46
+ },
47
+ "token_hash": {
48
+ "name": "token_hash",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "expires_at": {
54
+ "name": "expires_at",
55
+ "type": "timestamp with time zone",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "created_at": {
60
+ "name": "created_at",
61
+ "type": "timestamp with time zone",
62
+ "primaryKey": false,
63
+ "notNull": true,
64
+ "default": "now()"
65
+ }
66
+ },
67
+ "indexes": {
68
+ "invites_pending_email_uq": {
69
+ "name": "invites_pending_email_uq",
70
+ "columns": [
71
+ {
72
+ "expression": "org_id",
73
+ "isExpression": false,
74
+ "asc": true,
75
+ "nulls": "last"
76
+ },
77
+ {
78
+ "expression": "email",
79
+ "isExpression": false,
80
+ "asc": true,
81
+ "nulls": "last"
82
+ }
83
+ ],
84
+ "isUnique": true,
85
+ "where": "\"invites\".\"status\" = 'pending'",
86
+ "concurrently": false,
87
+ "method": "btree",
88
+ "with": {}
89
+ }
90
+ },
91
+ "foreignKeys": {
92
+ "invites_org_id_organizations_id_fk": {
93
+ "name": "invites_org_id_organizations_id_fk",
94
+ "tableFrom": "invites",
95
+ "tableTo": "organizations",
96
+ "columnsFrom": [
97
+ "org_id"
98
+ ],
99
+ "columnsTo": [
100
+ "id"
101
+ ],
102
+ "onDelete": "no action",
103
+ "onUpdate": "no action"
104
+ },
105
+ "invites_invited_by_users_id_fk": {
106
+ "name": "invites_invited_by_users_id_fk",
107
+ "tableFrom": "invites",
108
+ "tableTo": "users",
109
+ "columnsFrom": [
110
+ "invited_by"
111
+ ],
112
+ "columnsTo": [
113
+ "id"
114
+ ],
115
+ "onDelete": "no action",
116
+ "onUpdate": "no action"
117
+ }
118
+ },
119
+ "compositePrimaryKeys": {
120
+ "invites_org_id_id_pk": {
121
+ "name": "invites_org_id_id_pk",
122
+ "columns": [
123
+ "org_id",
124
+ "id"
125
+ ]
126
+ }
127
+ },
128
+ "uniqueConstraints": {
129
+ "invites_token_hash_unique": {
130
+ "name": "invites_token_hash_unique",
131
+ "nullsNotDistinct": false,
132
+ "columns": [
133
+ "token_hash"
134
+ ]
135
+ }
136
+ },
137
+ "policies": {},
138
+ "checkConstraints": {},
139
+ "isRLSEnabled": false
140
+ },
141
+ "public.org_users": {
142
+ "name": "org_users",
143
+ "schema": "",
144
+ "columns": {
145
+ "org_id": {
146
+ "name": "org_id",
147
+ "type": "text",
148
+ "primaryKey": false,
149
+ "notNull": true
150
+ },
151
+ "id": {
152
+ "name": "id",
153
+ "type": "text",
154
+ "primaryKey": false,
155
+ "notNull": true
156
+ },
157
+ "user_id": {
158
+ "name": "user_id",
159
+ "type": "text",
160
+ "primaryKey": false,
161
+ "notNull": true
162
+ },
163
+ "role": {
164
+ "name": "role",
165
+ "type": "text",
166
+ "primaryKey": false,
167
+ "notNull": true
168
+ },
169
+ "status": {
170
+ "name": "status",
171
+ "type": "text",
172
+ "primaryKey": false,
173
+ "notNull": true,
174
+ "default": "'active'"
175
+ },
176
+ "created_at": {
177
+ "name": "created_at",
178
+ "type": "timestamp with time zone",
179
+ "primaryKey": false,
180
+ "notNull": true,
181
+ "default": "now()"
182
+ },
183
+ "updated_at": {
184
+ "name": "updated_at",
185
+ "type": "timestamp with time zone",
186
+ "primaryKey": false,
187
+ "notNull": true,
188
+ "default": "now()"
189
+ }
190
+ },
191
+ "indexes": {},
192
+ "foreignKeys": {
193
+ "org_users_org_id_organizations_id_fk": {
194
+ "name": "org_users_org_id_organizations_id_fk",
195
+ "tableFrom": "org_users",
196
+ "tableTo": "organizations",
197
+ "columnsFrom": [
198
+ "org_id"
199
+ ],
200
+ "columnsTo": [
201
+ "id"
202
+ ],
203
+ "onDelete": "no action",
204
+ "onUpdate": "no action"
205
+ },
206
+ "org_users_user_id_users_id_fk": {
207
+ "name": "org_users_user_id_users_id_fk",
208
+ "tableFrom": "org_users",
209
+ "tableTo": "users",
210
+ "columnsFrom": [
211
+ "user_id"
212
+ ],
213
+ "columnsTo": [
214
+ "id"
215
+ ],
216
+ "onDelete": "no action",
217
+ "onUpdate": "no action"
218
+ }
219
+ },
220
+ "compositePrimaryKeys": {
221
+ "org_users_org_id_id_pk": {
222
+ "name": "org_users_org_id_id_pk",
223
+ "columns": [
224
+ "org_id",
225
+ "id"
226
+ ]
227
+ }
228
+ },
229
+ "uniqueConstraints": {
230
+ "org_users_org_id_user_id_unique": {
231
+ "name": "org_users_org_id_user_id_unique",
232
+ "nullsNotDistinct": false,
233
+ "columns": [
234
+ "org_id",
235
+ "user_id"
236
+ ]
237
+ }
238
+ },
239
+ "policies": {},
240
+ "checkConstraints": {},
241
+ "isRLSEnabled": false
242
+ },
243
+ "public.organizations": {
244
+ "name": "organizations",
245
+ "schema": "",
246
+ "columns": {
247
+ "id": {
248
+ "name": "id",
249
+ "type": "text",
250
+ "primaryKey": true,
251
+ "notNull": true
252
+ },
253
+ "external_id": {
254
+ "name": "external_id",
255
+ "type": "text",
256
+ "primaryKey": false,
257
+ "notNull": false
258
+ },
259
+ "name": {
260
+ "name": "name",
261
+ "type": "text",
262
+ "primaryKey": false,
263
+ "notNull": true
264
+ },
265
+ "slug": {
266
+ "name": "slug",
267
+ "type": "text",
268
+ "primaryKey": false,
269
+ "notNull": true
270
+ },
271
+ "owner_id": {
272
+ "name": "owner_id",
273
+ "type": "text",
274
+ "primaryKey": false,
275
+ "notNull": true
276
+ },
277
+ "created_at": {
278
+ "name": "created_at",
279
+ "type": "timestamp with time zone",
280
+ "primaryKey": false,
281
+ "notNull": true,
282
+ "default": "now()"
283
+ },
284
+ "updated_at": {
285
+ "name": "updated_at",
286
+ "type": "timestamp with time zone",
287
+ "primaryKey": false,
288
+ "notNull": true,
289
+ "default": "now()"
290
+ }
291
+ },
292
+ "indexes": {},
293
+ "foreignKeys": {
294
+ "organizations_owner_id_users_id_fk": {
295
+ "name": "organizations_owner_id_users_id_fk",
296
+ "tableFrom": "organizations",
297
+ "tableTo": "users",
298
+ "columnsFrom": [
299
+ "owner_id"
300
+ ],
301
+ "columnsTo": [
302
+ "id"
303
+ ],
304
+ "onDelete": "no action",
305
+ "onUpdate": "no action"
306
+ }
307
+ },
308
+ "compositePrimaryKeys": {},
309
+ "uniqueConstraints": {
310
+ "organizations_external_id_unique": {
311
+ "name": "organizations_external_id_unique",
312
+ "nullsNotDistinct": false,
313
+ "columns": [
314
+ "external_id"
315
+ ]
316
+ },
317
+ "organizations_slug_unique": {
318
+ "name": "organizations_slug_unique",
319
+ "nullsNotDistinct": false,
320
+ "columns": [
321
+ "slug"
322
+ ]
323
+ }
324
+ },
325
+ "policies": {},
326
+ "checkConstraints": {},
327
+ "isRLSEnabled": false
328
+ },
329
+ "public.activities": {
330
+ "name": "activities",
331
+ "schema": "",
332
+ "columns": {
333
+ "org_id": {
334
+ "name": "org_id",
335
+ "type": "text",
336
+ "primaryKey": false,
337
+ "notNull": true
338
+ },
339
+ "id": {
340
+ "name": "id",
341
+ "type": "text",
342
+ "primaryKey": false,
343
+ "notNull": true
344
+ },
345
+ "module_id": {
346
+ "name": "module_id",
347
+ "type": "text",
348
+ "primaryKey": false,
349
+ "notNull": true
350
+ },
351
+ "course_id": {
352
+ "name": "course_id",
353
+ "type": "text",
354
+ "primaryKey": false,
355
+ "notNull": true
356
+ },
357
+ "seq": {
358
+ "name": "seq",
359
+ "type": "integer",
360
+ "primaryKey": false,
361
+ "notNull": true
362
+ },
363
+ "settings": {
364
+ "name": "settings",
365
+ "type": "jsonb",
366
+ "primaryKey": false,
367
+ "notNull": false
368
+ },
369
+ "created_at": {
370
+ "name": "created_at",
371
+ "type": "timestamp with time zone",
372
+ "primaryKey": false,
373
+ "notNull": true,
374
+ "default": "now()"
375
+ },
376
+ "updated_at": {
377
+ "name": "updated_at",
378
+ "type": "timestamp with time zone",
379
+ "primaryKey": false,
380
+ "notNull": true,
381
+ "default": "now()"
382
+ }
383
+ },
384
+ "indexes": {},
385
+ "foreignKeys": {
386
+ "activities_org_id_organizations_id_fk": {
387
+ "name": "activities_org_id_organizations_id_fk",
388
+ "tableFrom": "activities",
389
+ "tableTo": "organizations",
390
+ "columnsFrom": [
391
+ "org_id"
392
+ ],
393
+ "columnsTo": [
394
+ "id"
395
+ ],
396
+ "onDelete": "no action",
397
+ "onUpdate": "no action"
398
+ },
399
+ "activities_org_id_module_id_course_id_modules_org_id_id_course_id_fk": {
400
+ "name": "activities_org_id_module_id_course_id_modules_org_id_id_course_id_fk",
401
+ "tableFrom": "activities",
402
+ "tableTo": "modules",
403
+ "columnsFrom": [
404
+ "org_id",
405
+ "module_id",
406
+ "course_id"
407
+ ],
408
+ "columnsTo": [
409
+ "org_id",
410
+ "id",
411
+ "course_id"
412
+ ],
413
+ "onDelete": "cascade",
414
+ "onUpdate": "no action"
415
+ }
416
+ },
417
+ "compositePrimaryKeys": {
418
+ "activities_org_id_id_pk": {
419
+ "name": "activities_org_id_id_pk",
420
+ "columns": [
421
+ "org_id",
422
+ "id"
423
+ ]
424
+ }
425
+ },
426
+ "uniqueConstraints": {
427
+ "activities_org_id_module_id_seq_unique": {
428
+ "name": "activities_org_id_module_id_seq_unique",
429
+ "nullsNotDistinct": false,
430
+ "columns": [
431
+ "org_id",
432
+ "module_id",
433
+ "seq"
434
+ ]
435
+ }
436
+ },
437
+ "policies": {},
438
+ "checkConstraints": {},
439
+ "isRLSEnabled": false
440
+ },
441
+ "public.activity_assets": {
442
+ "name": "activity_assets",
443
+ "schema": "",
444
+ "columns": {
445
+ "org_id": {
446
+ "name": "org_id",
447
+ "type": "text",
448
+ "primaryKey": false,
449
+ "notNull": true
450
+ },
451
+ "id": {
452
+ "name": "id",
453
+ "type": "text",
454
+ "primaryKey": false,
455
+ "notNull": true
456
+ },
457
+ "activity_id": {
458
+ "name": "activity_id",
459
+ "type": "text",
460
+ "primaryKey": false,
461
+ "notNull": true
462
+ },
463
+ "asset_id": {
464
+ "name": "asset_id",
465
+ "type": "text",
466
+ "primaryKey": false,
467
+ "notNull": true
468
+ },
469
+ "seq": {
470
+ "name": "seq",
471
+ "type": "integer",
472
+ "primaryKey": false,
473
+ "notNull": true,
474
+ "default": 0
475
+ }
476
+ },
477
+ "indexes": {},
478
+ "foreignKeys": {
479
+ "activity_assets_org_id_organizations_id_fk": {
480
+ "name": "activity_assets_org_id_organizations_id_fk",
481
+ "tableFrom": "activity_assets",
482
+ "tableTo": "organizations",
483
+ "columnsFrom": [
484
+ "org_id"
485
+ ],
486
+ "columnsTo": [
487
+ "id"
488
+ ],
489
+ "onDelete": "no action",
490
+ "onUpdate": "no action"
491
+ },
492
+ "activity_assets_org_id_activity_id_activities_org_id_id_fk": {
493
+ "name": "activity_assets_org_id_activity_id_activities_org_id_id_fk",
494
+ "tableFrom": "activity_assets",
495
+ "tableTo": "activities",
496
+ "columnsFrom": [
497
+ "org_id",
498
+ "activity_id"
499
+ ],
500
+ "columnsTo": [
501
+ "org_id",
502
+ "id"
503
+ ],
504
+ "onDelete": "cascade",
505
+ "onUpdate": "no action"
506
+ },
507
+ "activity_assets_org_id_asset_id_assets_org_id_id_fk": {
508
+ "name": "activity_assets_org_id_asset_id_assets_org_id_id_fk",
509
+ "tableFrom": "activity_assets",
510
+ "tableTo": "assets",
511
+ "columnsFrom": [
512
+ "org_id",
513
+ "asset_id"
514
+ ],
515
+ "columnsTo": [
516
+ "org_id",
517
+ "id"
518
+ ],
519
+ "onDelete": "no action",
520
+ "onUpdate": "no action"
521
+ }
522
+ },
523
+ "compositePrimaryKeys": {
524
+ "activity_assets_org_id_id_pk": {
525
+ "name": "activity_assets_org_id_id_pk",
526
+ "columns": [
527
+ "org_id",
528
+ "id"
529
+ ]
530
+ }
531
+ },
532
+ "uniqueConstraints": {
533
+ "activity_assets_org_id_activity_id_asset_id_unique": {
534
+ "name": "activity_assets_org_id_activity_id_asset_id_unique",
535
+ "nullsNotDistinct": false,
536
+ "columns": [
537
+ "org_id",
538
+ "activity_id",
539
+ "asset_id"
540
+ ]
541
+ }
542
+ },
543
+ "policies": {},
544
+ "checkConstraints": {},
545
+ "isRLSEnabled": false
546
+ },
547
+ "public.content_items": {
548
+ "name": "content_items",
549
+ "schema": "",
550
+ "columns": {
551
+ "org_id": {
552
+ "name": "org_id",
553
+ "type": "text",
554
+ "primaryKey": false,
555
+ "notNull": true
556
+ },
557
+ "id": {
558
+ "name": "id",
559
+ "type": "text",
560
+ "primaryKey": false,
561
+ "notNull": true
562
+ },
563
+ "type": {
564
+ "name": "type",
565
+ "type": "text",
566
+ "primaryKey": false,
567
+ "notNull": true
568
+ },
569
+ "created_at": {
570
+ "name": "created_at",
571
+ "type": "timestamp with time zone",
572
+ "primaryKey": false,
573
+ "notNull": true,
574
+ "default": "now()"
575
+ }
576
+ },
577
+ "indexes": {},
578
+ "foreignKeys": {
579
+ "content_items_org_id_organizations_id_fk": {
580
+ "name": "content_items_org_id_organizations_id_fk",
581
+ "tableFrom": "content_items",
582
+ "tableTo": "organizations",
583
+ "columnsFrom": [
584
+ "org_id"
585
+ ],
586
+ "columnsTo": [
587
+ "id"
588
+ ],
589
+ "onDelete": "no action",
590
+ "onUpdate": "no action"
591
+ }
592
+ },
593
+ "compositePrimaryKeys": {
594
+ "content_items_org_id_id_pk": {
595
+ "name": "content_items_org_id_id_pk",
596
+ "columns": [
597
+ "org_id",
598
+ "id"
599
+ ]
600
+ }
601
+ },
602
+ "uniqueConstraints": {
603
+ "content_items_org_id_id_type_unique": {
604
+ "name": "content_items_org_id_id_type_unique",
605
+ "nullsNotDistinct": false,
606
+ "columns": [
607
+ "org_id",
608
+ "id",
609
+ "type"
610
+ ]
611
+ }
612
+ },
613
+ "policies": {},
614
+ "checkConstraints": {
615
+ "content_items_type_check": {
616
+ "name": "content_items_type_check",
617
+ "value": "\"content_items\".\"type\" in ('course', 'download')"
618
+ }
619
+ },
620
+ "isRLSEnabled": false
621
+ },
622
+ "public.courses": {
623
+ "name": "courses",
624
+ "schema": "",
625
+ "columns": {
626
+ "org_id": {
627
+ "name": "org_id",
628
+ "type": "text",
629
+ "primaryKey": false,
630
+ "notNull": true
631
+ },
632
+ "id": {
633
+ "name": "id",
634
+ "type": "text",
635
+ "primaryKey": false,
636
+ "notNull": true
637
+ },
638
+ "type": {
639
+ "name": "type",
640
+ "type": "text",
641
+ "primaryKey": false,
642
+ "notNull": true,
643
+ "generated": {
644
+ "as": "'course'",
645
+ "type": "stored"
646
+ }
647
+ },
648
+ "title": {
649
+ "name": "title",
650
+ "type": "text",
651
+ "primaryKey": false,
652
+ "notNull": true
653
+ },
654
+ "slug": {
655
+ "name": "slug",
656
+ "type": "text",
657
+ "primaryKey": false,
658
+ "notNull": true
659
+ },
660
+ "description": {
661
+ "name": "description",
662
+ "type": "text",
663
+ "primaryKey": false,
664
+ "notNull": true,
665
+ "default": "''"
666
+ },
667
+ "status": {
668
+ "name": "status",
669
+ "type": "text",
670
+ "primaryKey": false,
671
+ "notNull": true,
672
+ "default": "'draft'"
673
+ },
674
+ "category": {
675
+ "name": "category",
676
+ "type": "text",
677
+ "primaryKey": false,
678
+ "notNull": true,
679
+ "default": "''"
680
+ },
681
+ "thumbnail_asset_id": {
682
+ "name": "thumbnail_asset_id",
683
+ "type": "text",
684
+ "primaryKey": false,
685
+ "notNull": false
686
+ },
687
+ "settings": {
688
+ "name": "settings",
689
+ "type": "jsonb",
690
+ "primaryKey": false,
691
+ "notNull": true,
692
+ "default": "'{}'::jsonb"
693
+ },
694
+ "created_at": {
695
+ "name": "created_at",
696
+ "type": "timestamp with time zone",
697
+ "primaryKey": false,
698
+ "notNull": true,
699
+ "default": "now()"
700
+ },
701
+ "updated_at": {
702
+ "name": "updated_at",
703
+ "type": "timestamp with time zone",
704
+ "primaryKey": false,
705
+ "notNull": true,
706
+ "default": "now()"
707
+ }
708
+ },
709
+ "indexes": {},
710
+ "foreignKeys": {
711
+ "courses_org_id_organizations_id_fk": {
712
+ "name": "courses_org_id_organizations_id_fk",
713
+ "tableFrom": "courses",
714
+ "tableTo": "organizations",
715
+ "columnsFrom": [
716
+ "org_id"
717
+ ],
718
+ "columnsTo": [
719
+ "id"
720
+ ],
721
+ "onDelete": "no action",
722
+ "onUpdate": "no action"
723
+ },
724
+ "courses_org_id_id_type_content_items_org_id_id_type_fk": {
725
+ "name": "courses_org_id_id_type_content_items_org_id_id_type_fk",
726
+ "tableFrom": "courses",
727
+ "tableTo": "content_items",
728
+ "columnsFrom": [
729
+ "org_id",
730
+ "id",
731
+ "type"
732
+ ],
733
+ "columnsTo": [
734
+ "org_id",
735
+ "id",
736
+ "type"
737
+ ],
738
+ "onDelete": "cascade",
739
+ "onUpdate": "no action"
740
+ },
741
+ "courses_org_id_thumbnail_asset_id_assets_org_id_id_fk": {
742
+ "name": "courses_org_id_thumbnail_asset_id_assets_org_id_id_fk",
743
+ "tableFrom": "courses",
744
+ "tableTo": "assets",
745
+ "columnsFrom": [
746
+ "org_id",
747
+ "thumbnail_asset_id"
748
+ ],
749
+ "columnsTo": [
750
+ "org_id",
751
+ "id"
752
+ ],
753
+ "onDelete": "no action",
754
+ "onUpdate": "no action"
755
+ }
756
+ },
757
+ "compositePrimaryKeys": {
758
+ "courses_org_id_id_pk": {
759
+ "name": "courses_org_id_id_pk",
760
+ "columns": [
761
+ "org_id",
762
+ "id"
763
+ ]
764
+ }
765
+ },
766
+ "uniqueConstraints": {
767
+ "courses_org_id_slug_unique": {
768
+ "name": "courses_org_id_slug_unique",
769
+ "nullsNotDistinct": false,
770
+ "columns": [
771
+ "org_id",
772
+ "slug"
773
+ ]
774
+ }
775
+ },
776
+ "policies": {},
777
+ "checkConstraints": {},
778
+ "isRLSEnabled": false
779
+ },
780
+ "public.download_assets": {
781
+ "name": "download_assets",
782
+ "schema": "",
783
+ "columns": {
784
+ "org_id": {
785
+ "name": "org_id",
786
+ "type": "text",
787
+ "primaryKey": false,
788
+ "notNull": true
789
+ },
790
+ "id": {
791
+ "name": "id",
792
+ "type": "text",
793
+ "primaryKey": false,
794
+ "notNull": true
795
+ },
796
+ "download_id": {
797
+ "name": "download_id",
798
+ "type": "text",
799
+ "primaryKey": false,
800
+ "notNull": true
801
+ },
802
+ "asset_id": {
803
+ "name": "asset_id",
804
+ "type": "text",
805
+ "primaryKey": false,
806
+ "notNull": true
807
+ },
808
+ "seq": {
809
+ "name": "seq",
810
+ "type": "integer",
811
+ "primaryKey": false,
812
+ "notNull": true,
813
+ "default": 0
814
+ },
815
+ "display_name": {
816
+ "name": "display_name",
817
+ "type": "text",
818
+ "primaryKey": false,
819
+ "notNull": false
820
+ }
821
+ },
822
+ "indexes": {},
823
+ "foreignKeys": {
824
+ "download_assets_org_id_organizations_id_fk": {
825
+ "name": "download_assets_org_id_organizations_id_fk",
826
+ "tableFrom": "download_assets",
827
+ "tableTo": "organizations",
828
+ "columnsFrom": [
829
+ "org_id"
830
+ ],
831
+ "columnsTo": [
832
+ "id"
833
+ ],
834
+ "onDelete": "no action",
835
+ "onUpdate": "no action"
836
+ },
837
+ "download_assets_org_id_download_id_downloads_org_id_id_fk": {
838
+ "name": "download_assets_org_id_download_id_downloads_org_id_id_fk",
839
+ "tableFrom": "download_assets",
840
+ "tableTo": "downloads",
841
+ "columnsFrom": [
842
+ "org_id",
843
+ "download_id"
844
+ ],
845
+ "columnsTo": [
846
+ "org_id",
847
+ "id"
848
+ ],
849
+ "onDelete": "cascade",
850
+ "onUpdate": "no action"
851
+ },
852
+ "download_assets_org_id_asset_id_assets_org_id_id_fk": {
853
+ "name": "download_assets_org_id_asset_id_assets_org_id_id_fk",
854
+ "tableFrom": "download_assets",
855
+ "tableTo": "assets",
856
+ "columnsFrom": [
857
+ "org_id",
858
+ "asset_id"
859
+ ],
860
+ "columnsTo": [
861
+ "org_id",
862
+ "id"
863
+ ],
864
+ "onDelete": "no action",
865
+ "onUpdate": "no action"
866
+ }
867
+ },
868
+ "compositePrimaryKeys": {
869
+ "download_assets_org_id_id_pk": {
870
+ "name": "download_assets_org_id_id_pk",
871
+ "columns": [
872
+ "org_id",
873
+ "id"
874
+ ]
875
+ }
876
+ },
877
+ "uniqueConstraints": {
878
+ "download_assets_org_id_download_id_asset_id_unique": {
879
+ "name": "download_assets_org_id_download_id_asset_id_unique",
880
+ "nullsNotDistinct": false,
881
+ "columns": [
882
+ "org_id",
883
+ "download_id",
884
+ "asset_id"
885
+ ]
886
+ }
887
+ },
888
+ "policies": {},
889
+ "checkConstraints": {},
890
+ "isRLSEnabled": false
891
+ },
892
+ "public.downloads": {
893
+ "name": "downloads",
894
+ "schema": "",
895
+ "columns": {
896
+ "org_id": {
897
+ "name": "org_id",
898
+ "type": "text",
899
+ "primaryKey": false,
900
+ "notNull": true
901
+ },
902
+ "id": {
903
+ "name": "id",
904
+ "type": "text",
905
+ "primaryKey": false,
906
+ "notNull": true
907
+ },
908
+ "type": {
909
+ "name": "type",
910
+ "type": "text",
911
+ "primaryKey": false,
912
+ "notNull": true,
913
+ "generated": {
914
+ "as": "'download'",
915
+ "type": "stored"
916
+ }
917
+ },
918
+ "title": {
919
+ "name": "title",
920
+ "type": "text",
921
+ "primaryKey": false,
922
+ "notNull": true
923
+ },
924
+ "slug": {
925
+ "name": "slug",
926
+ "type": "text",
927
+ "primaryKey": false,
928
+ "notNull": true
929
+ },
930
+ "description": {
931
+ "name": "description",
932
+ "type": "text",
933
+ "primaryKey": false,
934
+ "notNull": true,
935
+ "default": "''"
936
+ },
937
+ "status": {
938
+ "name": "status",
939
+ "type": "text",
940
+ "primaryKey": false,
941
+ "notNull": true,
942
+ "default": "'draft'"
943
+ },
944
+ "category": {
945
+ "name": "category",
946
+ "type": "text",
947
+ "primaryKey": false,
948
+ "notNull": true,
949
+ "default": "''"
950
+ },
951
+ "thumbnail_asset_id": {
952
+ "name": "thumbnail_asset_id",
953
+ "type": "text",
954
+ "primaryKey": false,
955
+ "notNull": false
956
+ },
957
+ "created_at": {
958
+ "name": "created_at",
959
+ "type": "timestamp with time zone",
960
+ "primaryKey": false,
961
+ "notNull": true,
962
+ "default": "now()"
963
+ },
964
+ "updated_at": {
965
+ "name": "updated_at",
966
+ "type": "timestamp with time zone",
967
+ "primaryKey": false,
968
+ "notNull": true,
969
+ "default": "now()"
970
+ }
971
+ },
972
+ "indexes": {},
973
+ "foreignKeys": {
974
+ "downloads_org_id_organizations_id_fk": {
975
+ "name": "downloads_org_id_organizations_id_fk",
976
+ "tableFrom": "downloads",
977
+ "tableTo": "organizations",
978
+ "columnsFrom": [
979
+ "org_id"
980
+ ],
981
+ "columnsTo": [
982
+ "id"
983
+ ],
984
+ "onDelete": "no action",
985
+ "onUpdate": "no action"
986
+ },
987
+ "downloads_org_id_id_type_content_items_org_id_id_type_fk": {
988
+ "name": "downloads_org_id_id_type_content_items_org_id_id_type_fk",
989
+ "tableFrom": "downloads",
990
+ "tableTo": "content_items",
991
+ "columnsFrom": [
992
+ "org_id",
993
+ "id",
994
+ "type"
995
+ ],
996
+ "columnsTo": [
997
+ "org_id",
998
+ "id",
999
+ "type"
1000
+ ],
1001
+ "onDelete": "cascade",
1002
+ "onUpdate": "no action"
1003
+ },
1004
+ "downloads_org_id_thumbnail_asset_id_assets_org_id_id_fk": {
1005
+ "name": "downloads_org_id_thumbnail_asset_id_assets_org_id_id_fk",
1006
+ "tableFrom": "downloads",
1007
+ "tableTo": "assets",
1008
+ "columnsFrom": [
1009
+ "org_id",
1010
+ "thumbnail_asset_id"
1011
+ ],
1012
+ "columnsTo": [
1013
+ "org_id",
1014
+ "id"
1015
+ ],
1016
+ "onDelete": "no action",
1017
+ "onUpdate": "no action"
1018
+ }
1019
+ },
1020
+ "compositePrimaryKeys": {
1021
+ "downloads_org_id_id_pk": {
1022
+ "name": "downloads_org_id_id_pk",
1023
+ "columns": [
1024
+ "org_id",
1025
+ "id"
1026
+ ]
1027
+ }
1028
+ },
1029
+ "uniqueConstraints": {
1030
+ "downloads_org_id_slug_unique": {
1031
+ "name": "downloads_org_id_slug_unique",
1032
+ "nullsNotDistinct": false,
1033
+ "columns": [
1034
+ "org_id",
1035
+ "slug"
1036
+ ]
1037
+ }
1038
+ },
1039
+ "policies": {},
1040
+ "checkConstraints": {},
1041
+ "isRLSEnabled": false
1042
+ },
1043
+ "public.modules": {
1044
+ "name": "modules",
1045
+ "schema": "",
1046
+ "columns": {
1047
+ "org_id": {
1048
+ "name": "org_id",
1049
+ "type": "text",
1050
+ "primaryKey": false,
1051
+ "notNull": true
1052
+ },
1053
+ "id": {
1054
+ "name": "id",
1055
+ "type": "text",
1056
+ "primaryKey": false,
1057
+ "notNull": true
1058
+ },
1059
+ "course_id": {
1060
+ "name": "course_id",
1061
+ "type": "text",
1062
+ "primaryKey": false,
1063
+ "notNull": true
1064
+ },
1065
+ "title": {
1066
+ "name": "title",
1067
+ "type": "text",
1068
+ "primaryKey": false,
1069
+ "notNull": true
1070
+ },
1071
+ "seq": {
1072
+ "name": "seq",
1073
+ "type": "integer",
1074
+ "primaryKey": false,
1075
+ "notNull": true
1076
+ },
1077
+ "created_at": {
1078
+ "name": "created_at",
1079
+ "type": "timestamp with time zone",
1080
+ "primaryKey": false,
1081
+ "notNull": true,
1082
+ "default": "now()"
1083
+ },
1084
+ "updated_at": {
1085
+ "name": "updated_at",
1086
+ "type": "timestamp with time zone",
1087
+ "primaryKey": false,
1088
+ "notNull": true,
1089
+ "default": "now()"
1090
+ }
1091
+ },
1092
+ "indexes": {},
1093
+ "foreignKeys": {
1094
+ "modules_org_id_organizations_id_fk": {
1095
+ "name": "modules_org_id_organizations_id_fk",
1096
+ "tableFrom": "modules",
1097
+ "tableTo": "organizations",
1098
+ "columnsFrom": [
1099
+ "org_id"
1100
+ ],
1101
+ "columnsTo": [
1102
+ "id"
1103
+ ],
1104
+ "onDelete": "no action",
1105
+ "onUpdate": "no action"
1106
+ },
1107
+ "modules_org_id_course_id_courses_org_id_id_fk": {
1108
+ "name": "modules_org_id_course_id_courses_org_id_id_fk",
1109
+ "tableFrom": "modules",
1110
+ "tableTo": "courses",
1111
+ "columnsFrom": [
1112
+ "org_id",
1113
+ "course_id"
1114
+ ],
1115
+ "columnsTo": [
1116
+ "org_id",
1117
+ "id"
1118
+ ],
1119
+ "onDelete": "cascade",
1120
+ "onUpdate": "no action"
1121
+ }
1122
+ },
1123
+ "compositePrimaryKeys": {
1124
+ "modules_org_id_id_pk": {
1125
+ "name": "modules_org_id_id_pk",
1126
+ "columns": [
1127
+ "org_id",
1128
+ "id"
1129
+ ]
1130
+ }
1131
+ },
1132
+ "uniqueConstraints": {
1133
+ "modules_org_id_id_course_id_unique": {
1134
+ "name": "modules_org_id_id_course_id_unique",
1135
+ "nullsNotDistinct": false,
1136
+ "columns": [
1137
+ "org_id",
1138
+ "id",
1139
+ "course_id"
1140
+ ]
1141
+ }
1142
+ },
1143
+ "policies": {},
1144
+ "checkConstraints": {},
1145
+ "isRLSEnabled": false
1146
+ },
1147
+ "public.entitlements": {
1148
+ "name": "entitlements",
1149
+ "schema": "",
1150
+ "columns": {
1151
+ "org_id": {
1152
+ "name": "org_id",
1153
+ "type": "text",
1154
+ "primaryKey": false,
1155
+ "notNull": true
1156
+ },
1157
+ "id": {
1158
+ "name": "id",
1159
+ "type": "text",
1160
+ "primaryKey": false,
1161
+ "notNull": true
1162
+ },
1163
+ "org_user_id": {
1164
+ "name": "org_user_id",
1165
+ "type": "text",
1166
+ "primaryKey": false,
1167
+ "notNull": true
1168
+ },
1169
+ "content_id": {
1170
+ "name": "content_id",
1171
+ "type": "text",
1172
+ "primaryKey": false,
1173
+ "notNull": true
1174
+ },
1175
+ "status": {
1176
+ "name": "status",
1177
+ "type": "text",
1178
+ "primaryKey": false,
1179
+ "notNull": true,
1180
+ "default": "'active'"
1181
+ },
1182
+ "source": {
1183
+ "name": "source",
1184
+ "type": "text",
1185
+ "primaryKey": false,
1186
+ "notNull": true,
1187
+ "default": "'manual'"
1188
+ },
1189
+ "granted_at": {
1190
+ "name": "granted_at",
1191
+ "type": "timestamp with time zone",
1192
+ "primaryKey": false,
1193
+ "notNull": true,
1194
+ "default": "now()"
1195
+ },
1196
+ "expires_at": {
1197
+ "name": "expires_at",
1198
+ "type": "timestamp with time zone",
1199
+ "primaryKey": false,
1200
+ "notNull": false
1201
+ }
1202
+ },
1203
+ "indexes": {},
1204
+ "foreignKeys": {
1205
+ "entitlements_org_id_organizations_id_fk": {
1206
+ "name": "entitlements_org_id_organizations_id_fk",
1207
+ "tableFrom": "entitlements",
1208
+ "tableTo": "organizations",
1209
+ "columnsFrom": [
1210
+ "org_id"
1211
+ ],
1212
+ "columnsTo": [
1213
+ "id"
1214
+ ],
1215
+ "onDelete": "no action",
1216
+ "onUpdate": "no action"
1217
+ },
1218
+ "entitlements_org_id_content_id_content_items_org_id_id_fk": {
1219
+ "name": "entitlements_org_id_content_id_content_items_org_id_id_fk",
1220
+ "tableFrom": "entitlements",
1221
+ "tableTo": "content_items",
1222
+ "columnsFrom": [
1223
+ "org_id",
1224
+ "content_id"
1225
+ ],
1226
+ "columnsTo": [
1227
+ "org_id",
1228
+ "id"
1229
+ ],
1230
+ "onDelete": "cascade",
1231
+ "onUpdate": "no action"
1232
+ },
1233
+ "entitlements_org_id_org_user_id_org_users_org_id_id_fk": {
1234
+ "name": "entitlements_org_id_org_user_id_org_users_org_id_id_fk",
1235
+ "tableFrom": "entitlements",
1236
+ "tableTo": "org_users",
1237
+ "columnsFrom": [
1238
+ "org_id",
1239
+ "org_user_id"
1240
+ ],
1241
+ "columnsTo": [
1242
+ "org_id",
1243
+ "id"
1244
+ ],
1245
+ "onDelete": "cascade",
1246
+ "onUpdate": "no action"
1247
+ }
1248
+ },
1249
+ "compositePrimaryKeys": {
1250
+ "entitlements_org_id_id_pk": {
1251
+ "name": "entitlements_org_id_id_pk",
1252
+ "columns": [
1253
+ "org_id",
1254
+ "id"
1255
+ ]
1256
+ }
1257
+ },
1258
+ "uniqueConstraints": {
1259
+ "entitlements_org_id_org_user_id_content_id_unique": {
1260
+ "name": "entitlements_org_id_org_user_id_content_id_unique",
1261
+ "nullsNotDistinct": false,
1262
+ "columns": [
1263
+ "org_id",
1264
+ "org_user_id",
1265
+ "content_id"
1266
+ ]
1267
+ }
1268
+ },
1269
+ "policies": {},
1270
+ "checkConstraints": {},
1271
+ "isRLSEnabled": false
1272
+ },
1273
+ "public.progress_records": {
1274
+ "name": "progress_records",
1275
+ "schema": "",
1276
+ "columns": {
1277
+ "org_id": {
1278
+ "name": "org_id",
1279
+ "type": "text",
1280
+ "primaryKey": false,
1281
+ "notNull": true
1282
+ },
1283
+ "id": {
1284
+ "name": "id",
1285
+ "type": "text",
1286
+ "primaryKey": false,
1287
+ "notNull": true
1288
+ },
1289
+ "org_user_id": {
1290
+ "name": "org_user_id",
1291
+ "type": "text",
1292
+ "primaryKey": false,
1293
+ "notNull": true
1294
+ },
1295
+ "target_type": {
1296
+ "name": "target_type",
1297
+ "type": "text",
1298
+ "primaryKey": false,
1299
+ "notNull": true
1300
+ },
1301
+ "target_id": {
1302
+ "name": "target_id",
1303
+ "type": "text",
1304
+ "primaryKey": false,
1305
+ "notNull": true
1306
+ },
1307
+ "started_at": {
1308
+ "name": "started_at",
1309
+ "type": "timestamp with time zone",
1310
+ "primaryKey": false,
1311
+ "notNull": true,
1312
+ "default": "now()"
1313
+ },
1314
+ "position": {
1315
+ "name": "position",
1316
+ "type": "jsonb",
1317
+ "primaryKey": false,
1318
+ "notNull": false
1319
+ },
1320
+ "completed_at": {
1321
+ "name": "completed_at",
1322
+ "type": "timestamp with time zone",
1323
+ "primaryKey": false,
1324
+ "notNull": false
1325
+ },
1326
+ "updated_at": {
1327
+ "name": "updated_at",
1328
+ "type": "timestamp with time zone",
1329
+ "primaryKey": false,
1330
+ "notNull": true,
1331
+ "default": "now()"
1332
+ }
1333
+ },
1334
+ "indexes": {},
1335
+ "foreignKeys": {
1336
+ "progress_records_org_id_organizations_id_fk": {
1337
+ "name": "progress_records_org_id_organizations_id_fk",
1338
+ "tableFrom": "progress_records",
1339
+ "tableTo": "organizations",
1340
+ "columnsFrom": [
1341
+ "org_id"
1342
+ ],
1343
+ "columnsTo": [
1344
+ "id"
1345
+ ],
1346
+ "onDelete": "no action",
1347
+ "onUpdate": "no action"
1348
+ },
1349
+ "progress_records_org_id_org_user_id_org_users_org_id_id_fk": {
1350
+ "name": "progress_records_org_id_org_user_id_org_users_org_id_id_fk",
1351
+ "tableFrom": "progress_records",
1352
+ "tableTo": "org_users",
1353
+ "columnsFrom": [
1354
+ "org_id",
1355
+ "org_user_id"
1356
+ ],
1357
+ "columnsTo": [
1358
+ "org_id",
1359
+ "id"
1360
+ ],
1361
+ "onDelete": "no action",
1362
+ "onUpdate": "no action"
1363
+ }
1364
+ },
1365
+ "compositePrimaryKeys": {
1366
+ "progress_records_org_id_id_pk": {
1367
+ "name": "progress_records_org_id_id_pk",
1368
+ "columns": [
1369
+ "org_id",
1370
+ "id"
1371
+ ]
1372
+ }
1373
+ },
1374
+ "uniqueConstraints": {
1375
+ "progress_records_org_id_org_user_id_target_type_target_id_unique": {
1376
+ "name": "progress_records_org_id_org_user_id_target_type_target_id_unique",
1377
+ "nullsNotDistinct": false,
1378
+ "columns": [
1379
+ "org_id",
1380
+ "org_user_id",
1381
+ "target_type",
1382
+ "target_id"
1383
+ ]
1384
+ }
1385
+ },
1386
+ "policies": {},
1387
+ "checkConstraints": {},
1388
+ "isRLSEnabled": false
1389
+ },
1390
+ "public.users": {
1391
+ "name": "users",
1392
+ "schema": "",
1393
+ "columns": {
1394
+ "id": {
1395
+ "name": "id",
1396
+ "type": "text",
1397
+ "primaryKey": true,
1398
+ "notNull": true
1399
+ },
1400
+ "external_id": {
1401
+ "name": "external_id",
1402
+ "type": "text",
1403
+ "primaryKey": false,
1404
+ "notNull": false
1405
+ },
1406
+ "email": {
1407
+ "name": "email",
1408
+ "type": "text",
1409
+ "primaryKey": false,
1410
+ "notNull": true
1411
+ },
1412
+ "first_name": {
1413
+ "name": "first_name",
1414
+ "type": "text",
1415
+ "primaryKey": false,
1416
+ "notNull": false
1417
+ },
1418
+ "last_name": {
1419
+ "name": "last_name",
1420
+ "type": "text",
1421
+ "primaryKey": false,
1422
+ "notNull": false
1423
+ },
1424
+ "created_at": {
1425
+ "name": "created_at",
1426
+ "type": "timestamp with time zone",
1427
+ "primaryKey": false,
1428
+ "notNull": true,
1429
+ "default": "now()"
1430
+ },
1431
+ "updated_at": {
1432
+ "name": "updated_at",
1433
+ "type": "timestamp with time zone",
1434
+ "primaryKey": false,
1435
+ "notNull": true,
1436
+ "default": "now()"
1437
+ }
1438
+ },
1439
+ "indexes": {},
1440
+ "foreignKeys": {},
1441
+ "compositePrimaryKeys": {},
1442
+ "uniqueConstraints": {
1443
+ "users_external_id_unique": {
1444
+ "name": "users_external_id_unique",
1445
+ "nullsNotDistinct": false,
1446
+ "columns": [
1447
+ "external_id"
1448
+ ]
1449
+ },
1450
+ "users_email_unique": {
1451
+ "name": "users_email_unique",
1452
+ "nullsNotDistinct": false,
1453
+ "columns": [
1454
+ "email"
1455
+ ]
1456
+ }
1457
+ },
1458
+ "policies": {},
1459
+ "checkConstraints": {},
1460
+ "isRLSEnabled": false
1461
+ },
1462
+ "public.assets": {
1463
+ "name": "assets",
1464
+ "schema": "",
1465
+ "columns": {
1466
+ "org_id": {
1467
+ "name": "org_id",
1468
+ "type": "text",
1469
+ "primaryKey": false,
1470
+ "notNull": true
1471
+ },
1472
+ "id": {
1473
+ "name": "id",
1474
+ "type": "text",
1475
+ "primaryKey": false,
1476
+ "notNull": true
1477
+ },
1478
+ "key": {
1479
+ "name": "key",
1480
+ "type": "text",
1481
+ "primaryKey": false,
1482
+ "notNull": true
1483
+ },
1484
+ "kind": {
1485
+ "name": "kind",
1486
+ "type": "text",
1487
+ "primaryKey": false,
1488
+ "notNull": true
1489
+ },
1490
+ "filename": {
1491
+ "name": "filename",
1492
+ "type": "text",
1493
+ "primaryKey": false,
1494
+ "notNull": true
1495
+ },
1496
+ "content_type": {
1497
+ "name": "content_type",
1498
+ "type": "text",
1499
+ "primaryKey": false,
1500
+ "notNull": true
1501
+ },
1502
+ "size": {
1503
+ "name": "size",
1504
+ "type": "bigint",
1505
+ "primaryKey": false,
1506
+ "notNull": true,
1507
+ "default": 0
1508
+ },
1509
+ "status": {
1510
+ "name": "status",
1511
+ "type": "text",
1512
+ "primaryKey": false,
1513
+ "notNull": true,
1514
+ "default": "'pending'"
1515
+ },
1516
+ "uploaded_by": {
1517
+ "name": "uploaded_by",
1518
+ "type": "text",
1519
+ "primaryKey": false,
1520
+ "notNull": true
1521
+ },
1522
+ "created_at": {
1523
+ "name": "created_at",
1524
+ "type": "timestamp with time zone",
1525
+ "primaryKey": false,
1526
+ "notNull": true,
1527
+ "default": "now()"
1528
+ }
1529
+ },
1530
+ "indexes": {},
1531
+ "foreignKeys": {
1532
+ "assets_org_id_organizations_id_fk": {
1533
+ "name": "assets_org_id_organizations_id_fk",
1534
+ "tableFrom": "assets",
1535
+ "tableTo": "organizations",
1536
+ "columnsFrom": [
1537
+ "org_id"
1538
+ ],
1539
+ "columnsTo": [
1540
+ "id"
1541
+ ],
1542
+ "onDelete": "no action",
1543
+ "onUpdate": "no action"
1544
+ }
1545
+ },
1546
+ "compositePrimaryKeys": {
1547
+ "assets_org_id_id_pk": {
1548
+ "name": "assets_org_id_id_pk",
1549
+ "columns": [
1550
+ "org_id",
1551
+ "id"
1552
+ ]
1553
+ }
1554
+ },
1555
+ "uniqueConstraints": {},
1556
+ "policies": {},
1557
+ "checkConstraints": {},
1558
+ "isRLSEnabled": false
1559
+ },
1560
+ "public.credentials": {
1561
+ "name": "credentials",
1562
+ "schema": "",
1563
+ "columns": {
1564
+ "org_id": {
1565
+ "name": "org_id",
1566
+ "type": "text",
1567
+ "primaryKey": false,
1568
+ "notNull": true
1569
+ },
1570
+ "id": {
1571
+ "name": "id",
1572
+ "type": "text",
1573
+ "primaryKey": false,
1574
+ "notNull": true
1575
+ },
1576
+ "ciphertext": {
1577
+ "name": "ciphertext",
1578
+ "type": "text",
1579
+ "primaryKey": false,
1580
+ "notNull": true
1581
+ },
1582
+ "key_version": {
1583
+ "name": "key_version",
1584
+ "type": "integer",
1585
+ "primaryKey": false,
1586
+ "notNull": true,
1587
+ "default": 1
1588
+ },
1589
+ "created_at": {
1590
+ "name": "created_at",
1591
+ "type": "timestamp with time zone",
1592
+ "primaryKey": false,
1593
+ "notNull": true,
1594
+ "default": "now()"
1595
+ },
1596
+ "updated_at": {
1597
+ "name": "updated_at",
1598
+ "type": "timestamp with time zone",
1599
+ "primaryKey": false,
1600
+ "notNull": true,
1601
+ "default": "now()"
1602
+ }
1603
+ },
1604
+ "indexes": {},
1605
+ "foreignKeys": {
1606
+ "credentials_org_id_organizations_id_fk": {
1607
+ "name": "credentials_org_id_organizations_id_fk",
1608
+ "tableFrom": "credentials",
1609
+ "tableTo": "organizations",
1610
+ "columnsFrom": [
1611
+ "org_id"
1612
+ ],
1613
+ "columnsTo": [
1614
+ "id"
1615
+ ],
1616
+ "onDelete": "no action",
1617
+ "onUpdate": "no action"
1618
+ }
1619
+ },
1620
+ "compositePrimaryKeys": {
1621
+ "credentials_org_id_id_pk": {
1622
+ "name": "credentials_org_id_id_pk",
1623
+ "columns": [
1624
+ "org_id",
1625
+ "id"
1626
+ ]
1627
+ }
1628
+ },
1629
+ "uniqueConstraints": {},
1630
+ "policies": {},
1631
+ "checkConstraints": {},
1632
+ "isRLSEnabled": false
1633
+ },
1634
+ "public.connections": {
1635
+ "name": "connections",
1636
+ "schema": "",
1637
+ "columns": {
1638
+ "org_id": {
1639
+ "name": "org_id",
1640
+ "type": "text",
1641
+ "primaryKey": false,
1642
+ "notNull": true
1643
+ },
1644
+ "id": {
1645
+ "name": "id",
1646
+ "type": "text",
1647
+ "primaryKey": false,
1648
+ "notNull": true
1649
+ },
1650
+ "integration_id": {
1651
+ "name": "integration_id",
1652
+ "type": "text",
1653
+ "primaryKey": false,
1654
+ "notNull": true
1655
+ },
1656
+ "config": {
1657
+ "name": "config",
1658
+ "type": "jsonb",
1659
+ "primaryKey": false,
1660
+ "notNull": true,
1661
+ "default": "'{}'::jsonb"
1662
+ },
1663
+ "active": {
1664
+ "name": "active",
1665
+ "type": "boolean",
1666
+ "primaryKey": false,
1667
+ "notNull": true,
1668
+ "default": true
1669
+ },
1670
+ "credential_ref": {
1671
+ "name": "credential_ref",
1672
+ "type": "text",
1673
+ "primaryKey": false,
1674
+ "notNull": true
1675
+ },
1676
+ "created_at": {
1677
+ "name": "created_at",
1678
+ "type": "timestamp with time zone",
1679
+ "primaryKey": false,
1680
+ "notNull": true,
1681
+ "default": "now()"
1682
+ },
1683
+ "updated_at": {
1684
+ "name": "updated_at",
1685
+ "type": "timestamp with time zone",
1686
+ "primaryKey": false,
1687
+ "notNull": true,
1688
+ "default": "now()"
1689
+ }
1690
+ },
1691
+ "indexes": {},
1692
+ "foreignKeys": {
1693
+ "connections_org_id_organizations_id_fk": {
1694
+ "name": "connections_org_id_organizations_id_fk",
1695
+ "tableFrom": "connections",
1696
+ "tableTo": "organizations",
1697
+ "columnsFrom": [
1698
+ "org_id"
1699
+ ],
1700
+ "columnsTo": [
1701
+ "id"
1702
+ ],
1703
+ "onDelete": "no action",
1704
+ "onUpdate": "no action"
1705
+ },
1706
+ "connections_org_id_credential_ref_credentials_org_id_id_fk": {
1707
+ "name": "connections_org_id_credential_ref_credentials_org_id_id_fk",
1708
+ "tableFrom": "connections",
1709
+ "tableTo": "credentials",
1710
+ "columnsFrom": [
1711
+ "org_id",
1712
+ "credential_ref"
1713
+ ],
1714
+ "columnsTo": [
1715
+ "org_id",
1716
+ "id"
1717
+ ],
1718
+ "onDelete": "no action",
1719
+ "onUpdate": "no action"
1720
+ }
1721
+ },
1722
+ "compositePrimaryKeys": {
1723
+ "connections_org_id_id_pk": {
1724
+ "name": "connections_org_id_id_pk",
1725
+ "columns": [
1726
+ "org_id",
1727
+ "id"
1728
+ ]
1729
+ }
1730
+ },
1731
+ "uniqueConstraints": {
1732
+ "connections_org_id_integration_id_unique": {
1733
+ "name": "connections_org_id_integration_id_unique",
1734
+ "nullsNotDistinct": false,
1735
+ "columns": [
1736
+ "org_id",
1737
+ "integration_id"
1738
+ ]
1739
+ }
1740
+ },
1741
+ "policies": {},
1742
+ "checkConstraints": {},
1743
+ "isRLSEnabled": false
1744
+ },
1745
+ "public.event_outbox": {
1746
+ "name": "event_outbox",
1747
+ "schema": "",
1748
+ "columns": {
1749
+ "org_id": {
1750
+ "name": "org_id",
1751
+ "type": "text",
1752
+ "primaryKey": false,
1753
+ "notNull": true
1754
+ },
1755
+ "id": {
1756
+ "name": "id",
1757
+ "type": "text",
1758
+ "primaryKey": true,
1759
+ "notNull": true
1760
+ },
1761
+ "type": {
1762
+ "name": "type",
1763
+ "type": "text",
1764
+ "primaryKey": false,
1765
+ "notNull": true
1766
+ },
1767
+ "payload": {
1768
+ "name": "payload",
1769
+ "type": "jsonb",
1770
+ "primaryKey": false,
1771
+ "notNull": true
1772
+ },
1773
+ "attempts": {
1774
+ "name": "attempts",
1775
+ "type": "integer",
1776
+ "primaryKey": false,
1777
+ "notNull": true,
1778
+ "default": 0
1779
+ },
1780
+ "next_attempt_at": {
1781
+ "name": "next_attempt_at",
1782
+ "type": "timestamp with time zone",
1783
+ "primaryKey": false,
1784
+ "notNull": true,
1785
+ "default": "now()"
1786
+ },
1787
+ "last_error": {
1788
+ "name": "last_error",
1789
+ "type": "text",
1790
+ "primaryKey": false,
1791
+ "notNull": false
1792
+ },
1793
+ "created_at": {
1794
+ "name": "created_at",
1795
+ "type": "timestamp with time zone",
1796
+ "primaryKey": false,
1797
+ "notNull": true,
1798
+ "default": "now()"
1799
+ },
1800
+ "processed_at": {
1801
+ "name": "processed_at",
1802
+ "type": "timestamp with time zone",
1803
+ "primaryKey": false,
1804
+ "notNull": false
1805
+ }
1806
+ },
1807
+ "indexes": {
1808
+ "event_outbox_pending_idx": {
1809
+ "name": "event_outbox_pending_idx",
1810
+ "columns": [
1811
+ {
1812
+ "expression": "id",
1813
+ "isExpression": false,
1814
+ "asc": true,
1815
+ "nulls": "last"
1816
+ }
1817
+ ],
1818
+ "isUnique": false,
1819
+ "where": "\"event_outbox\".\"processed_at\" is null",
1820
+ "concurrently": false,
1821
+ "method": "btree",
1822
+ "with": {}
1823
+ }
1824
+ },
1825
+ "foreignKeys": {},
1826
+ "compositePrimaryKeys": {},
1827
+ "uniqueConstraints": {},
1828
+ "policies": {},
1829
+ "checkConstraints": {},
1830
+ "isRLSEnabled": false
1831
+ },
1832
+ "public.automation_runs": {
1833
+ "name": "automation_runs",
1834
+ "schema": "",
1835
+ "columns": {
1836
+ "org_id": {
1837
+ "name": "org_id",
1838
+ "type": "text",
1839
+ "primaryKey": false,
1840
+ "notNull": true
1841
+ },
1842
+ "id": {
1843
+ "name": "id",
1844
+ "type": "text",
1845
+ "primaryKey": false,
1846
+ "notNull": true
1847
+ },
1848
+ "automation_id": {
1849
+ "name": "automation_id",
1850
+ "type": "text",
1851
+ "primaryKey": false,
1852
+ "notNull": true
1853
+ },
1854
+ "trigger": {
1855
+ "name": "trigger",
1856
+ "type": "text",
1857
+ "primaryKey": false,
1858
+ "notNull": true
1859
+ },
1860
+ "event_id": {
1861
+ "name": "event_id",
1862
+ "type": "text",
1863
+ "primaryKey": false,
1864
+ "notNull": true
1865
+ },
1866
+ "event": {
1867
+ "name": "event",
1868
+ "type": "jsonb",
1869
+ "primaryKey": false,
1870
+ "notNull": true
1871
+ },
1872
+ "status": {
1873
+ "name": "status",
1874
+ "type": "text",
1875
+ "primaryKey": false,
1876
+ "notNull": true
1877
+ },
1878
+ "action_results": {
1879
+ "name": "action_results",
1880
+ "type": "jsonb",
1881
+ "primaryKey": false,
1882
+ "notNull": true,
1883
+ "default": "'[]'::jsonb"
1884
+ },
1885
+ "started_at": {
1886
+ "name": "started_at",
1887
+ "type": "timestamp with time zone",
1888
+ "primaryKey": false,
1889
+ "notNull": true
1890
+ },
1891
+ "finished_at": {
1892
+ "name": "finished_at",
1893
+ "type": "timestamp with time zone",
1894
+ "primaryKey": false,
1895
+ "notNull": false
1896
+ }
1897
+ },
1898
+ "indexes": {
1899
+ "automation_runs_org_automation_idx": {
1900
+ "name": "automation_runs_org_automation_idx",
1901
+ "columns": [
1902
+ {
1903
+ "expression": "org_id",
1904
+ "isExpression": false,
1905
+ "asc": true,
1906
+ "nulls": "last"
1907
+ },
1908
+ {
1909
+ "expression": "automation_id",
1910
+ "isExpression": false,
1911
+ "asc": true,
1912
+ "nulls": "last"
1913
+ }
1914
+ ],
1915
+ "isUnique": false,
1916
+ "concurrently": false,
1917
+ "method": "btree",
1918
+ "with": {}
1919
+ },
1920
+ "automation_runs_org_automation_event_idx": {
1921
+ "name": "automation_runs_org_automation_event_idx",
1922
+ "columns": [
1923
+ {
1924
+ "expression": "org_id",
1925
+ "isExpression": false,
1926
+ "asc": true,
1927
+ "nulls": "last"
1928
+ },
1929
+ {
1930
+ "expression": "automation_id",
1931
+ "isExpression": false,
1932
+ "asc": true,
1933
+ "nulls": "last"
1934
+ },
1935
+ {
1936
+ "expression": "event_id",
1937
+ "isExpression": false,
1938
+ "asc": true,
1939
+ "nulls": "last"
1940
+ }
1941
+ ],
1942
+ "isUnique": true,
1943
+ "concurrently": false,
1944
+ "method": "btree",
1945
+ "with": {}
1946
+ }
1947
+ },
1948
+ "foreignKeys": {
1949
+ "automation_runs_org_id_organizations_id_fk": {
1950
+ "name": "automation_runs_org_id_organizations_id_fk",
1951
+ "tableFrom": "automation_runs",
1952
+ "tableTo": "organizations",
1953
+ "columnsFrom": [
1954
+ "org_id"
1955
+ ],
1956
+ "columnsTo": [
1957
+ "id"
1958
+ ],
1959
+ "onDelete": "no action",
1960
+ "onUpdate": "no action"
1961
+ }
1962
+ },
1963
+ "compositePrimaryKeys": {
1964
+ "automation_runs_org_id_id_pk": {
1965
+ "name": "automation_runs_org_id_id_pk",
1966
+ "columns": [
1967
+ "org_id",
1968
+ "id"
1969
+ ]
1970
+ }
1971
+ },
1972
+ "uniqueConstraints": {},
1973
+ "policies": {},
1974
+ "checkConstraints": {},
1975
+ "isRLSEnabled": false
1976
+ },
1977
+ "public.automations": {
1978
+ "name": "automations",
1979
+ "schema": "",
1980
+ "columns": {
1981
+ "org_id": {
1982
+ "name": "org_id",
1983
+ "type": "text",
1984
+ "primaryKey": false,
1985
+ "notNull": true
1986
+ },
1987
+ "id": {
1988
+ "name": "id",
1989
+ "type": "text",
1990
+ "primaryKey": false,
1991
+ "notNull": true
1992
+ },
1993
+ "name": {
1994
+ "name": "name",
1995
+ "type": "text",
1996
+ "primaryKey": false,
1997
+ "notNull": true
1998
+ },
1999
+ "description": {
2000
+ "name": "description",
2001
+ "type": "text",
2002
+ "primaryKey": false,
2003
+ "notNull": false
2004
+ },
2005
+ "trigger": {
2006
+ "name": "trigger",
2007
+ "type": "text",
2008
+ "primaryKey": false,
2009
+ "notNull": true
2010
+ },
2011
+ "actions": {
2012
+ "name": "actions",
2013
+ "type": "jsonb",
2014
+ "primaryKey": false,
2015
+ "notNull": true
2016
+ },
2017
+ "enabled": {
2018
+ "name": "enabled",
2019
+ "type": "boolean",
2020
+ "primaryKey": false,
2021
+ "notNull": true,
2022
+ "default": true
2023
+ },
2024
+ "created_at": {
2025
+ "name": "created_at",
2026
+ "type": "timestamp with time zone",
2027
+ "primaryKey": false,
2028
+ "notNull": true,
2029
+ "default": "now()"
2030
+ },
2031
+ "updated_at": {
2032
+ "name": "updated_at",
2033
+ "type": "timestamp with time zone",
2034
+ "primaryKey": false,
2035
+ "notNull": true,
2036
+ "default": "now()"
2037
+ }
2038
+ },
2039
+ "indexes": {
2040
+ "automations_org_trigger_idx": {
2041
+ "name": "automations_org_trigger_idx",
2042
+ "columns": [
2043
+ {
2044
+ "expression": "org_id",
2045
+ "isExpression": false,
2046
+ "asc": true,
2047
+ "nulls": "last"
2048
+ },
2049
+ {
2050
+ "expression": "trigger",
2051
+ "isExpression": false,
2052
+ "asc": true,
2053
+ "nulls": "last"
2054
+ }
2055
+ ],
2056
+ "isUnique": false,
2057
+ "concurrently": false,
2058
+ "method": "btree",
2059
+ "with": {}
2060
+ }
2061
+ },
2062
+ "foreignKeys": {
2063
+ "automations_org_id_organizations_id_fk": {
2064
+ "name": "automations_org_id_organizations_id_fk",
2065
+ "tableFrom": "automations",
2066
+ "tableTo": "organizations",
2067
+ "columnsFrom": [
2068
+ "org_id"
2069
+ ],
2070
+ "columnsTo": [
2071
+ "id"
2072
+ ],
2073
+ "onDelete": "no action",
2074
+ "onUpdate": "no action"
2075
+ }
2076
+ },
2077
+ "compositePrimaryKeys": {
2078
+ "automations_org_id_id_pk": {
2079
+ "name": "automations_org_id_id_pk",
2080
+ "columns": [
2081
+ "org_id",
2082
+ "id"
2083
+ ]
2084
+ }
2085
+ },
2086
+ "uniqueConstraints": {},
2087
+ "policies": {},
2088
+ "checkConstraints": {},
2089
+ "isRLSEnabled": false
2090
+ },
2091
+ "public.settings": {
2092
+ "name": "settings",
2093
+ "schema": "",
2094
+ "columns": {
2095
+ "org_id": {
2096
+ "name": "org_id",
2097
+ "type": "text",
2098
+ "primaryKey": false,
2099
+ "notNull": true
2100
+ },
2101
+ "namespace": {
2102
+ "name": "namespace",
2103
+ "type": "text",
2104
+ "primaryKey": false,
2105
+ "notNull": true
2106
+ },
2107
+ "scope_id": {
2108
+ "name": "scope_id",
2109
+ "type": "text",
2110
+ "primaryKey": false,
2111
+ "notNull": true
2112
+ },
2113
+ "value": {
2114
+ "name": "value",
2115
+ "type": "jsonb",
2116
+ "primaryKey": false,
2117
+ "notNull": true,
2118
+ "default": "'{}'::jsonb"
2119
+ },
2120
+ "created_at": {
2121
+ "name": "created_at",
2122
+ "type": "timestamp with time zone",
2123
+ "primaryKey": false,
2124
+ "notNull": true,
2125
+ "default": "now()"
2126
+ },
2127
+ "updated_at": {
2128
+ "name": "updated_at",
2129
+ "type": "timestamp with time zone",
2130
+ "primaryKey": false,
2131
+ "notNull": true,
2132
+ "default": "now()"
2133
+ }
2134
+ },
2135
+ "indexes": {},
2136
+ "foreignKeys": {
2137
+ "settings_org_id_organizations_id_fk": {
2138
+ "name": "settings_org_id_organizations_id_fk",
2139
+ "tableFrom": "settings",
2140
+ "tableTo": "organizations",
2141
+ "columnsFrom": [
2142
+ "org_id"
2143
+ ],
2144
+ "columnsTo": [
2145
+ "id"
2146
+ ],
2147
+ "onDelete": "no action",
2148
+ "onUpdate": "no action"
2149
+ }
2150
+ },
2151
+ "compositePrimaryKeys": {
2152
+ "settings_org_id_namespace_scope_id_pk": {
2153
+ "name": "settings_org_id_namespace_scope_id_pk",
2154
+ "columns": [
2155
+ "org_id",
2156
+ "namespace",
2157
+ "scope_id"
2158
+ ]
2159
+ }
2160
+ },
2161
+ "uniqueConstraints": {},
2162
+ "policies": {},
2163
+ "checkConstraints": {},
2164
+ "isRLSEnabled": false
2165
+ },
2166
+ "public.comment_reactions": {
2167
+ "name": "comment_reactions",
2168
+ "schema": "",
2169
+ "columns": {
2170
+ "org_id": {
2171
+ "name": "org_id",
2172
+ "type": "text",
2173
+ "primaryKey": false,
2174
+ "notNull": true
2175
+ },
2176
+ "comment_id": {
2177
+ "name": "comment_id",
2178
+ "type": "text",
2179
+ "primaryKey": false,
2180
+ "notNull": true
2181
+ },
2182
+ "org_user_id": {
2183
+ "name": "org_user_id",
2184
+ "type": "text",
2185
+ "primaryKey": false,
2186
+ "notNull": true
2187
+ },
2188
+ "emoji": {
2189
+ "name": "emoji",
2190
+ "type": "text",
2191
+ "primaryKey": false,
2192
+ "notNull": true
2193
+ },
2194
+ "created_at": {
2195
+ "name": "created_at",
2196
+ "type": "timestamp with time zone",
2197
+ "primaryKey": false,
2198
+ "notNull": true,
2199
+ "default": "now()"
2200
+ }
2201
+ },
2202
+ "indexes": {},
2203
+ "foreignKeys": {
2204
+ "comment_reactions_org_id_organizations_id_fk": {
2205
+ "name": "comment_reactions_org_id_organizations_id_fk",
2206
+ "tableFrom": "comment_reactions",
2207
+ "tableTo": "organizations",
2208
+ "columnsFrom": [
2209
+ "org_id"
2210
+ ],
2211
+ "columnsTo": [
2212
+ "id"
2213
+ ],
2214
+ "onDelete": "no action",
2215
+ "onUpdate": "no action"
2216
+ },
2217
+ "comment_reactions_org_id_comment_id_comments_org_id_id_fk": {
2218
+ "name": "comment_reactions_org_id_comment_id_comments_org_id_id_fk",
2219
+ "tableFrom": "comment_reactions",
2220
+ "tableTo": "comments",
2221
+ "columnsFrom": [
2222
+ "org_id",
2223
+ "comment_id"
2224
+ ],
2225
+ "columnsTo": [
2226
+ "org_id",
2227
+ "id"
2228
+ ],
2229
+ "onDelete": "cascade",
2230
+ "onUpdate": "no action"
2231
+ },
2232
+ "comment_reactions_org_id_org_user_id_org_users_org_id_id_fk": {
2233
+ "name": "comment_reactions_org_id_org_user_id_org_users_org_id_id_fk",
2234
+ "tableFrom": "comment_reactions",
2235
+ "tableTo": "org_users",
2236
+ "columnsFrom": [
2237
+ "org_id",
2238
+ "org_user_id"
2239
+ ],
2240
+ "columnsTo": [
2241
+ "org_id",
2242
+ "id"
2243
+ ],
2244
+ "onDelete": "no action",
2245
+ "onUpdate": "no action"
2246
+ }
2247
+ },
2248
+ "compositePrimaryKeys": {
2249
+ "comment_reactions_org_id_comment_id_org_user_id_pk": {
2250
+ "name": "comment_reactions_org_id_comment_id_org_user_id_pk",
2251
+ "columns": [
2252
+ "org_id",
2253
+ "comment_id",
2254
+ "org_user_id"
2255
+ ]
2256
+ }
2257
+ },
2258
+ "uniqueConstraints": {},
2259
+ "policies": {},
2260
+ "checkConstraints": {},
2261
+ "isRLSEnabled": false
2262
+ },
2263
+ "public.comment_reports": {
2264
+ "name": "comment_reports",
2265
+ "schema": "",
2266
+ "columns": {
2267
+ "org_id": {
2268
+ "name": "org_id",
2269
+ "type": "text",
2270
+ "primaryKey": false,
2271
+ "notNull": true
2272
+ },
2273
+ "id": {
2274
+ "name": "id",
2275
+ "type": "text",
2276
+ "primaryKey": false,
2277
+ "notNull": true
2278
+ },
2279
+ "comment_id": {
2280
+ "name": "comment_id",
2281
+ "type": "text",
2282
+ "primaryKey": false,
2283
+ "notNull": true
2284
+ },
2285
+ "org_user_id": {
2286
+ "name": "org_user_id",
2287
+ "type": "text",
2288
+ "primaryKey": false,
2289
+ "notNull": true
2290
+ },
2291
+ "reason": {
2292
+ "name": "reason",
2293
+ "type": "text",
2294
+ "primaryKey": false,
2295
+ "notNull": true,
2296
+ "default": "''"
2297
+ },
2298
+ "resolved_at": {
2299
+ "name": "resolved_at",
2300
+ "type": "timestamp with time zone",
2301
+ "primaryKey": false,
2302
+ "notNull": false
2303
+ },
2304
+ "created_at": {
2305
+ "name": "created_at",
2306
+ "type": "timestamp with time zone",
2307
+ "primaryKey": false,
2308
+ "notNull": true,
2309
+ "default": "now()"
2310
+ }
2311
+ },
2312
+ "indexes": {
2313
+ "comment_reports_open_idx": {
2314
+ "name": "comment_reports_open_idx",
2315
+ "columns": [
2316
+ {
2317
+ "expression": "org_id",
2318
+ "isExpression": false,
2319
+ "asc": true,
2320
+ "nulls": "last"
2321
+ },
2322
+ {
2323
+ "expression": "comment_id",
2324
+ "isExpression": false,
2325
+ "asc": true,
2326
+ "nulls": "last"
2327
+ },
2328
+ {
2329
+ "expression": "resolved_at",
2330
+ "isExpression": false,
2331
+ "asc": true,
2332
+ "nulls": "last"
2333
+ }
2334
+ ],
2335
+ "isUnique": false,
2336
+ "concurrently": false,
2337
+ "method": "btree",
2338
+ "with": {}
2339
+ }
2340
+ },
2341
+ "foreignKeys": {
2342
+ "comment_reports_org_id_organizations_id_fk": {
2343
+ "name": "comment_reports_org_id_organizations_id_fk",
2344
+ "tableFrom": "comment_reports",
2345
+ "tableTo": "organizations",
2346
+ "columnsFrom": [
2347
+ "org_id"
2348
+ ],
2349
+ "columnsTo": [
2350
+ "id"
2351
+ ],
2352
+ "onDelete": "no action",
2353
+ "onUpdate": "no action"
2354
+ },
2355
+ "comment_reports_org_id_comment_id_comments_org_id_id_fk": {
2356
+ "name": "comment_reports_org_id_comment_id_comments_org_id_id_fk",
2357
+ "tableFrom": "comment_reports",
2358
+ "tableTo": "comments",
2359
+ "columnsFrom": [
2360
+ "org_id",
2361
+ "comment_id"
2362
+ ],
2363
+ "columnsTo": [
2364
+ "org_id",
2365
+ "id"
2366
+ ],
2367
+ "onDelete": "cascade",
2368
+ "onUpdate": "no action"
2369
+ },
2370
+ "comment_reports_org_id_org_user_id_org_users_org_id_id_fk": {
2371
+ "name": "comment_reports_org_id_org_user_id_org_users_org_id_id_fk",
2372
+ "tableFrom": "comment_reports",
2373
+ "tableTo": "org_users",
2374
+ "columnsFrom": [
2375
+ "org_id",
2376
+ "org_user_id"
2377
+ ],
2378
+ "columnsTo": [
2379
+ "org_id",
2380
+ "id"
2381
+ ],
2382
+ "onDelete": "no action",
2383
+ "onUpdate": "no action"
2384
+ }
2385
+ },
2386
+ "compositePrimaryKeys": {
2387
+ "comment_reports_org_id_id_pk": {
2388
+ "name": "comment_reports_org_id_id_pk",
2389
+ "columns": [
2390
+ "org_id",
2391
+ "id"
2392
+ ]
2393
+ }
2394
+ },
2395
+ "uniqueConstraints": {
2396
+ "comment_reports_org_id_comment_id_org_user_id_unique": {
2397
+ "name": "comment_reports_org_id_comment_id_org_user_id_unique",
2398
+ "nullsNotDistinct": false,
2399
+ "columns": [
2400
+ "org_id",
2401
+ "comment_id",
2402
+ "org_user_id"
2403
+ ]
2404
+ }
2405
+ },
2406
+ "policies": {},
2407
+ "checkConstraints": {},
2408
+ "isRLSEnabled": false
2409
+ },
2410
+ "public.comments": {
2411
+ "name": "comments",
2412
+ "schema": "",
2413
+ "columns": {
2414
+ "org_id": {
2415
+ "name": "org_id",
2416
+ "type": "text",
2417
+ "primaryKey": false,
2418
+ "notNull": true
2419
+ },
2420
+ "id": {
2421
+ "name": "id",
2422
+ "type": "text",
2423
+ "primaryKey": false,
2424
+ "notNull": true
2425
+ },
2426
+ "activity_id": {
2427
+ "name": "activity_id",
2428
+ "type": "text",
2429
+ "primaryKey": false,
2430
+ "notNull": true
2431
+ },
2432
+ "parent_id": {
2433
+ "name": "parent_id",
2434
+ "type": "text",
2435
+ "primaryKey": false,
2436
+ "notNull": false
2437
+ },
2438
+ "org_user_id": {
2439
+ "name": "org_user_id",
2440
+ "type": "text",
2441
+ "primaryKey": false,
2442
+ "notNull": true
2443
+ },
2444
+ "body": {
2445
+ "name": "body",
2446
+ "type": "text",
2447
+ "primaryKey": false,
2448
+ "notNull": true
2449
+ },
2450
+ "status": {
2451
+ "name": "status",
2452
+ "type": "text",
2453
+ "primaryKey": false,
2454
+ "notNull": true,
2455
+ "default": "'published'"
2456
+ },
2457
+ "removed_by": {
2458
+ "name": "removed_by",
2459
+ "type": "text",
2460
+ "primaryKey": false,
2461
+ "notNull": false
2462
+ },
2463
+ "created_at": {
2464
+ "name": "created_at",
2465
+ "type": "timestamp with time zone",
2466
+ "primaryKey": false,
2467
+ "notNull": true,
2468
+ "default": "now()"
2469
+ },
2470
+ "updated_at": {
2471
+ "name": "updated_at",
2472
+ "type": "timestamp with time zone",
2473
+ "primaryKey": false,
2474
+ "notNull": true,
2475
+ "default": "now()"
2476
+ }
2477
+ },
2478
+ "indexes": {
2479
+ "comments_activity_idx": {
2480
+ "name": "comments_activity_idx",
2481
+ "columns": [
2482
+ {
2483
+ "expression": "org_id",
2484
+ "isExpression": false,
2485
+ "asc": true,
2486
+ "nulls": "last"
2487
+ },
2488
+ {
2489
+ "expression": "activity_id",
2490
+ "isExpression": false,
2491
+ "asc": true,
2492
+ "nulls": "last"
2493
+ },
2494
+ {
2495
+ "expression": "status",
2496
+ "isExpression": false,
2497
+ "asc": true,
2498
+ "nulls": "last"
2499
+ },
2500
+ {
2501
+ "expression": "created_at",
2502
+ "isExpression": false,
2503
+ "asc": true,
2504
+ "nulls": "last"
2505
+ }
2506
+ ],
2507
+ "isUnique": false,
2508
+ "concurrently": false,
2509
+ "method": "btree",
2510
+ "with": {}
2511
+ },
2512
+ "comments_queue_idx": {
2513
+ "name": "comments_queue_idx",
2514
+ "columns": [
2515
+ {
2516
+ "expression": "org_id",
2517
+ "isExpression": false,
2518
+ "asc": true,
2519
+ "nulls": "last"
2520
+ },
2521
+ {
2522
+ "expression": "status",
2523
+ "isExpression": false,
2524
+ "asc": true,
2525
+ "nulls": "last"
2526
+ },
2527
+ {
2528
+ "expression": "created_at",
2529
+ "isExpression": false,
2530
+ "asc": true,
2531
+ "nulls": "last"
2532
+ }
2533
+ ],
2534
+ "isUnique": false,
2535
+ "concurrently": false,
2536
+ "method": "btree",
2537
+ "with": {}
2538
+ }
2539
+ },
2540
+ "foreignKeys": {
2541
+ "comments_org_id_organizations_id_fk": {
2542
+ "name": "comments_org_id_organizations_id_fk",
2543
+ "tableFrom": "comments",
2544
+ "tableTo": "organizations",
2545
+ "columnsFrom": [
2546
+ "org_id"
2547
+ ],
2548
+ "columnsTo": [
2549
+ "id"
2550
+ ],
2551
+ "onDelete": "no action",
2552
+ "onUpdate": "no action"
2553
+ },
2554
+ "comments_org_id_activity_id_activities_org_id_id_fk": {
2555
+ "name": "comments_org_id_activity_id_activities_org_id_id_fk",
2556
+ "tableFrom": "comments",
2557
+ "tableTo": "activities",
2558
+ "columnsFrom": [
2559
+ "org_id",
2560
+ "activity_id"
2561
+ ],
2562
+ "columnsTo": [
2563
+ "org_id",
2564
+ "id"
2565
+ ],
2566
+ "onDelete": "cascade",
2567
+ "onUpdate": "no action"
2568
+ },
2569
+ "comments_org_id_org_user_id_org_users_org_id_id_fk": {
2570
+ "name": "comments_org_id_org_user_id_org_users_org_id_id_fk",
2571
+ "tableFrom": "comments",
2572
+ "tableTo": "org_users",
2573
+ "columnsFrom": [
2574
+ "org_id",
2575
+ "org_user_id"
2576
+ ],
2577
+ "columnsTo": [
2578
+ "org_id",
2579
+ "id"
2580
+ ],
2581
+ "onDelete": "no action",
2582
+ "onUpdate": "no action"
2583
+ },
2584
+ "comments_org_id_removed_by_org_users_org_id_id_fk": {
2585
+ "name": "comments_org_id_removed_by_org_users_org_id_id_fk",
2586
+ "tableFrom": "comments",
2587
+ "tableTo": "org_users",
2588
+ "columnsFrom": [
2589
+ "org_id",
2590
+ "removed_by"
2591
+ ],
2592
+ "columnsTo": [
2593
+ "org_id",
2594
+ "id"
2595
+ ],
2596
+ "onDelete": "no action",
2597
+ "onUpdate": "no action"
2598
+ },
2599
+ "comments_org_id_parent_id_comments_org_id_id_fk": {
2600
+ "name": "comments_org_id_parent_id_comments_org_id_id_fk",
2601
+ "tableFrom": "comments",
2602
+ "tableTo": "comments",
2603
+ "columnsFrom": [
2604
+ "org_id",
2605
+ "parent_id"
2606
+ ],
2607
+ "columnsTo": [
2608
+ "org_id",
2609
+ "id"
2610
+ ],
2611
+ "onDelete": "no action",
2612
+ "onUpdate": "no action"
2613
+ }
2614
+ },
2615
+ "compositePrimaryKeys": {
2616
+ "comments_org_id_id_pk": {
2617
+ "name": "comments_org_id_id_pk",
2618
+ "columns": [
2619
+ "org_id",
2620
+ "id"
2621
+ ]
2622
+ }
2623
+ },
2624
+ "uniqueConstraints": {},
2625
+ "policies": {},
2626
+ "checkConstraints": {
2627
+ "comments_removed_by_check": {
2628
+ "name": "comments_removed_by_check",
2629
+ "value": "(\"comments\".\"status\" = 'removed') = (\"comments\".\"removed_by\" is not null)"
2630
+ }
2631
+ },
2632
+ "isRLSEnabled": false
2633
+ },
2634
+ "public.ba_account": {
2635
+ "name": "ba_account",
2636
+ "schema": "",
2637
+ "columns": {
2638
+ "id": {
2639
+ "name": "id",
2640
+ "type": "text",
2641
+ "primaryKey": true,
2642
+ "notNull": true
2643
+ },
2644
+ "account_id": {
2645
+ "name": "account_id",
2646
+ "type": "text",
2647
+ "primaryKey": false,
2648
+ "notNull": true
2649
+ },
2650
+ "provider_id": {
2651
+ "name": "provider_id",
2652
+ "type": "text",
2653
+ "primaryKey": false,
2654
+ "notNull": true
2655
+ },
2656
+ "user_id": {
2657
+ "name": "user_id",
2658
+ "type": "text",
2659
+ "primaryKey": false,
2660
+ "notNull": true
2661
+ },
2662
+ "access_token": {
2663
+ "name": "access_token",
2664
+ "type": "text",
2665
+ "primaryKey": false,
2666
+ "notNull": false
2667
+ },
2668
+ "refresh_token": {
2669
+ "name": "refresh_token",
2670
+ "type": "text",
2671
+ "primaryKey": false,
2672
+ "notNull": false
2673
+ },
2674
+ "id_token": {
2675
+ "name": "id_token",
2676
+ "type": "text",
2677
+ "primaryKey": false,
2678
+ "notNull": false
2679
+ },
2680
+ "access_token_expires_at": {
2681
+ "name": "access_token_expires_at",
2682
+ "type": "timestamp with time zone",
2683
+ "primaryKey": false,
2684
+ "notNull": false
2685
+ },
2686
+ "refresh_token_expires_at": {
2687
+ "name": "refresh_token_expires_at",
2688
+ "type": "timestamp with time zone",
2689
+ "primaryKey": false,
2690
+ "notNull": false
2691
+ },
2692
+ "scope": {
2693
+ "name": "scope",
2694
+ "type": "text",
2695
+ "primaryKey": false,
2696
+ "notNull": false
2697
+ },
2698
+ "password": {
2699
+ "name": "password",
2700
+ "type": "text",
2701
+ "primaryKey": false,
2702
+ "notNull": false
2703
+ },
2704
+ "created_at": {
2705
+ "name": "created_at",
2706
+ "type": "timestamp with time zone",
2707
+ "primaryKey": false,
2708
+ "notNull": true
2709
+ },
2710
+ "updated_at": {
2711
+ "name": "updated_at",
2712
+ "type": "timestamp with time zone",
2713
+ "primaryKey": false,
2714
+ "notNull": true
2715
+ }
2716
+ },
2717
+ "indexes": {},
2718
+ "foreignKeys": {
2719
+ "ba_account_user_id_ba_user_id_fk": {
2720
+ "name": "ba_account_user_id_ba_user_id_fk",
2721
+ "tableFrom": "ba_account",
2722
+ "tableTo": "ba_user",
2723
+ "columnsFrom": [
2724
+ "user_id"
2725
+ ],
2726
+ "columnsTo": [
2727
+ "id"
2728
+ ],
2729
+ "onDelete": "cascade",
2730
+ "onUpdate": "no action"
2731
+ }
2732
+ },
2733
+ "compositePrimaryKeys": {},
2734
+ "uniqueConstraints": {},
2735
+ "policies": {},
2736
+ "checkConstraints": {},
2737
+ "isRLSEnabled": false
2738
+ },
2739
+ "public.ba_invitation": {
2740
+ "name": "ba_invitation",
2741
+ "schema": "",
2742
+ "columns": {
2743
+ "id": {
2744
+ "name": "id",
2745
+ "type": "text",
2746
+ "primaryKey": true,
2747
+ "notNull": true
2748
+ },
2749
+ "organization_id": {
2750
+ "name": "organization_id",
2751
+ "type": "text",
2752
+ "primaryKey": false,
2753
+ "notNull": true
2754
+ },
2755
+ "email": {
2756
+ "name": "email",
2757
+ "type": "text",
2758
+ "primaryKey": false,
2759
+ "notNull": true
2760
+ },
2761
+ "role": {
2762
+ "name": "role",
2763
+ "type": "text",
2764
+ "primaryKey": false,
2765
+ "notNull": true
2766
+ },
2767
+ "status": {
2768
+ "name": "status",
2769
+ "type": "text",
2770
+ "primaryKey": false,
2771
+ "notNull": true,
2772
+ "default": "'pending'"
2773
+ },
2774
+ "expires_at": {
2775
+ "name": "expires_at",
2776
+ "type": "timestamp with time zone",
2777
+ "primaryKey": false,
2778
+ "notNull": false
2779
+ },
2780
+ "inviter_id": {
2781
+ "name": "inviter_id",
2782
+ "type": "text",
2783
+ "primaryKey": false,
2784
+ "notNull": true
2785
+ },
2786
+ "created_at": {
2787
+ "name": "created_at",
2788
+ "type": "timestamp with time zone",
2789
+ "primaryKey": false,
2790
+ "notNull": true
2791
+ }
2792
+ },
2793
+ "indexes": {},
2794
+ "foreignKeys": {
2795
+ "ba_invitation_organization_id_ba_organization_id_fk": {
2796
+ "name": "ba_invitation_organization_id_ba_organization_id_fk",
2797
+ "tableFrom": "ba_invitation",
2798
+ "tableTo": "ba_organization",
2799
+ "columnsFrom": [
2800
+ "organization_id"
2801
+ ],
2802
+ "columnsTo": [
2803
+ "id"
2804
+ ],
2805
+ "onDelete": "cascade",
2806
+ "onUpdate": "no action"
2807
+ },
2808
+ "ba_invitation_inviter_id_ba_user_id_fk": {
2809
+ "name": "ba_invitation_inviter_id_ba_user_id_fk",
2810
+ "tableFrom": "ba_invitation",
2811
+ "tableTo": "ba_user",
2812
+ "columnsFrom": [
2813
+ "inviter_id"
2814
+ ],
2815
+ "columnsTo": [
2816
+ "id"
2817
+ ],
2818
+ "onDelete": "cascade",
2819
+ "onUpdate": "no action"
2820
+ }
2821
+ },
2822
+ "compositePrimaryKeys": {},
2823
+ "uniqueConstraints": {},
2824
+ "policies": {},
2825
+ "checkConstraints": {},
2826
+ "isRLSEnabled": false
2827
+ },
2828
+ "public.ba_jwks": {
2829
+ "name": "ba_jwks",
2830
+ "schema": "",
2831
+ "columns": {
2832
+ "id": {
2833
+ "name": "id",
2834
+ "type": "text",
2835
+ "primaryKey": true,
2836
+ "notNull": true
2837
+ },
2838
+ "public_key": {
2839
+ "name": "public_key",
2840
+ "type": "text",
2841
+ "primaryKey": false,
2842
+ "notNull": true
2843
+ },
2844
+ "private_key": {
2845
+ "name": "private_key",
2846
+ "type": "text",
2847
+ "primaryKey": false,
2848
+ "notNull": true
2849
+ },
2850
+ "created_at": {
2851
+ "name": "created_at",
2852
+ "type": "timestamp with time zone",
2853
+ "primaryKey": false,
2854
+ "notNull": true
2855
+ }
2856
+ },
2857
+ "indexes": {},
2858
+ "foreignKeys": {},
2859
+ "compositePrimaryKeys": {},
2860
+ "uniqueConstraints": {},
2861
+ "policies": {},
2862
+ "checkConstraints": {},
2863
+ "isRLSEnabled": false
2864
+ },
2865
+ "public.ba_member": {
2866
+ "name": "ba_member",
2867
+ "schema": "",
2868
+ "columns": {
2869
+ "id": {
2870
+ "name": "id",
2871
+ "type": "text",
2872
+ "primaryKey": true,
2873
+ "notNull": true
2874
+ },
2875
+ "organization_id": {
2876
+ "name": "organization_id",
2877
+ "type": "text",
2878
+ "primaryKey": false,
2879
+ "notNull": true
2880
+ },
2881
+ "user_id": {
2882
+ "name": "user_id",
2883
+ "type": "text",
2884
+ "primaryKey": false,
2885
+ "notNull": true
2886
+ },
2887
+ "role": {
2888
+ "name": "role",
2889
+ "type": "text",
2890
+ "primaryKey": false,
2891
+ "notNull": true,
2892
+ "default": "'member'"
2893
+ },
2894
+ "created_at": {
2895
+ "name": "created_at",
2896
+ "type": "timestamp with time zone",
2897
+ "primaryKey": false,
2898
+ "notNull": true
2899
+ }
2900
+ },
2901
+ "indexes": {},
2902
+ "foreignKeys": {
2903
+ "ba_member_organization_id_ba_organization_id_fk": {
2904
+ "name": "ba_member_organization_id_ba_organization_id_fk",
2905
+ "tableFrom": "ba_member",
2906
+ "tableTo": "ba_organization",
2907
+ "columnsFrom": [
2908
+ "organization_id"
2909
+ ],
2910
+ "columnsTo": [
2911
+ "id"
2912
+ ],
2913
+ "onDelete": "cascade",
2914
+ "onUpdate": "no action"
2915
+ },
2916
+ "ba_member_user_id_ba_user_id_fk": {
2917
+ "name": "ba_member_user_id_ba_user_id_fk",
2918
+ "tableFrom": "ba_member",
2919
+ "tableTo": "ba_user",
2920
+ "columnsFrom": [
2921
+ "user_id"
2922
+ ],
2923
+ "columnsTo": [
2924
+ "id"
2925
+ ],
2926
+ "onDelete": "cascade",
2927
+ "onUpdate": "no action"
2928
+ }
2929
+ },
2930
+ "compositePrimaryKeys": {},
2931
+ "uniqueConstraints": {},
2932
+ "policies": {},
2933
+ "checkConstraints": {},
2934
+ "isRLSEnabled": false
2935
+ },
2936
+ "public.ba_oauth_access_token": {
2937
+ "name": "ba_oauth_access_token",
2938
+ "schema": "",
2939
+ "columns": {
2940
+ "id": {
2941
+ "name": "id",
2942
+ "type": "text",
2943
+ "primaryKey": true,
2944
+ "notNull": true
2945
+ },
2946
+ "token": {
2947
+ "name": "token",
2948
+ "type": "text",
2949
+ "primaryKey": false,
2950
+ "notNull": true
2951
+ },
2952
+ "client_id": {
2953
+ "name": "client_id",
2954
+ "type": "text",
2955
+ "primaryKey": false,
2956
+ "notNull": true
2957
+ },
2958
+ "session_id": {
2959
+ "name": "session_id",
2960
+ "type": "text",
2961
+ "primaryKey": false,
2962
+ "notNull": false
2963
+ },
2964
+ "user_id": {
2965
+ "name": "user_id",
2966
+ "type": "text",
2967
+ "primaryKey": false,
2968
+ "notNull": false
2969
+ },
2970
+ "reference_id": {
2971
+ "name": "reference_id",
2972
+ "type": "text",
2973
+ "primaryKey": false,
2974
+ "notNull": false
2975
+ },
2976
+ "refresh_id": {
2977
+ "name": "refresh_id",
2978
+ "type": "text",
2979
+ "primaryKey": false,
2980
+ "notNull": false
2981
+ },
2982
+ "expires_at": {
2983
+ "name": "expires_at",
2984
+ "type": "timestamp with time zone",
2985
+ "primaryKey": false,
2986
+ "notNull": true
2987
+ },
2988
+ "created_at": {
2989
+ "name": "created_at",
2990
+ "type": "timestamp with time zone",
2991
+ "primaryKey": false,
2992
+ "notNull": true
2993
+ },
2994
+ "scopes": {
2995
+ "name": "scopes",
2996
+ "type": "text[]",
2997
+ "primaryKey": false,
2998
+ "notNull": true
2999
+ }
3000
+ },
3001
+ "indexes": {
3002
+ "ba_oauth_access_token_client_id_idx": {
3003
+ "name": "ba_oauth_access_token_client_id_idx",
3004
+ "columns": [
3005
+ {
3006
+ "expression": "client_id",
3007
+ "isExpression": false,
3008
+ "asc": true,
3009
+ "nulls": "last"
3010
+ }
3011
+ ],
3012
+ "isUnique": false,
3013
+ "concurrently": false,
3014
+ "method": "btree",
3015
+ "with": {}
3016
+ },
3017
+ "ba_oauth_access_token_session_id_idx": {
3018
+ "name": "ba_oauth_access_token_session_id_idx",
3019
+ "columns": [
3020
+ {
3021
+ "expression": "session_id",
3022
+ "isExpression": false,
3023
+ "asc": true,
3024
+ "nulls": "last"
3025
+ }
3026
+ ],
3027
+ "isUnique": false,
3028
+ "concurrently": false,
3029
+ "method": "btree",
3030
+ "with": {}
3031
+ },
3032
+ "ba_oauth_access_token_user_id_idx": {
3033
+ "name": "ba_oauth_access_token_user_id_idx",
3034
+ "columns": [
3035
+ {
3036
+ "expression": "user_id",
3037
+ "isExpression": false,
3038
+ "asc": true,
3039
+ "nulls": "last"
3040
+ }
3041
+ ],
3042
+ "isUnique": false,
3043
+ "concurrently": false,
3044
+ "method": "btree",
3045
+ "with": {}
3046
+ },
3047
+ "ba_oauth_access_token_refresh_id_idx": {
3048
+ "name": "ba_oauth_access_token_refresh_id_idx",
3049
+ "columns": [
3050
+ {
3051
+ "expression": "refresh_id",
3052
+ "isExpression": false,
3053
+ "asc": true,
3054
+ "nulls": "last"
3055
+ }
3056
+ ],
3057
+ "isUnique": false,
3058
+ "concurrently": false,
3059
+ "method": "btree",
3060
+ "with": {}
3061
+ }
3062
+ },
3063
+ "foreignKeys": {
3064
+ "ba_oauth_access_token_client_id_ba_oauth_client_client_id_fk": {
3065
+ "name": "ba_oauth_access_token_client_id_ba_oauth_client_client_id_fk",
3066
+ "tableFrom": "ba_oauth_access_token",
3067
+ "tableTo": "ba_oauth_client",
3068
+ "columnsFrom": [
3069
+ "client_id"
3070
+ ],
3071
+ "columnsTo": [
3072
+ "client_id"
3073
+ ],
3074
+ "onDelete": "no action",
3075
+ "onUpdate": "no action"
3076
+ },
3077
+ "ba_oauth_access_token_session_id_ba_session_id_fk": {
3078
+ "name": "ba_oauth_access_token_session_id_ba_session_id_fk",
3079
+ "tableFrom": "ba_oauth_access_token",
3080
+ "tableTo": "ba_session",
3081
+ "columnsFrom": [
3082
+ "session_id"
3083
+ ],
3084
+ "columnsTo": [
3085
+ "id"
3086
+ ],
3087
+ "onDelete": "set null",
3088
+ "onUpdate": "no action"
3089
+ },
3090
+ "ba_oauth_access_token_user_id_ba_user_id_fk": {
3091
+ "name": "ba_oauth_access_token_user_id_ba_user_id_fk",
3092
+ "tableFrom": "ba_oauth_access_token",
3093
+ "tableTo": "ba_user",
3094
+ "columnsFrom": [
3095
+ "user_id"
3096
+ ],
3097
+ "columnsTo": [
3098
+ "id"
3099
+ ],
3100
+ "onDelete": "cascade",
3101
+ "onUpdate": "no action"
3102
+ },
3103
+ "ba_oauth_access_token_refresh_id_ba_oauth_refresh_token_id_fk": {
3104
+ "name": "ba_oauth_access_token_refresh_id_ba_oauth_refresh_token_id_fk",
3105
+ "tableFrom": "ba_oauth_access_token",
3106
+ "tableTo": "ba_oauth_refresh_token",
3107
+ "columnsFrom": [
3108
+ "refresh_id"
3109
+ ],
3110
+ "columnsTo": [
3111
+ "id"
3112
+ ],
3113
+ "onDelete": "no action",
3114
+ "onUpdate": "no action"
3115
+ }
3116
+ },
3117
+ "compositePrimaryKeys": {},
3118
+ "uniqueConstraints": {
3119
+ "ba_oauth_access_token_token_unique": {
3120
+ "name": "ba_oauth_access_token_token_unique",
3121
+ "nullsNotDistinct": false,
3122
+ "columns": [
3123
+ "token"
3124
+ ]
3125
+ }
3126
+ },
3127
+ "policies": {},
3128
+ "checkConstraints": {},
3129
+ "isRLSEnabled": false
3130
+ },
3131
+ "public.ba_oauth_client": {
3132
+ "name": "ba_oauth_client",
3133
+ "schema": "",
3134
+ "columns": {
3135
+ "id": {
3136
+ "name": "id",
3137
+ "type": "text",
3138
+ "primaryKey": true,
3139
+ "notNull": true
3140
+ },
3141
+ "client_id": {
3142
+ "name": "client_id",
3143
+ "type": "text",
3144
+ "primaryKey": false,
3145
+ "notNull": true
3146
+ },
3147
+ "client_secret": {
3148
+ "name": "client_secret",
3149
+ "type": "text",
3150
+ "primaryKey": false,
3151
+ "notNull": false
3152
+ },
3153
+ "disabled": {
3154
+ "name": "disabled",
3155
+ "type": "boolean",
3156
+ "primaryKey": false,
3157
+ "notNull": false,
3158
+ "default": false
3159
+ },
3160
+ "skip_consent": {
3161
+ "name": "skip_consent",
3162
+ "type": "boolean",
3163
+ "primaryKey": false,
3164
+ "notNull": false
3165
+ },
3166
+ "enable_end_session": {
3167
+ "name": "enable_end_session",
3168
+ "type": "boolean",
3169
+ "primaryKey": false,
3170
+ "notNull": false
3171
+ },
3172
+ "subject_type": {
3173
+ "name": "subject_type",
3174
+ "type": "text",
3175
+ "primaryKey": false,
3176
+ "notNull": false
3177
+ },
3178
+ "scopes": {
3179
+ "name": "scopes",
3180
+ "type": "text[]",
3181
+ "primaryKey": false,
3182
+ "notNull": false
3183
+ },
3184
+ "user_id": {
3185
+ "name": "user_id",
3186
+ "type": "text",
3187
+ "primaryKey": false,
3188
+ "notNull": false
3189
+ },
3190
+ "name": {
3191
+ "name": "name",
3192
+ "type": "text",
3193
+ "primaryKey": false,
3194
+ "notNull": false
3195
+ },
3196
+ "uri": {
3197
+ "name": "uri",
3198
+ "type": "text",
3199
+ "primaryKey": false,
3200
+ "notNull": false
3201
+ },
3202
+ "icon": {
3203
+ "name": "icon",
3204
+ "type": "text",
3205
+ "primaryKey": false,
3206
+ "notNull": false
3207
+ },
3208
+ "contacts": {
3209
+ "name": "contacts",
3210
+ "type": "text[]",
3211
+ "primaryKey": false,
3212
+ "notNull": false
3213
+ },
3214
+ "tos": {
3215
+ "name": "tos",
3216
+ "type": "text",
3217
+ "primaryKey": false,
3218
+ "notNull": false
3219
+ },
3220
+ "policy": {
3221
+ "name": "policy",
3222
+ "type": "text",
3223
+ "primaryKey": false,
3224
+ "notNull": false
3225
+ },
3226
+ "software_id": {
3227
+ "name": "software_id",
3228
+ "type": "text",
3229
+ "primaryKey": false,
3230
+ "notNull": false
3231
+ },
3232
+ "software_version": {
3233
+ "name": "software_version",
3234
+ "type": "text",
3235
+ "primaryKey": false,
3236
+ "notNull": false
3237
+ },
3238
+ "software_statement": {
3239
+ "name": "software_statement",
3240
+ "type": "text",
3241
+ "primaryKey": false,
3242
+ "notNull": false
3243
+ },
3244
+ "redirect_uris": {
3245
+ "name": "redirect_uris",
3246
+ "type": "text[]",
3247
+ "primaryKey": false,
3248
+ "notNull": true
3249
+ },
3250
+ "post_logout_redirect_uris": {
3251
+ "name": "post_logout_redirect_uris",
3252
+ "type": "text[]",
3253
+ "primaryKey": false,
3254
+ "notNull": false
3255
+ },
3256
+ "token_endpoint_auth_method": {
3257
+ "name": "token_endpoint_auth_method",
3258
+ "type": "text",
3259
+ "primaryKey": false,
3260
+ "notNull": false
3261
+ },
3262
+ "grant_types": {
3263
+ "name": "grant_types",
3264
+ "type": "text[]",
3265
+ "primaryKey": false,
3266
+ "notNull": false
3267
+ },
3268
+ "response_types": {
3269
+ "name": "response_types",
3270
+ "type": "text[]",
3271
+ "primaryKey": false,
3272
+ "notNull": false
3273
+ },
3274
+ "public": {
3275
+ "name": "public",
3276
+ "type": "boolean",
3277
+ "primaryKey": false,
3278
+ "notNull": false
3279
+ },
3280
+ "type": {
3281
+ "name": "type",
3282
+ "type": "text",
3283
+ "primaryKey": false,
3284
+ "notNull": false
3285
+ },
3286
+ "require_pkce": {
3287
+ "name": "require_pkce",
3288
+ "type": "boolean",
3289
+ "primaryKey": false,
3290
+ "notNull": false
3291
+ },
3292
+ "reference_id": {
3293
+ "name": "reference_id",
3294
+ "type": "text",
3295
+ "primaryKey": false,
3296
+ "notNull": false
3297
+ },
3298
+ "metadata": {
3299
+ "name": "metadata",
3300
+ "type": "text",
3301
+ "primaryKey": false,
3302
+ "notNull": false
3303
+ },
3304
+ "created_at": {
3305
+ "name": "created_at",
3306
+ "type": "timestamp with time zone",
3307
+ "primaryKey": false,
3308
+ "notNull": false
3309
+ },
3310
+ "updated_at": {
3311
+ "name": "updated_at",
3312
+ "type": "timestamp with time zone",
3313
+ "primaryKey": false,
3314
+ "notNull": false
3315
+ }
3316
+ },
3317
+ "indexes": {
3318
+ "ba_oauth_client_user_id_idx": {
3319
+ "name": "ba_oauth_client_user_id_idx",
3320
+ "columns": [
3321
+ {
3322
+ "expression": "user_id",
3323
+ "isExpression": false,
3324
+ "asc": true,
3325
+ "nulls": "last"
3326
+ }
3327
+ ],
3328
+ "isUnique": false,
3329
+ "concurrently": false,
3330
+ "method": "btree",
3331
+ "with": {}
3332
+ }
3333
+ },
3334
+ "foreignKeys": {
3335
+ "ba_oauth_client_user_id_ba_user_id_fk": {
3336
+ "name": "ba_oauth_client_user_id_ba_user_id_fk",
3337
+ "tableFrom": "ba_oauth_client",
3338
+ "tableTo": "ba_user",
3339
+ "columnsFrom": [
3340
+ "user_id"
3341
+ ],
3342
+ "columnsTo": [
3343
+ "id"
3344
+ ],
3345
+ "onDelete": "cascade",
3346
+ "onUpdate": "no action"
3347
+ }
3348
+ },
3349
+ "compositePrimaryKeys": {},
3350
+ "uniqueConstraints": {
3351
+ "ba_oauth_client_client_id_unique": {
3352
+ "name": "ba_oauth_client_client_id_unique",
3353
+ "nullsNotDistinct": false,
3354
+ "columns": [
3355
+ "client_id"
3356
+ ]
3357
+ }
3358
+ },
3359
+ "policies": {},
3360
+ "checkConstraints": {},
3361
+ "isRLSEnabled": false
3362
+ },
3363
+ "public.ba_oauth_consent": {
3364
+ "name": "ba_oauth_consent",
3365
+ "schema": "",
3366
+ "columns": {
3367
+ "id": {
3368
+ "name": "id",
3369
+ "type": "text",
3370
+ "primaryKey": true,
3371
+ "notNull": true
3372
+ },
3373
+ "client_id": {
3374
+ "name": "client_id",
3375
+ "type": "text",
3376
+ "primaryKey": false,
3377
+ "notNull": true
3378
+ },
3379
+ "user_id": {
3380
+ "name": "user_id",
3381
+ "type": "text",
3382
+ "primaryKey": false,
3383
+ "notNull": false
3384
+ },
3385
+ "reference_id": {
3386
+ "name": "reference_id",
3387
+ "type": "text",
3388
+ "primaryKey": false,
3389
+ "notNull": false
3390
+ },
3391
+ "scopes": {
3392
+ "name": "scopes",
3393
+ "type": "text[]",
3394
+ "primaryKey": false,
3395
+ "notNull": true
3396
+ },
3397
+ "created_at": {
3398
+ "name": "created_at",
3399
+ "type": "timestamp with time zone",
3400
+ "primaryKey": false,
3401
+ "notNull": true
3402
+ },
3403
+ "updated_at": {
3404
+ "name": "updated_at",
3405
+ "type": "timestamp with time zone",
3406
+ "primaryKey": false,
3407
+ "notNull": true
3408
+ }
3409
+ },
3410
+ "indexes": {
3411
+ "ba_oauth_consent_client_id_idx": {
3412
+ "name": "ba_oauth_consent_client_id_idx",
3413
+ "columns": [
3414
+ {
3415
+ "expression": "client_id",
3416
+ "isExpression": false,
3417
+ "asc": true,
3418
+ "nulls": "last"
3419
+ }
3420
+ ],
3421
+ "isUnique": false,
3422
+ "concurrently": false,
3423
+ "method": "btree",
3424
+ "with": {}
3425
+ },
3426
+ "ba_oauth_consent_user_id_idx": {
3427
+ "name": "ba_oauth_consent_user_id_idx",
3428
+ "columns": [
3429
+ {
3430
+ "expression": "user_id",
3431
+ "isExpression": false,
3432
+ "asc": true,
3433
+ "nulls": "last"
3434
+ }
3435
+ ],
3436
+ "isUnique": false,
3437
+ "concurrently": false,
3438
+ "method": "btree",
3439
+ "with": {}
3440
+ }
3441
+ },
3442
+ "foreignKeys": {
3443
+ "ba_oauth_consent_client_id_ba_oauth_client_client_id_fk": {
3444
+ "name": "ba_oauth_consent_client_id_ba_oauth_client_client_id_fk",
3445
+ "tableFrom": "ba_oauth_consent",
3446
+ "tableTo": "ba_oauth_client",
3447
+ "columnsFrom": [
3448
+ "client_id"
3449
+ ],
3450
+ "columnsTo": [
3451
+ "client_id"
3452
+ ],
3453
+ "onDelete": "no action",
3454
+ "onUpdate": "no action"
3455
+ },
3456
+ "ba_oauth_consent_user_id_ba_user_id_fk": {
3457
+ "name": "ba_oauth_consent_user_id_ba_user_id_fk",
3458
+ "tableFrom": "ba_oauth_consent",
3459
+ "tableTo": "ba_user",
3460
+ "columnsFrom": [
3461
+ "user_id"
3462
+ ],
3463
+ "columnsTo": [
3464
+ "id"
3465
+ ],
3466
+ "onDelete": "cascade",
3467
+ "onUpdate": "no action"
3468
+ }
3469
+ },
3470
+ "compositePrimaryKeys": {},
3471
+ "uniqueConstraints": {},
3472
+ "policies": {},
3473
+ "checkConstraints": {},
3474
+ "isRLSEnabled": false
3475
+ },
3476
+ "public.ba_oauth_refresh_token": {
3477
+ "name": "ba_oauth_refresh_token",
3478
+ "schema": "",
3479
+ "columns": {
3480
+ "id": {
3481
+ "name": "id",
3482
+ "type": "text",
3483
+ "primaryKey": true,
3484
+ "notNull": true
3485
+ },
3486
+ "token": {
3487
+ "name": "token",
3488
+ "type": "text",
3489
+ "primaryKey": false,
3490
+ "notNull": true
3491
+ },
3492
+ "client_id": {
3493
+ "name": "client_id",
3494
+ "type": "text",
3495
+ "primaryKey": false,
3496
+ "notNull": true
3497
+ },
3498
+ "session_id": {
3499
+ "name": "session_id",
3500
+ "type": "text",
3501
+ "primaryKey": false,
3502
+ "notNull": false
3503
+ },
3504
+ "user_id": {
3505
+ "name": "user_id",
3506
+ "type": "text",
3507
+ "primaryKey": false,
3508
+ "notNull": true
3509
+ },
3510
+ "reference_id": {
3511
+ "name": "reference_id",
3512
+ "type": "text",
3513
+ "primaryKey": false,
3514
+ "notNull": false
3515
+ },
3516
+ "expires_at": {
3517
+ "name": "expires_at",
3518
+ "type": "timestamp with time zone",
3519
+ "primaryKey": false,
3520
+ "notNull": true
3521
+ },
3522
+ "created_at": {
3523
+ "name": "created_at",
3524
+ "type": "timestamp with time zone",
3525
+ "primaryKey": false,
3526
+ "notNull": true
3527
+ },
3528
+ "revoked": {
3529
+ "name": "revoked",
3530
+ "type": "timestamp with time zone",
3531
+ "primaryKey": false,
3532
+ "notNull": false
3533
+ },
3534
+ "auth_time": {
3535
+ "name": "auth_time",
3536
+ "type": "timestamp with time zone",
3537
+ "primaryKey": false,
3538
+ "notNull": false
3539
+ },
3540
+ "scopes": {
3541
+ "name": "scopes",
3542
+ "type": "text[]",
3543
+ "primaryKey": false,
3544
+ "notNull": true
3545
+ }
3546
+ },
3547
+ "indexes": {
3548
+ "ba_oauth_refresh_token_client_id_idx": {
3549
+ "name": "ba_oauth_refresh_token_client_id_idx",
3550
+ "columns": [
3551
+ {
3552
+ "expression": "client_id",
3553
+ "isExpression": false,
3554
+ "asc": true,
3555
+ "nulls": "last"
3556
+ }
3557
+ ],
3558
+ "isUnique": false,
3559
+ "concurrently": false,
3560
+ "method": "btree",
3561
+ "with": {}
3562
+ },
3563
+ "ba_oauth_refresh_token_session_id_idx": {
3564
+ "name": "ba_oauth_refresh_token_session_id_idx",
3565
+ "columns": [
3566
+ {
3567
+ "expression": "session_id",
3568
+ "isExpression": false,
3569
+ "asc": true,
3570
+ "nulls": "last"
3571
+ }
3572
+ ],
3573
+ "isUnique": false,
3574
+ "concurrently": false,
3575
+ "method": "btree",
3576
+ "with": {}
3577
+ },
3578
+ "ba_oauth_refresh_token_user_id_idx": {
3579
+ "name": "ba_oauth_refresh_token_user_id_idx",
3580
+ "columns": [
3581
+ {
3582
+ "expression": "user_id",
3583
+ "isExpression": false,
3584
+ "asc": true,
3585
+ "nulls": "last"
3586
+ }
3587
+ ],
3588
+ "isUnique": false,
3589
+ "concurrently": false,
3590
+ "method": "btree",
3591
+ "with": {}
3592
+ }
3593
+ },
3594
+ "foreignKeys": {
3595
+ "ba_oauth_refresh_token_client_id_ba_oauth_client_client_id_fk": {
3596
+ "name": "ba_oauth_refresh_token_client_id_ba_oauth_client_client_id_fk",
3597
+ "tableFrom": "ba_oauth_refresh_token",
3598
+ "tableTo": "ba_oauth_client",
3599
+ "columnsFrom": [
3600
+ "client_id"
3601
+ ],
3602
+ "columnsTo": [
3603
+ "client_id"
3604
+ ],
3605
+ "onDelete": "no action",
3606
+ "onUpdate": "no action"
3607
+ },
3608
+ "ba_oauth_refresh_token_session_id_ba_session_id_fk": {
3609
+ "name": "ba_oauth_refresh_token_session_id_ba_session_id_fk",
3610
+ "tableFrom": "ba_oauth_refresh_token",
3611
+ "tableTo": "ba_session",
3612
+ "columnsFrom": [
3613
+ "session_id"
3614
+ ],
3615
+ "columnsTo": [
3616
+ "id"
3617
+ ],
3618
+ "onDelete": "set null",
3619
+ "onUpdate": "no action"
3620
+ },
3621
+ "ba_oauth_refresh_token_user_id_ba_user_id_fk": {
3622
+ "name": "ba_oauth_refresh_token_user_id_ba_user_id_fk",
3623
+ "tableFrom": "ba_oauth_refresh_token",
3624
+ "tableTo": "ba_user",
3625
+ "columnsFrom": [
3626
+ "user_id"
3627
+ ],
3628
+ "columnsTo": [
3629
+ "id"
3630
+ ],
3631
+ "onDelete": "cascade",
3632
+ "onUpdate": "no action"
3633
+ }
3634
+ },
3635
+ "compositePrimaryKeys": {},
3636
+ "uniqueConstraints": {
3637
+ "ba_oauth_refresh_token_token_unique": {
3638
+ "name": "ba_oauth_refresh_token_token_unique",
3639
+ "nullsNotDistinct": false,
3640
+ "columns": [
3641
+ "token"
3642
+ ]
3643
+ }
3644
+ },
3645
+ "policies": {},
3646
+ "checkConstraints": {},
3647
+ "isRLSEnabled": false
3648
+ },
3649
+ "public.ba_organization": {
3650
+ "name": "ba_organization",
3651
+ "schema": "",
3652
+ "columns": {
3653
+ "id": {
3654
+ "name": "id",
3655
+ "type": "text",
3656
+ "primaryKey": true,
3657
+ "notNull": true
3658
+ },
3659
+ "name": {
3660
+ "name": "name",
3661
+ "type": "text",
3662
+ "primaryKey": false,
3663
+ "notNull": true
3664
+ },
3665
+ "slug": {
3666
+ "name": "slug",
3667
+ "type": "text",
3668
+ "primaryKey": false,
3669
+ "notNull": true
3670
+ },
3671
+ "logo": {
3672
+ "name": "logo",
3673
+ "type": "text",
3674
+ "primaryKey": false,
3675
+ "notNull": false
3676
+ },
3677
+ "metadata": {
3678
+ "name": "metadata",
3679
+ "type": "text",
3680
+ "primaryKey": false,
3681
+ "notNull": false
3682
+ },
3683
+ "created_at": {
3684
+ "name": "created_at",
3685
+ "type": "timestamp with time zone",
3686
+ "primaryKey": false,
3687
+ "notNull": true
3688
+ },
3689
+ "updated_at": {
3690
+ "name": "updated_at",
3691
+ "type": "timestamp with time zone",
3692
+ "primaryKey": false,
3693
+ "notNull": false
3694
+ }
3695
+ },
3696
+ "indexes": {},
3697
+ "foreignKeys": {},
3698
+ "compositePrimaryKeys": {},
3699
+ "uniqueConstraints": {
3700
+ "ba_organization_slug_unique": {
3701
+ "name": "ba_organization_slug_unique",
3702
+ "nullsNotDistinct": false,
3703
+ "columns": [
3704
+ "slug"
3705
+ ]
3706
+ }
3707
+ },
3708
+ "policies": {},
3709
+ "checkConstraints": {},
3710
+ "isRLSEnabled": false
3711
+ },
3712
+ "public.ba_session": {
3713
+ "name": "ba_session",
3714
+ "schema": "",
3715
+ "columns": {
3716
+ "id": {
3717
+ "name": "id",
3718
+ "type": "text",
3719
+ "primaryKey": true,
3720
+ "notNull": true
3721
+ },
3722
+ "expires_at": {
3723
+ "name": "expires_at",
3724
+ "type": "timestamp with time zone",
3725
+ "primaryKey": false,
3726
+ "notNull": true
3727
+ },
3728
+ "token": {
3729
+ "name": "token",
3730
+ "type": "text",
3731
+ "primaryKey": false,
3732
+ "notNull": true
3733
+ },
3734
+ "created_at": {
3735
+ "name": "created_at",
3736
+ "type": "timestamp with time zone",
3737
+ "primaryKey": false,
3738
+ "notNull": true
3739
+ },
3740
+ "updated_at": {
3741
+ "name": "updated_at",
3742
+ "type": "timestamp with time zone",
3743
+ "primaryKey": false,
3744
+ "notNull": true
3745
+ },
3746
+ "ip_address": {
3747
+ "name": "ip_address",
3748
+ "type": "text",
3749
+ "primaryKey": false,
3750
+ "notNull": false
3751
+ },
3752
+ "user_agent": {
3753
+ "name": "user_agent",
3754
+ "type": "text",
3755
+ "primaryKey": false,
3756
+ "notNull": false
3757
+ },
3758
+ "user_id": {
3759
+ "name": "user_id",
3760
+ "type": "text",
3761
+ "primaryKey": false,
3762
+ "notNull": true
3763
+ },
3764
+ "active_organization_id": {
3765
+ "name": "active_organization_id",
3766
+ "type": "text",
3767
+ "primaryKey": false,
3768
+ "notNull": false
3769
+ }
3770
+ },
3771
+ "indexes": {},
3772
+ "foreignKeys": {
3773
+ "ba_session_user_id_ba_user_id_fk": {
3774
+ "name": "ba_session_user_id_ba_user_id_fk",
3775
+ "tableFrom": "ba_session",
3776
+ "tableTo": "ba_user",
3777
+ "columnsFrom": [
3778
+ "user_id"
3779
+ ],
3780
+ "columnsTo": [
3781
+ "id"
3782
+ ],
3783
+ "onDelete": "cascade",
3784
+ "onUpdate": "no action"
3785
+ }
3786
+ },
3787
+ "compositePrimaryKeys": {},
3788
+ "uniqueConstraints": {
3789
+ "ba_session_token_unique": {
3790
+ "name": "ba_session_token_unique",
3791
+ "nullsNotDistinct": false,
3792
+ "columns": [
3793
+ "token"
3794
+ ]
3795
+ }
3796
+ },
3797
+ "policies": {},
3798
+ "checkConstraints": {},
3799
+ "isRLSEnabled": false
3800
+ },
3801
+ "public.ba_user": {
3802
+ "name": "ba_user",
3803
+ "schema": "",
3804
+ "columns": {
3805
+ "id": {
3806
+ "name": "id",
3807
+ "type": "text",
3808
+ "primaryKey": true,
3809
+ "notNull": true
3810
+ },
3811
+ "name": {
3812
+ "name": "name",
3813
+ "type": "text",
3814
+ "primaryKey": false,
3815
+ "notNull": true
3816
+ },
3817
+ "email": {
3818
+ "name": "email",
3819
+ "type": "text",
3820
+ "primaryKey": false,
3821
+ "notNull": true
3822
+ },
3823
+ "email_verified": {
3824
+ "name": "email_verified",
3825
+ "type": "boolean",
3826
+ "primaryKey": false,
3827
+ "notNull": true
3828
+ },
3829
+ "image": {
3830
+ "name": "image",
3831
+ "type": "text",
3832
+ "primaryKey": false,
3833
+ "notNull": false
3834
+ },
3835
+ "created_at": {
3836
+ "name": "created_at",
3837
+ "type": "timestamp with time zone",
3838
+ "primaryKey": false,
3839
+ "notNull": true
3840
+ },
3841
+ "updated_at": {
3842
+ "name": "updated_at",
3843
+ "type": "timestamp with time zone",
3844
+ "primaryKey": false,
3845
+ "notNull": true
3846
+ }
3847
+ },
3848
+ "indexes": {},
3849
+ "foreignKeys": {},
3850
+ "compositePrimaryKeys": {},
3851
+ "uniqueConstraints": {
3852
+ "ba_user_email_unique": {
3853
+ "name": "ba_user_email_unique",
3854
+ "nullsNotDistinct": false,
3855
+ "columns": [
3856
+ "email"
3857
+ ]
3858
+ }
3859
+ },
3860
+ "policies": {},
3861
+ "checkConstraints": {},
3862
+ "isRLSEnabled": false
3863
+ },
3864
+ "public.ba_verification": {
3865
+ "name": "ba_verification",
3866
+ "schema": "",
3867
+ "columns": {
3868
+ "id": {
3869
+ "name": "id",
3870
+ "type": "text",
3871
+ "primaryKey": true,
3872
+ "notNull": true
3873
+ },
3874
+ "identifier": {
3875
+ "name": "identifier",
3876
+ "type": "text",
3877
+ "primaryKey": false,
3878
+ "notNull": true
3879
+ },
3880
+ "value": {
3881
+ "name": "value",
3882
+ "type": "text",
3883
+ "primaryKey": false,
3884
+ "notNull": true
3885
+ },
3886
+ "expires_at": {
3887
+ "name": "expires_at",
3888
+ "type": "timestamp with time zone",
3889
+ "primaryKey": false,
3890
+ "notNull": true
3891
+ },
3892
+ "created_at": {
3893
+ "name": "created_at",
3894
+ "type": "timestamp with time zone",
3895
+ "primaryKey": false,
3896
+ "notNull": false
3897
+ },
3898
+ "updated_at": {
3899
+ "name": "updated_at",
3900
+ "type": "timestamp with time zone",
3901
+ "primaryKey": false,
3902
+ "notNull": false
3903
+ }
3904
+ },
3905
+ "indexes": {},
3906
+ "foreignKeys": {},
3907
+ "compositePrimaryKeys": {},
3908
+ "uniqueConstraints": {},
3909
+ "policies": {},
3910
+ "checkConstraints": {},
3911
+ "isRLSEnabled": false
3912
+ }
3913
+ },
3914
+ "enums": {},
3915
+ "schemas": {},
3916
+ "sequences": {},
3917
+ "roles": {},
3918
+ "policies": {},
3919
+ "views": {},
3920
+ "_meta": {
3921
+ "columns": {},
3922
+ "schemas": {},
3923
+ "tables": {}
3924
+ }
3925
+ }