@wraps.dev/cli 2.30.3 → 3.0.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 (153) hide show
  1. package/README.md +5 -8
  2. package/dist/cli.js +942 -2211
  3. package/dist/cli.js.map +1 -1
  4. package/dist/console/assets/{index-P0x5JCC4.js → index--39O8UcT.js} +3 -3
  5. package/dist/console/assets/index-D6au_OkL.css +1 -0
  6. package/dist/console/index.html +2 -2
  7. package/dist/lambda/agent-enforcer/.bundled +1 -1
  8. package/dist/lambda/event-processor/.bundled +1 -1
  9. package/dist/lambda/inbound-processor/.bundled +1 -1
  10. package/dist/lambda/sms-event-processor/.bundled +1 -1
  11. package/package.json +4 -5
  12. package/dist/api-lambda.zip +0 -0
  13. package/dist/console/assets/index-BP4FpEpn.css +0 -1
  14. package/dist/selfhost-migrations/0000_absent_rogue.sql +0 -203
  15. package/dist/selfhost-migrations/0001_polite_maverick.sql +0 -17
  16. package/dist/selfhost-migrations/0002_perpetual_scorpion.sql +0 -1
  17. package/dist/selfhost-migrations/0003_wealthy_absorbing_man.sql +0 -1
  18. package/dist/selfhost-migrations/0004_opposite_blur.sql +0 -1
  19. package/dist/selfhost-migrations/0005_clear_terror.sql +0 -4
  20. package/dist/selfhost-migrations/0006_soft_black_widow.sql +0 -20
  21. package/dist/selfhost-migrations/0007_dazzling_saracen.sql +0 -124
  22. package/dist/selfhost-migrations/0008_broad_hannibal_king.sql +0 -33
  23. package/dist/selfhost-migrations/0009_bouncy_mystique.sql +0 -73
  24. package/dist/selfhost-migrations/0010_cheerful_valeria_richards.sql +0 -18
  25. package/dist/selfhost-migrations/0011_absent_thunderbolts.sql +0 -2
  26. package/dist/selfhost-migrations/0012_demonic_donald_blake.sql +0 -1
  27. package/dist/selfhost-migrations/0013_nifty_preak.sql +0 -143
  28. package/dist/selfhost-migrations/0014_hesitant_beast.sql +0 -2
  29. package/dist/selfhost-migrations/0015_blue_giant_girl.sql +0 -1
  30. package/dist/selfhost-migrations/0016_cooing_overlord.sql +0 -1
  31. package/dist/selfhost-migrations/0017_tranquil_ender_wiggin.sql +0 -11
  32. package/dist/selfhost-migrations/0018_talented_groot.sql +0 -8
  33. package/dist/selfhost-migrations/0019_ambitious_devos.sql +0 -3
  34. package/dist/selfhost-migrations/0020_misty_master_mold.sql +0 -95
  35. package/dist/selfhost-migrations/0021_regular_harrier.sql +0 -14
  36. package/dist/selfhost-migrations/0022_sour_blizzard.sql +0 -10
  37. package/dist/selfhost-migrations/0023_flawless_psynapse.sql +0 -1
  38. package/dist/selfhost-migrations/0024_premium_blindfold.sql +0 -1
  39. package/dist/selfhost-migrations/0025_unusual_santa_claus.sql +0 -1
  40. package/dist/selfhost-migrations/0026_volatile_pandemic.sql +0 -2
  41. package/dist/selfhost-migrations/0027_workable_logan.sql +0 -4
  42. package/dist/selfhost-migrations/0028_familiar_prodigy.sql +0 -1
  43. package/dist/selfhost-migrations/0029_cute_maddog.sql +0 -13
  44. package/dist/selfhost-migrations/0030_adorable_scarecrow.sql +0 -1
  45. package/dist/selfhost-migrations/0031_material_slapstick.sql +0 -10
  46. package/dist/selfhost-migrations/0032_hot_dust.sql +0 -11
  47. package/dist/selfhost-migrations/0033_slow_deathbird.sql +0 -1
  48. package/dist/selfhost-migrations/0034_lush_rafael_vega.sql +0 -12
  49. package/dist/selfhost-migrations/0035_normal_red_hulk.sql +0 -8
  50. package/dist/selfhost-migrations/0036_marvelous_ezekiel.sql +0 -1
  51. package/dist/selfhost-migrations/0037_swift_talisman.sql +0 -8
  52. package/dist/selfhost-migrations/0038_first_mandroid.sql +0 -1
  53. package/dist/selfhost-migrations/0039_fixed_stryfe.sql +0 -1
  54. package/dist/selfhost-migrations/0040_add_channel_check_constraints.sql +0 -2
  55. package/dist/selfhost-migrations/0041_black_spencer_smythe.sql +0 -1
  56. package/dist/selfhost-migrations/0042_plain_marvel_zombies.sql +0 -2
  57. package/dist/selfhost-migrations/0043_curved_champions.sql +0 -1
  58. package/dist/selfhost-migrations/0044_clean_iceman.sql +0 -1
  59. package/dist/selfhost-migrations/0045_condemned_steel_serpent.sql +0 -1
  60. package/dist/selfhost-migrations/0046_steep_ultimo.sql +0 -2
  61. package/dist/selfhost-migrations/0047_empty_sleepwalker.sql +0 -2
  62. package/dist/selfhost-migrations/0048_cheerful_multiple_man.sql +0 -1
  63. package/dist/selfhost-migrations/0049_nostalgic_loki.sql +0 -3
  64. package/dist/selfhost-migrations/0050_add_engagement_metadata.sql +0 -4
  65. package/dist/selfhost-migrations/0051_odd_marrow.sql +0 -2
  66. package/dist/selfhost-migrations/0052_redundant_siren.sql +0 -5
  67. package/dist/selfhost-migrations/0053_soft_carnage.sql +0 -31
  68. package/dist/selfhost-migrations/0054_blushing_vin_gonzales.sql +0 -1
  69. package/dist/selfhost-migrations/0055_broadcast_resume_columns.sql +0 -12
  70. package/dist/selfhost-migrations/0056_broadcast_resume_dedup_cleanup.sql +0 -31
  71. package/dist/selfhost-migrations/0057_audit_log_actoremail_jsonb.sql +0 -5
  72. package/dist/selfhost-migrations/0058_email_log_sent_at_idx.sql +0 -1
  73. package/dist/selfhost-migrations/0059_message_send_claimed_at.sql +0 -1
  74. package/dist/selfhost-migrations/0060_harsh_nehzno.sql +0 -1
  75. package/dist/selfhost-migrations/0061_flashy_spirit.sql +0 -1
  76. package/dist/selfhost-migrations/0062_next_timeslip.sql +0 -2
  77. package/dist/selfhost-migrations/0063_greedy_legion.sql +0 -17
  78. package/dist/selfhost-migrations/0064_wise_brood.sql +0 -42
  79. package/dist/selfhost-migrations/0065_public_the_fallen.sql +0 -2
  80. package/dist/selfhost-migrations/0066_odd_yellow_claw.sql +0 -3
  81. package/dist/selfhost-migrations/0067_empty_ultimo.sql +0 -1
  82. package/dist/selfhost-migrations/0068_abandoned_mephisto.sql +0 -1
  83. package/dist/selfhost-migrations/0069_abnormal_zuras.sql +0 -1
  84. package/dist/selfhost-migrations/CLAUDE.md +0 -49
  85. package/dist/selfhost-migrations/meta/0000_snapshot.json +0 -1311
  86. package/dist/selfhost-migrations/meta/0001_snapshot.json +0 -1454
  87. package/dist/selfhost-migrations/meta/0002_snapshot.json +0 -1460
  88. package/dist/selfhost-migrations/meta/0003_snapshot.json +0 -1467
  89. package/dist/selfhost-migrations/meta/0004_snapshot.json +0 -1473
  90. package/dist/selfhost-migrations/meta/0005_snapshot.json +0 -1499
  91. package/dist/selfhost-migrations/meta/0006_snapshot.json +0 -1617
  92. package/dist/selfhost-migrations/meta/0007_snapshot.json +0 -2581
  93. package/dist/selfhost-migrations/meta/0008_snapshot.json +0 -2861
  94. package/dist/selfhost-migrations/meta/0009_snapshot.json +0 -3447
  95. package/dist/selfhost-migrations/meta/0010_snapshot.json +0 -3586
  96. package/dist/selfhost-migrations/meta/0011_snapshot.json +0 -3600
  97. package/dist/selfhost-migrations/meta/0012_snapshot.json +0 -3607
  98. package/dist/selfhost-migrations/meta/0013_snapshot.json +0 -4697
  99. package/dist/selfhost-migrations/meta/0014_snapshot.json +0 -4704
  100. package/dist/selfhost-migrations/meta/0015_snapshot.json +0 -4697
  101. package/dist/selfhost-migrations/meta/0016_snapshot.json +0 -4703
  102. package/dist/selfhost-migrations/meta/0017_snapshot.json +0 -4769
  103. package/dist/selfhost-migrations/meta/0018_snapshot.json +0 -4821
  104. package/dist/selfhost-migrations/meta/0019_snapshot.json +0 -4840
  105. package/dist/selfhost-migrations/meta/0020_snapshot.json +0 -5602
  106. package/dist/selfhost-migrations/meta/0021_snapshot.json +0 -5729
  107. package/dist/selfhost-migrations/meta/0022_snapshot.json +0 -5792
  108. package/dist/selfhost-migrations/meta/0023_snapshot.json +0 -5799
  109. package/dist/selfhost-migrations/meta/0024_snapshot.json +0 -5821
  110. package/dist/selfhost-migrations/meta/0025_snapshot.json +0 -5831
  111. package/dist/selfhost-migrations/meta/0026_snapshot.json +0 -5844
  112. package/dist/selfhost-migrations/meta/0027_snapshot.json +0 -5864
  113. package/dist/selfhost-migrations/meta/0028_snapshot.json +0 -5871
  114. package/dist/selfhost-migrations/meta/0029_snapshot.json +0 -5984
  115. package/dist/selfhost-migrations/meta/0030_snapshot.json +0 -5990
  116. package/dist/selfhost-migrations/meta/0031_snapshot.json +0 -5950
  117. package/dist/selfhost-migrations/meta/0032_snapshot.json +0 -6042
  118. package/dist/selfhost-migrations/meta/0033_snapshot.json +0 -6057
  119. package/dist/selfhost-migrations/meta/0034_snapshot.json +0 -6130
  120. package/dist/selfhost-migrations/meta/0035_snapshot.json +0 -6195
  121. package/dist/selfhost-migrations/meta/0036_snapshot.json +0 -6201
  122. package/dist/selfhost-migrations/meta/0037_snapshot.json +0 -6265
  123. package/dist/selfhost-migrations/meta/0038_snapshot.json +0 -6271
  124. package/dist/selfhost-migrations/meta/0039_snapshot.json +0 -6278
  125. package/dist/selfhost-migrations/meta/0041_snapshot.json +0 -6284
  126. package/dist/selfhost-migrations/meta/0042_snapshot.json +0 -6297
  127. package/dist/selfhost-migrations/meta/0043_snapshot.json +0 -6297
  128. package/dist/selfhost-migrations/meta/0044_snapshot.json +0 -6297
  129. package/dist/selfhost-migrations/meta/0045_snapshot.json +0 -6303
  130. package/dist/selfhost-migrations/meta/0046_snapshot.json +0 -6315
  131. package/dist/selfhost-migrations/meta/0047_snapshot.json +0 -6330
  132. package/dist/selfhost-migrations/meta/0048_snapshot.json +0 -6336
  133. package/dist/selfhost-migrations/meta/0049_snapshot.json +0 -6366
  134. package/dist/selfhost-migrations/meta/0050_snapshot.json +0 -6390
  135. package/dist/selfhost-migrations/meta/0051_snapshot.json +0 -6403
  136. package/dist/selfhost-migrations/meta/0052_snapshot.json +0 -6470
  137. package/dist/selfhost-migrations/meta/0053_snapshot.json +0 -6470
  138. package/dist/selfhost-migrations/meta/0054_snapshot.json +0 -6646
  139. package/dist/selfhost-migrations/meta/0055_snapshot.json +0 -6713
  140. package/dist/selfhost-migrations/meta/0056_snapshot.json +0 -6713
  141. package/dist/selfhost-migrations/meta/0057_snapshot.json +0 -6731
  142. package/dist/selfhost-migrations/meta/0059_snapshot.json +0 -6764
  143. package/dist/selfhost-migrations/meta/0060_snapshot.json +0 -7125
  144. package/dist/selfhost-migrations/meta/0061_snapshot.json +0 -7131
  145. package/dist/selfhost-migrations/meta/0062_snapshot.json +0 -7143
  146. package/dist/selfhost-migrations/meta/0063_snapshot.json +0 -7282
  147. package/dist/selfhost-migrations/meta/0064_snapshot.json +0 -7626
  148. package/dist/selfhost-migrations/meta/0065_snapshot.json +0 -7662
  149. package/dist/selfhost-migrations/meta/0066_snapshot.json +0 -7682
  150. package/dist/selfhost-migrations/meta/0067_snapshot.json +0 -7688
  151. package/dist/selfhost-migrations/meta/0068_snapshot.json +0 -7694
  152. package/dist/selfhost-migrations/meta/0069_snapshot.json +0 -7700
  153. package/dist/selfhost-migrations/meta/_journal.json +0 -496
@@ -1,2861 +0,0 @@
1
- {
2
- "id": "6adecfa6-e21c-4190-a69d-b08aa19239cb",
3
- "prevId": "3ea0fd46-dd0e-4eac-bd70-7d630985bfe7",
4
- "version": "7",
5
- "dialect": "postgresql",
6
- "tables": {
7
- "public.api_key": {
8
- "name": "api_key",
9
- "schema": "",
10
- "columns": {
11
- "id": {
12
- "name": "id",
13
- "type": "text",
14
- "primaryKey": true,
15
- "notNull": true
16
- },
17
- "organization_id": {
18
- "name": "organization_id",
19
- "type": "text",
20
- "primaryKey": false,
21
- "notNull": true
22
- },
23
- "name": {
24
- "name": "name",
25
- "type": "text",
26
- "primaryKey": false,
27
- "notNull": true
28
- },
29
- "key_hash": {
30
- "name": "key_hash",
31
- "type": "text",
32
- "primaryKey": false,
33
- "notNull": true
34
- },
35
- "prefix": {
36
- "name": "prefix",
37
- "type": "text",
38
- "primaryKey": false,
39
- "notNull": true
40
- },
41
- "permissions": {
42
- "name": "permissions",
43
- "type": "json",
44
- "primaryKey": false,
45
- "notNull": false,
46
- "default": "'[]'::json"
47
- },
48
- "last_used_at": {
49
- "name": "last_used_at",
50
- "type": "timestamp",
51
- "primaryKey": false,
52
- "notNull": false
53
- },
54
- "expires_at": {
55
- "name": "expires_at",
56
- "type": "timestamp",
57
- "primaryKey": false,
58
- "notNull": false
59
- },
60
- "created_by": {
61
- "name": "created_by",
62
- "type": "text",
63
- "primaryKey": false,
64
- "notNull": false
65
- },
66
- "created_at": {
67
- "name": "created_at",
68
- "type": "timestamp",
69
- "primaryKey": false,
70
- "notNull": true,
71
- "default": "now()"
72
- }
73
- },
74
- "indexes": {
75
- "api_key_org_idx": {
76
- "name": "api_key_org_idx",
77
- "columns": [
78
- {
79
- "expression": "organization_id",
80
- "isExpression": false,
81
- "asc": true,
82
- "nulls": "last"
83
- }
84
- ],
85
- "isUnique": false,
86
- "concurrently": false,
87
- "method": "btree",
88
- "with": {}
89
- },
90
- "api_key_prefix_idx": {
91
- "name": "api_key_prefix_idx",
92
- "columns": [
93
- {
94
- "expression": "prefix",
95
- "isExpression": false,
96
- "asc": true,
97
- "nulls": "last"
98
- }
99
- ],
100
- "isUnique": false,
101
- "concurrently": false,
102
- "method": "btree",
103
- "with": {}
104
- }
105
- },
106
- "foreignKeys": {
107
- "api_key_organization_id_organization_id_fk": {
108
- "name": "api_key_organization_id_organization_id_fk",
109
- "tableFrom": "api_key",
110
- "tableTo": "organization",
111
- "columnsFrom": ["organization_id"],
112
- "columnsTo": ["id"],
113
- "onDelete": "cascade",
114
- "onUpdate": "no action"
115
- },
116
- "api_key_created_by_user_id_fk": {
117
- "name": "api_key_created_by_user_id_fk",
118
- "tableFrom": "api_key",
119
- "tableTo": "user",
120
- "columnsFrom": ["created_by"],
121
- "columnsTo": ["id"],
122
- "onDelete": "no action",
123
- "onUpdate": "no action"
124
- }
125
- },
126
- "compositePrimaryKeys": {},
127
- "uniqueConstraints": {},
128
- "policies": {},
129
- "checkConstraints": {},
130
- "isRLSEnabled": false
131
- },
132
- "public.audit_log": {
133
- "name": "audit_log",
134
- "schema": "",
135
- "columns": {
136
- "id": {
137
- "name": "id",
138
- "type": "text",
139
- "primaryKey": true,
140
- "notNull": true
141
- },
142
- "organization_id": {
143
- "name": "organization_id",
144
- "type": "text",
145
- "primaryKey": false,
146
- "notNull": true
147
- },
148
- "user_id": {
149
- "name": "user_id",
150
- "type": "text",
151
- "primaryKey": false,
152
- "notNull": false
153
- },
154
- "action": {
155
- "name": "action",
156
- "type": "text",
157
- "primaryKey": false,
158
- "notNull": true
159
- },
160
- "resource": {
161
- "name": "resource",
162
- "type": "text",
163
- "primaryKey": false,
164
- "notNull": true
165
- },
166
- "resource_id": {
167
- "name": "resource_id",
168
- "type": "text",
169
- "primaryKey": false,
170
- "notNull": false
171
- },
172
- "metadata": {
173
- "name": "metadata",
174
- "type": "json",
175
- "primaryKey": false,
176
- "notNull": false
177
- },
178
- "ip_address": {
179
- "name": "ip_address",
180
- "type": "text",
181
- "primaryKey": false,
182
- "notNull": false
183
- },
184
- "user_agent": {
185
- "name": "user_agent",
186
- "type": "text",
187
- "primaryKey": false,
188
- "notNull": false
189
- },
190
- "created_at": {
191
- "name": "created_at",
192
- "type": "timestamp",
193
- "primaryKey": false,
194
- "notNull": true,
195
- "default": "now()"
196
- }
197
- },
198
- "indexes": {
199
- "audit_log_org_idx": {
200
- "name": "audit_log_org_idx",
201
- "columns": [
202
- {
203
- "expression": "organization_id",
204
- "isExpression": false,
205
- "asc": true,
206
- "nulls": "last"
207
- }
208
- ],
209
- "isUnique": false,
210
- "concurrently": false,
211
- "method": "btree",
212
- "with": {}
213
- },
214
- "audit_log_timestamp_idx": {
215
- "name": "audit_log_timestamp_idx",
216
- "columns": [
217
- {
218
- "expression": "created_at",
219
- "isExpression": false,
220
- "asc": true,
221
- "nulls": "last"
222
- }
223
- ],
224
- "isUnique": false,
225
- "concurrently": false,
226
- "method": "btree",
227
- "with": {}
228
- }
229
- },
230
- "foreignKeys": {
231
- "audit_log_organization_id_organization_id_fk": {
232
- "name": "audit_log_organization_id_organization_id_fk",
233
- "tableFrom": "audit_log",
234
- "tableTo": "organization",
235
- "columnsFrom": ["organization_id"],
236
- "columnsTo": ["id"],
237
- "onDelete": "cascade",
238
- "onUpdate": "no action"
239
- },
240
- "audit_log_user_id_user_id_fk": {
241
- "name": "audit_log_user_id_user_id_fk",
242
- "tableFrom": "audit_log",
243
- "tableTo": "user",
244
- "columnsFrom": ["user_id"],
245
- "columnsTo": ["id"],
246
- "onDelete": "no action",
247
- "onUpdate": "no action"
248
- }
249
- },
250
- "compositePrimaryKeys": {},
251
- "uniqueConstraints": {},
252
- "policies": {},
253
- "checkConstraints": {},
254
- "isRLSEnabled": false
255
- },
256
- "public.aws_account": {
257
- "name": "aws_account",
258
- "schema": "",
259
- "columns": {
260
- "id": {
261
- "name": "id",
262
- "type": "text",
263
- "primaryKey": true,
264
- "notNull": true
265
- },
266
- "organization_id": {
267
- "name": "organization_id",
268
- "type": "text",
269
- "primaryKey": false,
270
- "notNull": true
271
- },
272
- "name": {
273
- "name": "name",
274
- "type": "text",
275
- "primaryKey": false,
276
- "notNull": true
277
- },
278
- "account_id": {
279
- "name": "account_id",
280
- "type": "text",
281
- "primaryKey": false,
282
- "notNull": true
283
- },
284
- "region": {
285
- "name": "region",
286
- "type": "text",
287
- "primaryKey": false,
288
- "notNull": true
289
- },
290
- "role_arn": {
291
- "name": "role_arn",
292
- "type": "text",
293
- "primaryKey": false,
294
- "notNull": true
295
- },
296
- "external_id": {
297
- "name": "external_id",
298
- "type": "text",
299
- "primaryKey": false,
300
- "notNull": true
301
- },
302
- "is_verified": {
303
- "name": "is_verified",
304
- "type": "boolean",
305
- "primaryKey": false,
306
- "notNull": true,
307
- "default": false
308
- },
309
- "last_verified_at": {
310
- "name": "last_verified_at",
311
- "type": "timestamp",
312
- "primaryKey": false,
313
- "notNull": false
314
- },
315
- "archiving_enabled": {
316
- "name": "archiving_enabled",
317
- "type": "boolean",
318
- "primaryKey": false,
319
- "notNull": true,
320
- "default": false
321
- },
322
- "archive_arn": {
323
- "name": "archive_arn",
324
- "type": "text",
325
- "primaryKey": false,
326
- "notNull": false
327
- },
328
- "event_history_enabled": {
329
- "name": "event_history_enabled",
330
- "type": "boolean",
331
- "primaryKey": false,
332
- "notNull": true,
333
- "default": false
334
- },
335
- "event_tracking_enabled": {
336
- "name": "event_tracking_enabled",
337
- "type": "boolean",
338
- "primaryKey": false,
339
- "notNull": true,
340
- "default": false
341
- },
342
- "config_set_name": {
343
- "name": "config_set_name",
344
- "type": "text",
345
- "primaryKey": false,
346
- "notNull": false
347
- },
348
- "custom_tracking_domain": {
349
- "name": "custom_tracking_domain",
350
- "type": "text",
351
- "primaryKey": false,
352
- "notNull": false
353
- },
354
- "created_by": {
355
- "name": "created_by",
356
- "type": "text",
357
- "primaryKey": false,
358
- "notNull": false
359
- },
360
- "created_at": {
361
- "name": "created_at",
362
- "type": "timestamp",
363
- "primaryKey": false,
364
- "notNull": true,
365
- "default": "now()"
366
- },
367
- "updated_at": {
368
- "name": "updated_at",
369
- "type": "timestamp",
370
- "primaryKey": false,
371
- "notNull": true,
372
- "default": "now()"
373
- }
374
- },
375
- "indexes": {
376
- "aws_account_org_idx": {
377
- "name": "aws_account_org_idx",
378
- "columns": [
379
- {
380
- "expression": "organization_id",
381
- "isExpression": false,
382
- "asc": true,
383
- "nulls": "last"
384
- }
385
- ],
386
- "isUnique": false,
387
- "concurrently": false,
388
- "method": "btree",
389
- "with": {}
390
- },
391
- "aws_account_external_id_idx": {
392
- "name": "aws_account_external_id_idx",
393
- "columns": [
394
- {
395
- "expression": "external_id",
396
- "isExpression": false,
397
- "asc": true,
398
- "nulls": "last"
399
- }
400
- ],
401
- "isUnique": false,
402
- "concurrently": false,
403
- "method": "btree",
404
- "with": {}
405
- }
406
- },
407
- "foreignKeys": {
408
- "aws_account_organization_id_organization_id_fk": {
409
- "name": "aws_account_organization_id_organization_id_fk",
410
- "tableFrom": "aws_account",
411
- "tableTo": "organization",
412
- "columnsFrom": ["organization_id"],
413
- "columnsTo": ["id"],
414
- "onDelete": "cascade",
415
- "onUpdate": "no action"
416
- },
417
- "aws_account_created_by_user_id_fk": {
418
- "name": "aws_account_created_by_user_id_fk",
419
- "tableFrom": "aws_account",
420
- "tableTo": "user",
421
- "columnsFrom": ["created_by"],
422
- "columnsTo": ["id"],
423
- "onDelete": "no action",
424
- "onUpdate": "no action"
425
- }
426
- },
427
- "compositePrimaryKeys": {},
428
- "uniqueConstraints": {
429
- "aws_account_external_id_unique": {
430
- "name": "aws_account_external_id_unique",
431
- "nullsNotDistinct": false,
432
- "columns": ["external_id"]
433
- }
434
- },
435
- "policies": {},
436
- "checkConstraints": {},
437
- "isRLSEnabled": false
438
- },
439
- "public.aws_account_permission": {
440
- "name": "aws_account_permission",
441
- "schema": "",
442
- "columns": {
443
- "id": {
444
- "name": "id",
445
- "type": "text",
446
- "primaryKey": true,
447
- "notNull": true
448
- },
449
- "user_id": {
450
- "name": "user_id",
451
- "type": "text",
452
- "primaryKey": false,
453
- "notNull": true
454
- },
455
- "aws_account_id": {
456
- "name": "aws_account_id",
457
- "type": "text",
458
- "primaryKey": false,
459
- "notNull": true
460
- },
461
- "permissions": {
462
- "name": "permissions",
463
- "type": "json",
464
- "primaryKey": false,
465
- "notNull": true
466
- },
467
- "granted_by": {
468
- "name": "granted_by",
469
- "type": "text",
470
- "primaryKey": false,
471
- "notNull": true
472
- },
473
- "expires_at": {
474
- "name": "expires_at",
475
- "type": "timestamp",
476
- "primaryKey": false,
477
- "notNull": false
478
- },
479
- "created_at": {
480
- "name": "created_at",
481
- "type": "timestamp",
482
- "primaryKey": false,
483
- "notNull": true,
484
- "default": "now()"
485
- },
486
- "updated_at": {
487
- "name": "updated_at",
488
- "type": "timestamp",
489
- "primaryKey": false,
490
- "notNull": true,
491
- "default": "now()"
492
- }
493
- },
494
- "indexes": {
495
- "aws_account_permission_user_idx": {
496
- "name": "aws_account_permission_user_idx",
497
- "columns": [
498
- {
499
- "expression": "user_id",
500
- "isExpression": false,
501
- "asc": true,
502
- "nulls": "last"
503
- }
504
- ],
505
- "isUnique": false,
506
- "concurrently": false,
507
- "method": "btree",
508
- "with": {}
509
- },
510
- "aws_account_permission_account_idx": {
511
- "name": "aws_account_permission_account_idx",
512
- "columns": [
513
- {
514
- "expression": "aws_account_id",
515
- "isExpression": false,
516
- "asc": true,
517
- "nulls": "last"
518
- }
519
- ],
520
- "isUnique": false,
521
- "concurrently": false,
522
- "method": "btree",
523
- "with": {}
524
- },
525
- "aws_account_permission_unique_idx": {
526
- "name": "aws_account_permission_unique_idx",
527
- "columns": [
528
- {
529
- "expression": "user_id",
530
- "isExpression": false,
531
- "asc": true,
532
- "nulls": "last"
533
- },
534
- {
535
- "expression": "aws_account_id",
536
- "isExpression": false,
537
- "asc": true,
538
- "nulls": "last"
539
- }
540
- ],
541
- "isUnique": false,
542
- "concurrently": false,
543
- "method": "btree",
544
- "with": {}
545
- }
546
- },
547
- "foreignKeys": {
548
- "aws_account_permission_user_id_user_id_fk": {
549
- "name": "aws_account_permission_user_id_user_id_fk",
550
- "tableFrom": "aws_account_permission",
551
- "tableTo": "user",
552
- "columnsFrom": ["user_id"],
553
- "columnsTo": ["id"],
554
- "onDelete": "cascade",
555
- "onUpdate": "no action"
556
- },
557
- "aws_account_permission_aws_account_id_aws_account_id_fk": {
558
- "name": "aws_account_permission_aws_account_id_aws_account_id_fk",
559
- "tableFrom": "aws_account_permission",
560
- "tableTo": "aws_account",
561
- "columnsFrom": ["aws_account_id"],
562
- "columnsTo": ["id"],
563
- "onDelete": "cascade",
564
- "onUpdate": "no action"
565
- },
566
- "aws_account_permission_granted_by_user_id_fk": {
567
- "name": "aws_account_permission_granted_by_user_id_fk",
568
- "tableFrom": "aws_account_permission",
569
- "tableTo": "user",
570
- "columnsFrom": ["granted_by"],
571
- "columnsTo": ["id"],
572
- "onDelete": "no action",
573
- "onUpdate": "no action"
574
- }
575
- },
576
- "compositePrimaryKeys": {},
577
- "uniqueConstraints": {},
578
- "policies": {},
579
- "checkConstraints": {},
580
- "isRLSEnabled": false
581
- },
582
- "public.email_template": {
583
- "name": "email_template",
584
- "schema": "",
585
- "columns": {
586
- "id": {
587
- "name": "id",
588
- "type": "text",
589
- "primaryKey": true,
590
- "notNull": true
591
- },
592
- "organization_id": {
593
- "name": "organization_id",
594
- "type": "text",
595
- "primaryKey": false,
596
- "notNull": true
597
- },
598
- "name": {
599
- "name": "name",
600
- "type": "text",
601
- "primaryKey": false,
602
- "notNull": true
603
- },
604
- "subject": {
605
- "name": "subject",
606
- "type": "text",
607
- "primaryKey": false,
608
- "notNull": false
609
- },
610
- "html": {
611
- "name": "html",
612
- "type": "text",
613
- "primaryKey": false,
614
- "notNull": false
615
- },
616
- "variables": {
617
- "name": "variables",
618
- "type": "json",
619
- "primaryKey": false,
620
- "notNull": false,
621
- "default": "'[]'::json"
622
- },
623
- "created_by": {
624
- "name": "created_by",
625
- "type": "text",
626
- "primaryKey": false,
627
- "notNull": false
628
- },
629
- "created_at": {
630
- "name": "created_at",
631
- "type": "timestamp",
632
- "primaryKey": false,
633
- "notNull": true,
634
- "default": "now()"
635
- },
636
- "updated_at": {
637
- "name": "updated_at",
638
- "type": "timestamp",
639
- "primaryKey": false,
640
- "notNull": true,
641
- "default": "now()"
642
- }
643
- },
644
- "indexes": {
645
- "email_template_org_idx": {
646
- "name": "email_template_org_idx",
647
- "columns": [
648
- {
649
- "expression": "organization_id",
650
- "isExpression": false,
651
- "asc": true,
652
- "nulls": "last"
653
- }
654
- ],
655
- "isUnique": false,
656
- "concurrently": false,
657
- "method": "btree",
658
- "with": {}
659
- }
660
- },
661
- "foreignKeys": {
662
- "email_template_organization_id_organization_id_fk": {
663
- "name": "email_template_organization_id_organization_id_fk",
664
- "tableFrom": "email_template",
665
- "tableTo": "organization",
666
- "columnsFrom": ["organization_id"],
667
- "columnsTo": ["id"],
668
- "onDelete": "cascade",
669
- "onUpdate": "no action"
670
- },
671
- "email_template_created_by_user_id_fk": {
672
- "name": "email_template_created_by_user_id_fk",
673
- "tableFrom": "email_template",
674
- "tableTo": "user",
675
- "columnsFrom": ["created_by"],
676
- "columnsTo": ["id"],
677
- "onDelete": "no action",
678
- "onUpdate": "no action"
679
- }
680
- },
681
- "compositePrimaryKeys": {},
682
- "uniqueConstraints": {},
683
- "policies": {},
684
- "checkConstraints": {},
685
- "isRLSEnabled": false
686
- },
687
- "public.organization_extension": {
688
- "name": "organization_extension",
689
- "schema": "",
690
- "columns": {
691
- "organization_id": {
692
- "name": "organization_id",
693
- "type": "text",
694
- "primaryKey": true,
695
- "notNull": true
696
- },
697
- "plan": {
698
- "name": "plan",
699
- "type": "text",
700
- "primaryKey": false,
701
- "notNull": true,
702
- "default": "'free'"
703
- },
704
- "stripe_customer_id": {
705
- "name": "stripe_customer_id",
706
- "type": "text",
707
- "primaryKey": false,
708
- "notNull": false
709
- },
710
- "stripe_subscription_id": {
711
- "name": "stripe_subscription_id",
712
- "type": "text",
713
- "primaryKey": false,
714
- "notNull": false
715
- },
716
- "aws_account_count": {
717
- "name": "aws_account_count",
718
- "type": "integer",
719
- "primaryKey": false,
720
- "notNull": true,
721
- "default": 0
722
- },
723
- "member_count": {
724
- "name": "member_count",
725
- "type": "integer",
726
- "primaryKey": false,
727
- "notNull": true,
728
- "default": 1
729
- },
730
- "onboarding_completed": {
731
- "name": "onboarding_completed",
732
- "type": "boolean",
733
- "primaryKey": false,
734
- "notNull": true,
735
- "default": false
736
- },
737
- "onboarding_completed_at": {
738
- "name": "onboarding_completed_at",
739
- "type": "timestamp",
740
- "primaryKey": false,
741
- "notNull": false
742
- },
743
- "updated_at": {
744
- "name": "updated_at",
745
- "type": "timestamp",
746
- "primaryKey": false,
747
- "notNull": true,
748
- "default": "now()"
749
- }
750
- },
751
- "indexes": {},
752
- "foreignKeys": {
753
- "organization_extension_organization_id_organization_id_fk": {
754
- "name": "organization_extension_organization_id_organization_id_fk",
755
- "tableFrom": "organization_extension",
756
- "tableTo": "organization",
757
- "columnsFrom": ["organization_id"],
758
- "columnsTo": ["id"],
759
- "onDelete": "cascade",
760
- "onUpdate": "no action"
761
- }
762
- },
763
- "compositePrimaryKeys": {},
764
- "uniqueConstraints": {},
765
- "policies": {},
766
- "checkConstraints": {},
767
- "isRLSEnabled": false
768
- },
769
- "public.account": {
770
- "name": "account",
771
- "schema": "",
772
- "columns": {
773
- "id": {
774
- "name": "id",
775
- "type": "text",
776
- "primaryKey": true,
777
- "notNull": true
778
- },
779
- "account_id": {
780
- "name": "account_id",
781
- "type": "text",
782
- "primaryKey": false,
783
- "notNull": true
784
- },
785
- "provider_id": {
786
- "name": "provider_id",
787
- "type": "text",
788
- "primaryKey": false,
789
- "notNull": true
790
- },
791
- "user_id": {
792
- "name": "user_id",
793
- "type": "text",
794
- "primaryKey": false,
795
- "notNull": true
796
- },
797
- "access_token": {
798
- "name": "access_token",
799
- "type": "text",
800
- "primaryKey": false,
801
- "notNull": false
802
- },
803
- "refresh_token": {
804
- "name": "refresh_token",
805
- "type": "text",
806
- "primaryKey": false,
807
- "notNull": false
808
- },
809
- "id_token": {
810
- "name": "id_token",
811
- "type": "text",
812
- "primaryKey": false,
813
- "notNull": false
814
- },
815
- "access_token_expires_at": {
816
- "name": "access_token_expires_at",
817
- "type": "timestamp",
818
- "primaryKey": false,
819
- "notNull": false
820
- },
821
- "refresh_token_expires_at": {
822
- "name": "refresh_token_expires_at",
823
- "type": "timestamp",
824
- "primaryKey": false,
825
- "notNull": false
826
- },
827
- "scope": {
828
- "name": "scope",
829
- "type": "text",
830
- "primaryKey": false,
831
- "notNull": false
832
- },
833
- "password": {
834
- "name": "password",
835
- "type": "text",
836
- "primaryKey": false,
837
- "notNull": false
838
- },
839
- "created_at": {
840
- "name": "created_at",
841
- "type": "timestamp",
842
- "primaryKey": false,
843
- "notNull": true
844
- },
845
- "updated_at": {
846
- "name": "updated_at",
847
- "type": "timestamp",
848
- "primaryKey": false,
849
- "notNull": true
850
- }
851
- },
852
- "indexes": {},
853
- "foreignKeys": {
854
- "account_user_id_user_id_fk": {
855
- "name": "account_user_id_user_id_fk",
856
- "tableFrom": "account",
857
- "tableTo": "user",
858
- "columnsFrom": ["user_id"],
859
- "columnsTo": ["id"],
860
- "onDelete": "cascade",
861
- "onUpdate": "no action"
862
- }
863
- },
864
- "compositePrimaryKeys": {},
865
- "uniqueConstraints": {},
866
- "policies": {},
867
- "checkConstraints": {},
868
- "isRLSEnabled": false
869
- },
870
- "public.invitation": {
871
- "name": "invitation",
872
- "schema": "",
873
- "columns": {
874
- "id": {
875
- "name": "id",
876
- "type": "text",
877
- "primaryKey": true,
878
- "notNull": true
879
- },
880
- "organization_id": {
881
- "name": "organization_id",
882
- "type": "text",
883
- "primaryKey": false,
884
- "notNull": true
885
- },
886
- "email": {
887
- "name": "email",
888
- "type": "text",
889
- "primaryKey": false,
890
- "notNull": true
891
- },
892
- "role": {
893
- "name": "role",
894
- "type": "text",
895
- "primaryKey": false,
896
- "notNull": false
897
- },
898
- "status": {
899
- "name": "status",
900
- "type": "text",
901
- "primaryKey": false,
902
- "notNull": true
903
- },
904
- "expires_at": {
905
- "name": "expires_at",
906
- "type": "timestamp",
907
- "primaryKey": false,
908
- "notNull": true
909
- },
910
- "inviter_id": {
911
- "name": "inviter_id",
912
- "type": "text",
913
- "primaryKey": false,
914
- "notNull": true
915
- }
916
- },
917
- "indexes": {},
918
- "foreignKeys": {
919
- "invitation_organization_id_organization_id_fk": {
920
- "name": "invitation_organization_id_organization_id_fk",
921
- "tableFrom": "invitation",
922
- "tableTo": "organization",
923
- "columnsFrom": ["organization_id"],
924
- "columnsTo": ["id"],
925
- "onDelete": "cascade",
926
- "onUpdate": "no action"
927
- },
928
- "invitation_inviter_id_user_id_fk": {
929
- "name": "invitation_inviter_id_user_id_fk",
930
- "tableFrom": "invitation",
931
- "tableTo": "user",
932
- "columnsFrom": ["inviter_id"],
933
- "columnsTo": ["id"],
934
- "onDelete": "cascade",
935
- "onUpdate": "no action"
936
- }
937
- },
938
- "compositePrimaryKeys": {},
939
- "uniqueConstraints": {},
940
- "policies": {},
941
- "checkConstraints": {},
942
- "isRLSEnabled": false
943
- },
944
- "public.member": {
945
- "name": "member",
946
- "schema": "",
947
- "columns": {
948
- "id": {
949
- "name": "id",
950
- "type": "text",
951
- "primaryKey": true,
952
- "notNull": true
953
- },
954
- "organization_id": {
955
- "name": "organization_id",
956
- "type": "text",
957
- "primaryKey": false,
958
- "notNull": true
959
- },
960
- "user_id": {
961
- "name": "user_id",
962
- "type": "text",
963
- "primaryKey": false,
964
- "notNull": true
965
- },
966
- "role": {
967
- "name": "role",
968
- "type": "text",
969
- "primaryKey": false,
970
- "notNull": true
971
- },
972
- "created_at": {
973
- "name": "created_at",
974
- "type": "timestamp",
975
- "primaryKey": false,
976
- "notNull": true
977
- }
978
- },
979
- "indexes": {},
980
- "foreignKeys": {
981
- "member_organization_id_organization_id_fk": {
982
- "name": "member_organization_id_organization_id_fk",
983
- "tableFrom": "member",
984
- "tableTo": "organization",
985
- "columnsFrom": ["organization_id"],
986
- "columnsTo": ["id"],
987
- "onDelete": "cascade",
988
- "onUpdate": "no action"
989
- },
990
- "member_user_id_user_id_fk": {
991
- "name": "member_user_id_user_id_fk",
992
- "tableFrom": "member",
993
- "tableTo": "user",
994
- "columnsFrom": ["user_id"],
995
- "columnsTo": ["id"],
996
- "onDelete": "cascade",
997
- "onUpdate": "no action"
998
- }
999
- },
1000
- "compositePrimaryKeys": {},
1001
- "uniqueConstraints": {},
1002
- "policies": {},
1003
- "checkConstraints": {},
1004
- "isRLSEnabled": false
1005
- },
1006
- "public.organization": {
1007
- "name": "organization",
1008
- "schema": "",
1009
- "columns": {
1010
- "id": {
1011
- "name": "id",
1012
- "type": "text",
1013
- "primaryKey": true,
1014
- "notNull": true
1015
- },
1016
- "name": {
1017
- "name": "name",
1018
- "type": "text",
1019
- "primaryKey": false,
1020
- "notNull": true
1021
- },
1022
- "slug": {
1023
- "name": "slug",
1024
- "type": "text",
1025
- "primaryKey": false,
1026
- "notNull": false
1027
- },
1028
- "logo": {
1029
- "name": "logo",
1030
- "type": "text",
1031
- "primaryKey": false,
1032
- "notNull": false
1033
- },
1034
- "metadata": {
1035
- "name": "metadata",
1036
- "type": "text",
1037
- "primaryKey": false,
1038
- "notNull": false
1039
- },
1040
- "created_at": {
1041
- "name": "created_at",
1042
- "type": "timestamp",
1043
- "primaryKey": false,
1044
- "notNull": true
1045
- }
1046
- },
1047
- "indexes": {},
1048
- "foreignKeys": {},
1049
- "compositePrimaryKeys": {},
1050
- "uniqueConstraints": {
1051
- "organization_slug_unique": {
1052
- "name": "organization_slug_unique",
1053
- "nullsNotDistinct": false,
1054
- "columns": ["slug"]
1055
- }
1056
- },
1057
- "policies": {},
1058
- "checkConstraints": {},
1059
- "isRLSEnabled": false
1060
- },
1061
- "public.passkey": {
1062
- "name": "passkey",
1063
- "schema": "",
1064
- "columns": {
1065
- "id": {
1066
- "name": "id",
1067
- "type": "text",
1068
- "primaryKey": true,
1069
- "notNull": true
1070
- },
1071
- "name": {
1072
- "name": "name",
1073
- "type": "text",
1074
- "primaryKey": false,
1075
- "notNull": false
1076
- },
1077
- "public_key": {
1078
- "name": "public_key",
1079
- "type": "text",
1080
- "primaryKey": false,
1081
- "notNull": true
1082
- },
1083
- "user_id": {
1084
- "name": "user_id",
1085
- "type": "text",
1086
- "primaryKey": false,
1087
- "notNull": true
1088
- },
1089
- "credential_id": {
1090
- "name": "credential_id",
1091
- "type": "text",
1092
- "primaryKey": false,
1093
- "notNull": true
1094
- },
1095
- "counter": {
1096
- "name": "counter",
1097
- "type": "integer",
1098
- "primaryKey": false,
1099
- "notNull": true
1100
- },
1101
- "device_type": {
1102
- "name": "device_type",
1103
- "type": "text",
1104
- "primaryKey": false,
1105
- "notNull": true
1106
- },
1107
- "backed_up": {
1108
- "name": "backed_up",
1109
- "type": "boolean",
1110
- "primaryKey": false,
1111
- "notNull": true
1112
- },
1113
- "transports": {
1114
- "name": "transports",
1115
- "type": "text",
1116
- "primaryKey": false,
1117
- "notNull": false
1118
- },
1119
- "created_at": {
1120
- "name": "created_at",
1121
- "type": "timestamp",
1122
- "primaryKey": false,
1123
- "notNull": true
1124
- },
1125
- "aaguid": {
1126
- "name": "aaguid",
1127
- "type": "text",
1128
- "primaryKey": false,
1129
- "notNull": false
1130
- }
1131
- },
1132
- "indexes": {},
1133
- "foreignKeys": {
1134
- "passkey_user_id_user_id_fk": {
1135
- "name": "passkey_user_id_user_id_fk",
1136
- "tableFrom": "passkey",
1137
- "tableTo": "user",
1138
- "columnsFrom": ["user_id"],
1139
- "columnsTo": ["id"],
1140
- "onDelete": "cascade",
1141
- "onUpdate": "no action"
1142
- }
1143
- },
1144
- "compositePrimaryKeys": {},
1145
- "uniqueConstraints": {},
1146
- "policies": {},
1147
- "checkConstraints": {},
1148
- "isRLSEnabled": false
1149
- },
1150
- "public.session": {
1151
- "name": "session",
1152
- "schema": "",
1153
- "columns": {
1154
- "id": {
1155
- "name": "id",
1156
- "type": "text",
1157
- "primaryKey": true,
1158
- "notNull": true
1159
- },
1160
- "expires_at": {
1161
- "name": "expires_at",
1162
- "type": "timestamp",
1163
- "primaryKey": false,
1164
- "notNull": true
1165
- },
1166
- "token": {
1167
- "name": "token",
1168
- "type": "text",
1169
- "primaryKey": false,
1170
- "notNull": true
1171
- },
1172
- "created_at": {
1173
- "name": "created_at",
1174
- "type": "timestamp",
1175
- "primaryKey": false,
1176
- "notNull": true
1177
- },
1178
- "updated_at": {
1179
- "name": "updated_at",
1180
- "type": "timestamp",
1181
- "primaryKey": false,
1182
- "notNull": true
1183
- },
1184
- "ip_address": {
1185
- "name": "ip_address",
1186
- "type": "text",
1187
- "primaryKey": false,
1188
- "notNull": false
1189
- },
1190
- "user_agent": {
1191
- "name": "user_agent",
1192
- "type": "text",
1193
- "primaryKey": false,
1194
- "notNull": false
1195
- },
1196
- "user_id": {
1197
- "name": "user_id",
1198
- "type": "text",
1199
- "primaryKey": false,
1200
- "notNull": true
1201
- },
1202
- "active_organization_id": {
1203
- "name": "active_organization_id",
1204
- "type": "text",
1205
- "primaryKey": false,
1206
- "notNull": false
1207
- }
1208
- },
1209
- "indexes": {},
1210
- "foreignKeys": {
1211
- "session_user_id_user_id_fk": {
1212
- "name": "session_user_id_user_id_fk",
1213
- "tableFrom": "session",
1214
- "tableTo": "user",
1215
- "columnsFrom": ["user_id"],
1216
- "columnsTo": ["id"],
1217
- "onDelete": "cascade",
1218
- "onUpdate": "no action"
1219
- }
1220
- },
1221
- "compositePrimaryKeys": {},
1222
- "uniqueConstraints": {
1223
- "session_token_unique": {
1224
- "name": "session_token_unique",
1225
- "nullsNotDistinct": false,
1226
- "columns": ["token"]
1227
- }
1228
- },
1229
- "policies": {},
1230
- "checkConstraints": {},
1231
- "isRLSEnabled": false
1232
- },
1233
- "public.statement": {
1234
- "name": "statement",
1235
- "schema": "",
1236
- "columns": {
1237
- "id": {
1238
- "name": "id",
1239
- "type": "text",
1240
- "primaryKey": true,
1241
- "notNull": true
1242
- },
1243
- "user_id": {
1244
- "name": "user_id",
1245
- "type": "text",
1246
- "primaryKey": false,
1247
- "notNull": false
1248
- },
1249
- "organization_id": {
1250
- "name": "organization_id",
1251
- "type": "text",
1252
- "primaryKey": false,
1253
- "notNull": false
1254
- },
1255
- "role_id": {
1256
- "name": "role_id",
1257
- "type": "text",
1258
- "primaryKey": false,
1259
- "notNull": false
1260
- },
1261
- "effect": {
1262
- "name": "effect",
1263
- "type": "text",
1264
- "primaryKey": false,
1265
- "notNull": true
1266
- },
1267
- "action": {
1268
- "name": "action",
1269
- "type": "text",
1270
- "primaryKey": false,
1271
- "notNull": true
1272
- },
1273
- "resource": {
1274
- "name": "resource",
1275
- "type": "text",
1276
- "primaryKey": false,
1277
- "notNull": true
1278
- },
1279
- "condition": {
1280
- "name": "condition",
1281
- "type": "text",
1282
- "primaryKey": false,
1283
- "notNull": false
1284
- },
1285
- "expires_at": {
1286
- "name": "expires_at",
1287
- "type": "timestamp",
1288
- "primaryKey": false,
1289
- "notNull": false
1290
- },
1291
- "created_at": {
1292
- "name": "created_at",
1293
- "type": "timestamp",
1294
- "primaryKey": false,
1295
- "notNull": true
1296
- },
1297
- "updated_at": {
1298
- "name": "updated_at",
1299
- "type": "timestamp",
1300
- "primaryKey": false,
1301
- "notNull": true
1302
- }
1303
- },
1304
- "indexes": {},
1305
- "foreignKeys": {
1306
- "statement_user_id_user_id_fk": {
1307
- "name": "statement_user_id_user_id_fk",
1308
- "tableFrom": "statement",
1309
- "tableTo": "user",
1310
- "columnsFrom": ["user_id"],
1311
- "columnsTo": ["id"],
1312
- "onDelete": "cascade",
1313
- "onUpdate": "no action"
1314
- },
1315
- "statement_organization_id_organization_id_fk": {
1316
- "name": "statement_organization_id_organization_id_fk",
1317
- "tableFrom": "statement",
1318
- "tableTo": "organization",
1319
- "columnsFrom": ["organization_id"],
1320
- "columnsTo": ["id"],
1321
- "onDelete": "cascade",
1322
- "onUpdate": "no action"
1323
- }
1324
- },
1325
- "compositePrimaryKeys": {},
1326
- "uniqueConstraints": {},
1327
- "policies": {},
1328
- "checkConstraints": {},
1329
- "isRLSEnabled": false
1330
- },
1331
- "public.subscription": {
1332
- "name": "subscription",
1333
- "schema": "",
1334
- "columns": {
1335
- "id": {
1336
- "name": "id",
1337
- "type": "text",
1338
- "primaryKey": true,
1339
- "notNull": true
1340
- },
1341
- "plan": {
1342
- "name": "plan",
1343
- "type": "text",
1344
- "primaryKey": false,
1345
- "notNull": true
1346
- },
1347
- "reference_id": {
1348
- "name": "reference_id",
1349
- "type": "text",
1350
- "primaryKey": false,
1351
- "notNull": true
1352
- },
1353
- "stripe_customer_id": {
1354
- "name": "stripe_customer_id",
1355
- "type": "text",
1356
- "primaryKey": false,
1357
- "notNull": false
1358
- },
1359
- "stripe_subscription_id": {
1360
- "name": "stripe_subscription_id",
1361
- "type": "text",
1362
- "primaryKey": false,
1363
- "notNull": false
1364
- },
1365
- "status": {
1366
- "name": "status",
1367
- "type": "text",
1368
- "primaryKey": false,
1369
- "notNull": true
1370
- },
1371
- "period_start": {
1372
- "name": "period_start",
1373
- "type": "timestamp",
1374
- "primaryKey": false,
1375
- "notNull": false
1376
- },
1377
- "period_end": {
1378
- "name": "period_end",
1379
- "type": "timestamp",
1380
- "primaryKey": false,
1381
- "notNull": false
1382
- },
1383
- "cancel_at_period_end": {
1384
- "name": "cancel_at_period_end",
1385
- "type": "boolean",
1386
- "primaryKey": false,
1387
- "notNull": false
1388
- },
1389
- "seats": {
1390
- "name": "seats",
1391
- "type": "integer",
1392
- "primaryKey": false,
1393
- "notNull": false
1394
- },
1395
- "trial_start": {
1396
- "name": "trial_start",
1397
- "type": "timestamp",
1398
- "primaryKey": false,
1399
- "notNull": false
1400
- },
1401
- "trial_end": {
1402
- "name": "trial_end",
1403
- "type": "timestamp",
1404
- "primaryKey": false,
1405
- "notNull": false
1406
- },
1407
- "created_at": {
1408
- "name": "created_at",
1409
- "type": "timestamp",
1410
- "primaryKey": false,
1411
- "notNull": true,
1412
- "default": "now()"
1413
- },
1414
- "updated_at": {
1415
- "name": "updated_at",
1416
- "type": "timestamp",
1417
- "primaryKey": false,
1418
- "notNull": true,
1419
- "default": "now()"
1420
- }
1421
- },
1422
- "indexes": {},
1423
- "foreignKeys": {},
1424
- "compositePrimaryKeys": {},
1425
- "uniqueConstraints": {},
1426
- "policies": {},
1427
- "checkConstraints": {},
1428
- "isRLSEnabled": false
1429
- },
1430
- "public.two_factor": {
1431
- "name": "two_factor",
1432
- "schema": "",
1433
- "columns": {
1434
- "id": {
1435
- "name": "id",
1436
- "type": "text",
1437
- "primaryKey": true,
1438
- "notNull": true
1439
- },
1440
- "secret": {
1441
- "name": "secret",
1442
- "type": "text",
1443
- "primaryKey": false,
1444
- "notNull": true
1445
- },
1446
- "backup_codes": {
1447
- "name": "backup_codes",
1448
- "type": "text",
1449
- "primaryKey": false,
1450
- "notNull": true
1451
- },
1452
- "user_id": {
1453
- "name": "user_id",
1454
- "type": "text",
1455
- "primaryKey": false,
1456
- "notNull": true
1457
- }
1458
- },
1459
- "indexes": {},
1460
- "foreignKeys": {
1461
- "two_factor_user_id_user_id_fk": {
1462
- "name": "two_factor_user_id_user_id_fk",
1463
- "tableFrom": "two_factor",
1464
- "tableTo": "user",
1465
- "columnsFrom": ["user_id"],
1466
- "columnsTo": ["id"],
1467
- "onDelete": "cascade",
1468
- "onUpdate": "no action"
1469
- }
1470
- },
1471
- "compositePrimaryKeys": {},
1472
- "uniqueConstraints": {},
1473
- "policies": {},
1474
- "checkConstraints": {},
1475
- "isRLSEnabled": false
1476
- },
1477
- "public.user": {
1478
- "name": "user",
1479
- "schema": "",
1480
- "columns": {
1481
- "id": {
1482
- "name": "id",
1483
- "type": "text",
1484
- "primaryKey": true,
1485
- "notNull": true
1486
- },
1487
- "name": {
1488
- "name": "name",
1489
- "type": "text",
1490
- "primaryKey": false,
1491
- "notNull": true
1492
- },
1493
- "email": {
1494
- "name": "email",
1495
- "type": "text",
1496
- "primaryKey": false,
1497
- "notNull": true
1498
- },
1499
- "email_verified": {
1500
- "name": "email_verified",
1501
- "type": "boolean",
1502
- "primaryKey": false,
1503
- "notNull": true
1504
- },
1505
- "image": {
1506
- "name": "image",
1507
- "type": "text",
1508
- "primaryKey": false,
1509
- "notNull": false
1510
- },
1511
- "created_at": {
1512
- "name": "created_at",
1513
- "type": "timestamp",
1514
- "primaryKey": false,
1515
- "notNull": true
1516
- },
1517
- "updated_at": {
1518
- "name": "updated_at",
1519
- "type": "timestamp",
1520
- "primaryKey": false,
1521
- "notNull": true
1522
- },
1523
- "two_factor_enabled": {
1524
- "name": "two_factor_enabled",
1525
- "type": "boolean",
1526
- "primaryKey": false,
1527
- "notNull": false
1528
- },
1529
- "last_login_method": {
1530
- "name": "last_login_method",
1531
- "type": "text",
1532
- "primaryKey": false,
1533
- "notNull": false
1534
- },
1535
- "stripe_customer_id": {
1536
- "name": "stripe_customer_id",
1537
- "type": "text",
1538
- "primaryKey": false,
1539
- "notNull": false
1540
- }
1541
- },
1542
- "indexes": {},
1543
- "foreignKeys": {},
1544
- "compositePrimaryKeys": {},
1545
- "uniqueConstraints": {
1546
- "user_email_unique": {
1547
- "name": "user_email_unique",
1548
- "nullsNotDistinct": false,
1549
- "columns": ["email"]
1550
- }
1551
- },
1552
- "policies": {},
1553
- "checkConstraints": {},
1554
- "isRLSEnabled": false
1555
- },
1556
- "public.verification": {
1557
- "name": "verification",
1558
- "schema": "",
1559
- "columns": {
1560
- "id": {
1561
- "name": "id",
1562
- "type": "text",
1563
- "primaryKey": true,
1564
- "notNull": true
1565
- },
1566
- "identifier": {
1567
- "name": "identifier",
1568
- "type": "text",
1569
- "primaryKey": false,
1570
- "notNull": true
1571
- },
1572
- "value": {
1573
- "name": "value",
1574
- "type": "text",
1575
- "primaryKey": false,
1576
- "notNull": true
1577
- },
1578
- "expires_at": {
1579
- "name": "expires_at",
1580
- "type": "timestamp",
1581
- "primaryKey": false,
1582
- "notNull": true
1583
- },
1584
- "created_at": {
1585
- "name": "created_at",
1586
- "type": "timestamp",
1587
- "primaryKey": false,
1588
- "notNull": false
1589
- },
1590
- "updated_at": {
1591
- "name": "updated_at",
1592
- "type": "timestamp",
1593
- "primaryKey": false,
1594
- "notNull": false
1595
- }
1596
- },
1597
- "indexes": {},
1598
- "foreignKeys": {},
1599
- "compositePrimaryKeys": {},
1600
- "uniqueConstraints": {},
1601
- "policies": {},
1602
- "checkConstraints": {},
1603
- "isRLSEnabled": false
1604
- },
1605
- "public.ai_conversation": {
1606
- "name": "ai_conversation",
1607
- "schema": "",
1608
- "columns": {
1609
- "id": {
1610
- "name": "id",
1611
- "type": "text",
1612
- "primaryKey": true,
1613
- "notNull": true
1614
- },
1615
- "organization_id": {
1616
- "name": "organization_id",
1617
- "type": "text",
1618
- "primaryKey": false,
1619
- "notNull": true
1620
- },
1621
- "template_id": {
1622
- "name": "template_id",
1623
- "type": "text",
1624
- "primaryKey": false,
1625
- "notNull": false
1626
- },
1627
- "messages": {
1628
- "name": "messages",
1629
- "type": "jsonb",
1630
- "primaryKey": false,
1631
- "notNull": false,
1632
- "default": "'[]'::jsonb"
1633
- },
1634
- "total_tokens": {
1635
- "name": "total_tokens",
1636
- "type": "integer",
1637
- "primaryKey": false,
1638
- "notNull": true,
1639
- "default": 0
1640
- },
1641
- "created_at": {
1642
- "name": "created_at",
1643
- "type": "timestamp",
1644
- "primaryKey": false,
1645
- "notNull": true,
1646
- "default": "now()"
1647
- },
1648
- "updated_at": {
1649
- "name": "updated_at",
1650
- "type": "timestamp",
1651
- "primaryKey": false,
1652
- "notNull": true,
1653
- "default": "now()"
1654
- },
1655
- "created_by": {
1656
- "name": "created_by",
1657
- "type": "text",
1658
- "primaryKey": false,
1659
- "notNull": true
1660
- }
1661
- },
1662
- "indexes": {
1663
- "ai_conversation_org_idx": {
1664
- "name": "ai_conversation_org_idx",
1665
- "columns": [
1666
- {
1667
- "expression": "organization_id",
1668
- "isExpression": false,
1669
- "asc": true,
1670
- "nulls": "last"
1671
- }
1672
- ],
1673
- "isUnique": false,
1674
- "concurrently": false,
1675
- "method": "btree",
1676
- "with": {}
1677
- },
1678
- "ai_conversation_template_idx": {
1679
- "name": "ai_conversation_template_idx",
1680
- "columns": [
1681
- {
1682
- "expression": "template_id",
1683
- "isExpression": false,
1684
- "asc": true,
1685
- "nulls": "last"
1686
- }
1687
- ],
1688
- "isUnique": false,
1689
- "concurrently": false,
1690
- "method": "btree",
1691
- "with": {}
1692
- }
1693
- },
1694
- "foreignKeys": {
1695
- "ai_conversation_organization_id_organization_id_fk": {
1696
- "name": "ai_conversation_organization_id_organization_id_fk",
1697
- "tableFrom": "ai_conversation",
1698
- "tableTo": "organization",
1699
- "columnsFrom": ["organization_id"],
1700
- "columnsTo": ["id"],
1701
- "onDelete": "cascade",
1702
- "onUpdate": "no action"
1703
- },
1704
- "ai_conversation_template_id_template_id_fk": {
1705
- "name": "ai_conversation_template_id_template_id_fk",
1706
- "tableFrom": "ai_conversation",
1707
- "tableTo": "template",
1708
- "columnsFrom": ["template_id"],
1709
- "columnsTo": ["id"],
1710
- "onDelete": "cascade",
1711
- "onUpdate": "no action"
1712
- },
1713
- "ai_conversation_created_by_user_id_fk": {
1714
- "name": "ai_conversation_created_by_user_id_fk",
1715
- "tableFrom": "ai_conversation",
1716
- "tableTo": "user",
1717
- "columnsFrom": ["created_by"],
1718
- "columnsTo": ["id"],
1719
- "onDelete": "set null",
1720
- "onUpdate": "no action"
1721
- }
1722
- },
1723
- "compositePrimaryKeys": {},
1724
- "uniqueConstraints": {},
1725
- "policies": {},
1726
- "checkConstraints": {},
1727
- "isRLSEnabled": false
1728
- },
1729
- "public.brand_kit": {
1730
- "name": "brand_kit",
1731
- "schema": "",
1732
- "columns": {
1733
- "id": {
1734
- "name": "id",
1735
- "type": "text",
1736
- "primaryKey": true,
1737
- "notNull": true
1738
- },
1739
- "organization_id": {
1740
- "name": "organization_id",
1741
- "type": "text",
1742
- "primaryKey": false,
1743
- "notNull": true
1744
- },
1745
- "name": {
1746
- "name": "name",
1747
- "type": "text",
1748
- "primaryKey": false,
1749
- "notNull": true,
1750
- "default": "'Default'"
1751
- },
1752
- "logo_url": {
1753
- "name": "logo_url",
1754
- "type": "text",
1755
- "primaryKey": false,
1756
- "notNull": false
1757
- },
1758
- "primary_color": {
1759
- "name": "primary_color",
1760
- "type": "text",
1761
- "primaryKey": false,
1762
- "notNull": true,
1763
- "default": "'#5046e5'"
1764
- },
1765
- "secondary_color": {
1766
- "name": "secondary_color",
1767
- "type": "text",
1768
- "primaryKey": false,
1769
- "notNull": true,
1770
- "default": "'#6366f1'"
1771
- },
1772
- "background_color": {
1773
- "name": "background_color",
1774
- "type": "text",
1775
- "primaryKey": false,
1776
- "notNull": true,
1777
- "default": "'#ffffff'"
1778
- },
1779
- "text_color": {
1780
- "name": "text_color",
1781
- "type": "text",
1782
- "primaryKey": false,
1783
- "notNull": true,
1784
- "default": "'#1f2937'"
1785
- },
1786
- "font_family": {
1787
- "name": "font_family",
1788
- "type": "text",
1789
- "primaryKey": false,
1790
- "notNull": true,
1791
- "default": "'system-ui, sans-serif'"
1792
- },
1793
- "heading_font_family": {
1794
- "name": "heading_font_family",
1795
- "type": "text",
1796
- "primaryKey": false,
1797
- "notNull": false
1798
- },
1799
- "button_style": {
1800
- "name": "button_style",
1801
- "type": "text",
1802
- "primaryKey": false,
1803
- "notNull": true,
1804
- "default": "'rounded'"
1805
- },
1806
- "button_radius": {
1807
- "name": "button_radius",
1808
- "type": "text",
1809
- "primaryKey": false,
1810
- "notNull": true,
1811
- "default": "'4px'"
1812
- },
1813
- "company_name": {
1814
- "name": "company_name",
1815
- "type": "text",
1816
- "primaryKey": false,
1817
- "notNull": false
1818
- },
1819
- "company_address": {
1820
- "name": "company_address",
1821
- "type": "text",
1822
- "primaryKey": false,
1823
- "notNull": false
1824
- },
1825
- "social_links": {
1826
- "name": "social_links",
1827
- "type": "jsonb",
1828
- "primaryKey": false,
1829
- "notNull": false,
1830
- "default": "'[]'::jsonb"
1831
- },
1832
- "source_domain": {
1833
- "name": "source_domain",
1834
- "type": "text",
1835
- "primaryKey": false,
1836
- "notNull": false
1837
- },
1838
- "auto_extracted": {
1839
- "name": "auto_extracted",
1840
- "type": "boolean",
1841
- "primaryKey": false,
1842
- "notNull": true,
1843
- "default": false
1844
- },
1845
- "is_default": {
1846
- "name": "is_default",
1847
- "type": "boolean",
1848
- "primaryKey": false,
1849
- "notNull": true,
1850
- "default": false
1851
- },
1852
- "created_at": {
1853
- "name": "created_at",
1854
- "type": "timestamp",
1855
- "primaryKey": false,
1856
- "notNull": true,
1857
- "default": "now()"
1858
- },
1859
- "updated_at": {
1860
- "name": "updated_at",
1861
- "type": "timestamp",
1862
- "primaryKey": false,
1863
- "notNull": true,
1864
- "default": "now()"
1865
- }
1866
- },
1867
- "indexes": {
1868
- "brand_kit_org_idx": {
1869
- "name": "brand_kit_org_idx",
1870
- "columns": [
1871
- {
1872
- "expression": "organization_id",
1873
- "isExpression": false,
1874
- "asc": true,
1875
- "nulls": "last"
1876
- }
1877
- ],
1878
- "isUnique": false,
1879
- "concurrently": false,
1880
- "method": "btree",
1881
- "with": {}
1882
- },
1883
- "brand_kit_default_idx": {
1884
- "name": "brand_kit_default_idx",
1885
- "columns": [
1886
- {
1887
- "expression": "organization_id",
1888
- "isExpression": false,
1889
- "asc": true,
1890
- "nulls": "last"
1891
- },
1892
- {
1893
- "expression": "is_default",
1894
- "isExpression": false,
1895
- "asc": true,
1896
- "nulls": "last"
1897
- }
1898
- ],
1899
- "isUnique": false,
1900
- "concurrently": false,
1901
- "method": "btree",
1902
- "with": {}
1903
- }
1904
- },
1905
- "foreignKeys": {
1906
- "brand_kit_organization_id_organization_id_fk": {
1907
- "name": "brand_kit_organization_id_organization_id_fk",
1908
- "tableFrom": "brand_kit",
1909
- "tableTo": "organization",
1910
- "columnsFrom": ["organization_id"],
1911
- "columnsTo": ["id"],
1912
- "onDelete": "cascade",
1913
- "onUpdate": "no action"
1914
- }
1915
- },
1916
- "compositePrimaryKeys": {},
1917
- "uniqueConstraints": {},
1918
- "policies": {},
1919
- "checkConstraints": {},
1920
- "isRLSEnabled": false
1921
- },
1922
- "public.reusable_block": {
1923
- "name": "reusable_block",
1924
- "schema": "",
1925
- "columns": {
1926
- "id": {
1927
- "name": "id",
1928
- "type": "text",
1929
- "primaryKey": true,
1930
- "notNull": true
1931
- },
1932
- "organization_id": {
1933
- "name": "organization_id",
1934
- "type": "text",
1935
- "primaryKey": false,
1936
- "notNull": true
1937
- },
1938
- "name": {
1939
- "name": "name",
1940
- "type": "text",
1941
- "primaryKey": false,
1942
- "notNull": true
1943
- },
1944
- "description": {
1945
- "name": "description",
1946
- "type": "text",
1947
- "primaryKey": false,
1948
- "notNull": false
1949
- },
1950
- "category": {
1951
- "name": "category",
1952
- "type": "text",
1953
- "primaryKey": false,
1954
- "notNull": true,
1955
- "default": "'custom'"
1956
- },
1957
- "content": {
1958
- "name": "content",
1959
- "type": "jsonb",
1960
- "primaryKey": false,
1961
- "notNull": true
1962
- },
1963
- "thumbnail": {
1964
- "name": "thumbnail",
1965
- "type": "text",
1966
- "primaryKey": false,
1967
- "notNull": false
1968
- },
1969
- "is_public": {
1970
- "name": "is_public",
1971
- "type": "boolean",
1972
- "primaryKey": false,
1973
- "notNull": true,
1974
- "default": false
1975
- },
1976
- "usage_count": {
1977
- "name": "usage_count",
1978
- "type": "integer",
1979
- "primaryKey": false,
1980
- "notNull": true,
1981
- "default": 0
1982
- },
1983
- "created_at": {
1984
- "name": "created_at",
1985
- "type": "timestamp",
1986
- "primaryKey": false,
1987
- "notNull": true,
1988
- "default": "now()"
1989
- },
1990
- "updated_at": {
1991
- "name": "updated_at",
1992
- "type": "timestamp",
1993
- "primaryKey": false,
1994
- "notNull": true,
1995
- "default": "now()"
1996
- },
1997
- "created_by": {
1998
- "name": "created_by",
1999
- "type": "text",
2000
- "primaryKey": false,
2001
- "notNull": true
2002
- }
2003
- },
2004
- "indexes": {
2005
- "reusable_block_org_idx": {
2006
- "name": "reusable_block_org_idx",
2007
- "columns": [
2008
- {
2009
- "expression": "organization_id",
2010
- "isExpression": false,
2011
- "asc": true,
2012
- "nulls": "last"
2013
- }
2014
- ],
2015
- "isUnique": false,
2016
- "concurrently": false,
2017
- "method": "btree",
2018
- "with": {}
2019
- },
2020
- "reusable_block_created_by_category_idx": {
2021
- "name": "reusable_block_created_by_category_idx",
2022
- "columns": [
2023
- {
2024
- "expression": "created_by",
2025
- "isExpression": false,
2026
- "asc": true,
2027
- "nulls": "last"
2028
- },
2029
- {
2030
- "expression": "category",
2031
- "isExpression": false,
2032
- "asc": true,
2033
- "nulls": "last"
2034
- }
2035
- ],
2036
- "isUnique": false,
2037
- "concurrently": false,
2038
- "method": "btree",
2039
- "with": {}
2040
- },
2041
- "reusable_block_public_category_idx": {
2042
- "name": "reusable_block_public_category_idx",
2043
- "columns": [
2044
- {
2045
- "expression": "is_public",
2046
- "isExpression": false,
2047
- "asc": true,
2048
- "nulls": "last"
2049
- },
2050
- {
2051
- "expression": "category",
2052
- "isExpression": false,
2053
- "asc": true,
2054
- "nulls": "last"
2055
- }
2056
- ],
2057
- "isUnique": false,
2058
- "concurrently": false,
2059
- "method": "btree",
2060
- "with": {}
2061
- }
2062
- },
2063
- "foreignKeys": {
2064
- "reusable_block_organization_id_organization_id_fk": {
2065
- "name": "reusable_block_organization_id_organization_id_fk",
2066
- "tableFrom": "reusable_block",
2067
- "tableTo": "organization",
2068
- "columnsFrom": ["organization_id"],
2069
- "columnsTo": ["id"],
2070
- "onDelete": "cascade",
2071
- "onUpdate": "no action"
2072
- },
2073
- "reusable_block_created_by_user_id_fk": {
2074
- "name": "reusable_block_created_by_user_id_fk",
2075
- "tableFrom": "reusable_block",
2076
- "tableTo": "user",
2077
- "columnsFrom": ["created_by"],
2078
- "columnsTo": ["id"],
2079
- "onDelete": "set null",
2080
- "onUpdate": "no action"
2081
- }
2082
- },
2083
- "compositePrimaryKeys": {},
2084
- "uniqueConstraints": {},
2085
- "policies": {},
2086
- "checkConstraints": {},
2087
- "isRLSEnabled": false
2088
- },
2089
- "public.template": {
2090
- "name": "template",
2091
- "schema": "",
2092
- "columns": {
2093
- "id": {
2094
- "name": "id",
2095
- "type": "text",
2096
- "primaryKey": true,
2097
- "notNull": true
2098
- },
2099
- "organization_id": {
2100
- "name": "organization_id",
2101
- "type": "text",
2102
- "primaryKey": false,
2103
- "notNull": true
2104
- },
2105
- "name": {
2106
- "name": "name",
2107
- "type": "text",
2108
- "primaryKey": false,
2109
- "notNull": true
2110
- },
2111
- "description": {
2112
- "name": "description",
2113
- "type": "text",
2114
- "primaryKey": false,
2115
- "notNull": false
2116
- },
2117
- "subject": {
2118
- "name": "subject",
2119
- "type": "text",
2120
- "primaryKey": false,
2121
- "notNull": false
2122
- },
2123
- "content": {
2124
- "name": "content",
2125
- "type": "jsonb",
2126
- "primaryKey": false,
2127
- "notNull": true
2128
- },
2129
- "compiled_html": {
2130
- "name": "compiled_html",
2131
- "type": "text",
2132
- "primaryKey": false,
2133
- "notNull": false
2134
- },
2135
- "compiled_text": {
2136
- "name": "compiled_text",
2137
- "type": "text",
2138
- "primaryKey": false,
2139
- "notNull": false
2140
- },
2141
- "variables": {
2142
- "name": "variables",
2143
- "type": "jsonb",
2144
- "primaryKey": false,
2145
- "notNull": false,
2146
- "default": "'[]'::jsonb"
2147
- },
2148
- "test_data": {
2149
- "name": "test_data",
2150
- "type": "jsonb",
2151
- "primaryKey": false,
2152
- "notNull": false,
2153
- "default": "'{}'::jsonb"
2154
- },
2155
- "room_id": {
2156
- "name": "room_id",
2157
- "type": "text",
2158
- "primaryKey": false,
2159
- "notNull": false
2160
- },
2161
- "is_collaborative": {
2162
- "name": "is_collaborative",
2163
- "type": "boolean",
2164
- "primaryKey": false,
2165
- "notNull": true,
2166
- "default": false
2167
- },
2168
- "ai_generated": {
2169
- "name": "ai_generated",
2170
- "type": "boolean",
2171
- "primaryKey": false,
2172
- "notNull": true,
2173
- "default": false
2174
- },
2175
- "ai_conversation_id": {
2176
- "name": "ai_conversation_id",
2177
- "type": "text",
2178
- "primaryKey": false,
2179
- "notNull": false
2180
- },
2181
- "ses_template_name": {
2182
- "name": "ses_template_name",
2183
- "type": "text",
2184
- "primaryKey": false,
2185
- "notNull": false
2186
- },
2187
- "published_at": {
2188
- "name": "published_at",
2189
- "type": "timestamp",
2190
- "primaryKey": false,
2191
- "notNull": false
2192
- },
2193
- "status": {
2194
- "name": "status",
2195
- "type": "template_status",
2196
- "typeSchema": "public",
2197
- "primaryKey": false,
2198
- "notNull": true,
2199
- "default": "'DRAFT'"
2200
- },
2201
- "created_at": {
2202
- "name": "created_at",
2203
- "type": "timestamp",
2204
- "primaryKey": false,
2205
- "notNull": true,
2206
- "default": "now()"
2207
- },
2208
- "updated_at": {
2209
- "name": "updated_at",
2210
- "type": "timestamp",
2211
- "primaryKey": false,
2212
- "notNull": true,
2213
- "default": "now()"
2214
- },
2215
- "created_by": {
2216
- "name": "created_by",
2217
- "type": "text",
2218
- "primaryKey": false,
2219
- "notNull": true
2220
- },
2221
- "last_edited_by": {
2222
- "name": "last_edited_by",
2223
- "type": "text",
2224
- "primaryKey": false,
2225
- "notNull": false
2226
- }
2227
- },
2228
- "indexes": {
2229
- "template_org_idx": {
2230
- "name": "template_org_idx",
2231
- "columns": [
2232
- {
2233
- "expression": "organization_id",
2234
- "isExpression": false,
2235
- "asc": true,
2236
- "nulls": "last"
2237
- }
2238
- ],
2239
- "isUnique": false,
2240
- "concurrently": false,
2241
- "method": "btree",
2242
- "with": {}
2243
- },
2244
- "template_status_updated_at_idx": {
2245
- "name": "template_status_updated_at_idx",
2246
- "columns": [
2247
- {
2248
- "expression": "status",
2249
- "isExpression": false,
2250
- "asc": true,
2251
- "nulls": "last"
2252
- },
2253
- {
2254
- "expression": "updated_at",
2255
- "isExpression": false,
2256
- "asc": true,
2257
- "nulls": "last"
2258
- }
2259
- ],
2260
- "isUnique": false,
2261
- "concurrently": false,
2262
- "method": "btree",
2263
- "with": {}
2264
- },
2265
- "template_created_by_idx": {
2266
- "name": "template_created_by_idx",
2267
- "columns": [
2268
- {
2269
- "expression": "created_by",
2270
- "isExpression": false,
2271
- "asc": true,
2272
- "nulls": "last"
2273
- }
2274
- ],
2275
- "isUnique": false,
2276
- "concurrently": false,
2277
- "method": "btree",
2278
- "with": {}
2279
- },
2280
- "template_room_id_idx": {
2281
- "name": "template_room_id_idx",
2282
- "columns": [
2283
- {
2284
- "expression": "room_id",
2285
- "isExpression": false,
2286
- "asc": true,
2287
- "nulls": "last"
2288
- }
2289
- ],
2290
- "isUnique": true,
2291
- "concurrently": false,
2292
- "method": "btree",
2293
- "with": {}
2294
- }
2295
- },
2296
- "foreignKeys": {
2297
- "template_organization_id_organization_id_fk": {
2298
- "name": "template_organization_id_organization_id_fk",
2299
- "tableFrom": "template",
2300
- "tableTo": "organization",
2301
- "columnsFrom": ["organization_id"],
2302
- "columnsTo": ["id"],
2303
- "onDelete": "cascade",
2304
- "onUpdate": "no action"
2305
- },
2306
- "template_created_by_user_id_fk": {
2307
- "name": "template_created_by_user_id_fk",
2308
- "tableFrom": "template",
2309
- "tableTo": "user",
2310
- "columnsFrom": ["created_by"],
2311
- "columnsTo": ["id"],
2312
- "onDelete": "set null",
2313
- "onUpdate": "no action"
2314
- },
2315
- "template_last_edited_by_user_id_fk": {
2316
- "name": "template_last_edited_by_user_id_fk",
2317
- "tableFrom": "template",
2318
- "tableTo": "user",
2319
- "columnsFrom": ["last_edited_by"],
2320
- "columnsTo": ["id"],
2321
- "onDelete": "set null",
2322
- "onUpdate": "no action"
2323
- }
2324
- },
2325
- "compositePrimaryKeys": {},
2326
- "uniqueConstraints": {},
2327
- "policies": {},
2328
- "checkConstraints": {},
2329
- "isRLSEnabled": false
2330
- },
2331
- "public.template_variable": {
2332
- "name": "template_variable",
2333
- "schema": "",
2334
- "columns": {
2335
- "id": {
2336
- "name": "id",
2337
- "type": "text",
2338
- "primaryKey": true,
2339
- "notNull": true
2340
- },
2341
- "organization_id": {
2342
- "name": "organization_id",
2343
- "type": "text",
2344
- "primaryKey": false,
2345
- "notNull": true
2346
- },
2347
- "name": {
2348
- "name": "name",
2349
- "type": "text",
2350
- "primaryKey": false,
2351
- "notNull": true
2352
- },
2353
- "label": {
2354
- "name": "label",
2355
- "type": "text",
2356
- "primaryKey": false,
2357
- "notNull": true
2358
- },
2359
- "type": {
2360
- "name": "type",
2361
- "type": "variable_type",
2362
- "typeSchema": "public",
2363
- "primaryKey": false,
2364
- "notNull": true
2365
- },
2366
- "required": {
2367
- "name": "required",
2368
- "type": "boolean",
2369
- "primaryKey": false,
2370
- "notNull": true,
2371
- "default": false
2372
- },
2373
- "fallback": {
2374
- "name": "fallback",
2375
- "type": "text",
2376
- "primaryKey": false,
2377
- "notNull": false
2378
- },
2379
- "validation": {
2380
- "name": "validation",
2381
- "type": "jsonb",
2382
- "primaryKey": false,
2383
- "notNull": false
2384
- },
2385
- "created_at": {
2386
- "name": "created_at",
2387
- "type": "timestamp",
2388
- "primaryKey": false,
2389
- "notNull": true,
2390
- "default": "now()"
2391
- },
2392
- "updated_at": {
2393
- "name": "updated_at",
2394
- "type": "timestamp",
2395
- "primaryKey": false,
2396
- "notNull": true,
2397
- "default": "now()"
2398
- }
2399
- },
2400
- "indexes": {
2401
- "template_variable_org_name_idx": {
2402
- "name": "template_variable_org_name_idx",
2403
- "columns": [
2404
- {
2405
- "expression": "organization_id",
2406
- "isExpression": false,
2407
- "asc": true,
2408
- "nulls": "last"
2409
- },
2410
- {
2411
- "expression": "name",
2412
- "isExpression": false,
2413
- "asc": true,
2414
- "nulls": "last"
2415
- }
2416
- ],
2417
- "isUnique": true,
2418
- "concurrently": false,
2419
- "method": "btree",
2420
- "with": {}
2421
- }
2422
- },
2423
- "foreignKeys": {
2424
- "template_variable_organization_id_organization_id_fk": {
2425
- "name": "template_variable_organization_id_organization_id_fk",
2426
- "tableFrom": "template_variable",
2427
- "tableTo": "organization",
2428
- "columnsFrom": ["organization_id"],
2429
- "columnsTo": ["id"],
2430
- "onDelete": "cascade",
2431
- "onUpdate": "no action"
2432
- }
2433
- },
2434
- "compositePrimaryKeys": {},
2435
- "uniqueConstraints": {},
2436
- "policies": {},
2437
- "checkConstraints": {},
2438
- "isRLSEnabled": false
2439
- },
2440
- "public.template_version": {
2441
- "name": "template_version",
2442
- "schema": "",
2443
- "columns": {
2444
- "id": {
2445
- "name": "id",
2446
- "type": "text",
2447
- "primaryKey": true,
2448
- "notNull": true
2449
- },
2450
- "template_id": {
2451
- "name": "template_id",
2452
- "type": "text",
2453
- "primaryKey": false,
2454
- "notNull": true
2455
- },
2456
- "content": {
2457
- "name": "content",
2458
- "type": "jsonb",
2459
- "primaryKey": false,
2460
- "notNull": true
2461
- },
2462
- "version": {
2463
- "name": "version",
2464
- "type": "integer",
2465
- "primaryKey": false,
2466
- "notNull": true
2467
- },
2468
- "created_at": {
2469
- "name": "created_at",
2470
- "type": "timestamp",
2471
- "primaryKey": false,
2472
- "notNull": true,
2473
- "default": "now()"
2474
- },
2475
- "created_by": {
2476
- "name": "created_by",
2477
- "type": "text",
2478
- "primaryKey": false,
2479
- "notNull": true
2480
- },
2481
- "change_note": {
2482
- "name": "change_note",
2483
- "type": "text",
2484
- "primaryKey": false,
2485
- "notNull": false
2486
- }
2487
- },
2488
- "indexes": {
2489
- "template_version_template_version_idx": {
2490
- "name": "template_version_template_version_idx",
2491
- "columns": [
2492
- {
2493
- "expression": "template_id",
2494
- "isExpression": false,
2495
- "asc": true,
2496
- "nulls": "last"
2497
- },
2498
- {
2499
- "expression": "version",
2500
- "isExpression": false,
2501
- "asc": true,
2502
- "nulls": "last"
2503
- }
2504
- ],
2505
- "isUnique": true,
2506
- "concurrently": false,
2507
- "method": "btree",
2508
- "with": {}
2509
- },
2510
- "template_version_template_created_at_idx": {
2511
- "name": "template_version_template_created_at_idx",
2512
- "columns": [
2513
- {
2514
- "expression": "template_id",
2515
- "isExpression": false,
2516
- "asc": true,
2517
- "nulls": "last"
2518
- },
2519
- {
2520
- "expression": "created_at",
2521
- "isExpression": false,
2522
- "asc": true,
2523
- "nulls": "last"
2524
- }
2525
- ],
2526
- "isUnique": false,
2527
- "concurrently": false,
2528
- "method": "btree",
2529
- "with": {}
2530
- }
2531
- },
2532
- "foreignKeys": {
2533
- "template_version_template_id_template_id_fk": {
2534
- "name": "template_version_template_id_template_id_fk",
2535
- "tableFrom": "template_version",
2536
- "tableTo": "template",
2537
- "columnsFrom": ["template_id"],
2538
- "columnsTo": ["id"],
2539
- "onDelete": "cascade",
2540
- "onUpdate": "no action"
2541
- },
2542
- "template_version_created_by_user_id_fk": {
2543
- "name": "template_version_created_by_user_id_fk",
2544
- "tableFrom": "template_version",
2545
- "tableTo": "user",
2546
- "columnsFrom": ["created_by"],
2547
- "columnsTo": ["id"],
2548
- "onDelete": "set null",
2549
- "onUpdate": "no action"
2550
- }
2551
- },
2552
- "compositePrimaryKeys": {},
2553
- "uniqueConstraints": {},
2554
- "policies": {},
2555
- "checkConstraints": {},
2556
- "isRLSEnabled": false
2557
- },
2558
- "public.ai_usage_log": {
2559
- "name": "ai_usage_log",
2560
- "schema": "",
2561
- "columns": {
2562
- "id": {
2563
- "name": "id",
2564
- "type": "text",
2565
- "primaryKey": true,
2566
- "notNull": true
2567
- },
2568
- "organization_id": {
2569
- "name": "organization_id",
2570
- "type": "text",
2571
- "primaryKey": false,
2572
- "notNull": true
2573
- },
2574
- "user_id": {
2575
- "name": "user_id",
2576
- "type": "text",
2577
- "primaryKey": false,
2578
- "notNull": false
2579
- },
2580
- "period_key": {
2581
- "name": "period_key",
2582
- "type": "text",
2583
- "primaryKey": false,
2584
- "notNull": true
2585
- },
2586
- "feature_type": {
2587
- "name": "feature_type",
2588
- "type": "text",
2589
- "primaryKey": false,
2590
- "notNull": true,
2591
- "default": "'ai_chat'"
2592
- },
2593
- "template_id": {
2594
- "name": "template_id",
2595
- "type": "text",
2596
- "primaryKey": false,
2597
- "notNull": false
2598
- },
2599
- "input_tokens": {
2600
- "name": "input_tokens",
2601
- "type": "integer",
2602
- "primaryKey": false,
2603
- "notNull": false
2604
- },
2605
- "output_tokens": {
2606
- "name": "output_tokens",
2607
- "type": "integer",
2608
- "primaryKey": false,
2609
- "notNull": false
2610
- },
2611
- "total_tokens": {
2612
- "name": "total_tokens",
2613
- "type": "integer",
2614
- "primaryKey": false,
2615
- "notNull": false
2616
- },
2617
- "model": {
2618
- "name": "model",
2619
- "type": "text",
2620
- "primaryKey": false,
2621
- "notNull": false
2622
- },
2623
- "duration_ms": {
2624
- "name": "duration_ms",
2625
- "type": "integer",
2626
- "primaryKey": false,
2627
- "notNull": false
2628
- },
2629
- "created_at": {
2630
- "name": "created_at",
2631
- "type": "timestamp",
2632
- "primaryKey": false,
2633
- "notNull": true,
2634
- "default": "now()"
2635
- }
2636
- },
2637
- "indexes": {
2638
- "ai_usage_log_org_idx": {
2639
- "name": "ai_usage_log_org_idx",
2640
- "columns": [
2641
- {
2642
- "expression": "organization_id",
2643
- "isExpression": false,
2644
- "asc": true,
2645
- "nulls": "last"
2646
- }
2647
- ],
2648
- "isUnique": false,
2649
- "concurrently": false,
2650
- "method": "btree",
2651
- "with": {}
2652
- },
2653
- "ai_usage_log_period_idx": {
2654
- "name": "ai_usage_log_period_idx",
2655
- "columns": [
2656
- {
2657
- "expression": "period_key",
2658
- "isExpression": false,
2659
- "asc": true,
2660
- "nulls": "last"
2661
- }
2662
- ],
2663
- "isUnique": false,
2664
- "concurrently": false,
2665
- "method": "btree",
2666
- "with": {}
2667
- },
2668
- "ai_usage_log_org_period_idx": {
2669
- "name": "ai_usage_log_org_period_idx",
2670
- "columns": [
2671
- {
2672
- "expression": "organization_id",
2673
- "isExpression": false,
2674
- "asc": true,
2675
- "nulls": "last"
2676
- },
2677
- {
2678
- "expression": "period_key",
2679
- "isExpression": false,
2680
- "asc": true,
2681
- "nulls": "last"
2682
- }
2683
- ],
2684
- "isUnique": false,
2685
- "concurrently": false,
2686
- "method": "btree",
2687
- "with": {}
2688
- },
2689
- "ai_usage_log_user_idx": {
2690
- "name": "ai_usage_log_user_idx",
2691
- "columns": [
2692
- {
2693
- "expression": "user_id",
2694
- "isExpression": false,
2695
- "asc": true,
2696
- "nulls": "last"
2697
- }
2698
- ],
2699
- "isUnique": false,
2700
- "concurrently": false,
2701
- "method": "btree",
2702
- "with": {}
2703
- },
2704
- "ai_usage_log_created_idx": {
2705
- "name": "ai_usage_log_created_idx",
2706
- "columns": [
2707
- {
2708
- "expression": "created_at",
2709
- "isExpression": false,
2710
- "asc": true,
2711
- "nulls": "last"
2712
- }
2713
- ],
2714
- "isUnique": false,
2715
- "concurrently": false,
2716
- "method": "btree",
2717
- "with": {}
2718
- }
2719
- },
2720
- "foreignKeys": {
2721
- "ai_usage_log_organization_id_organization_id_fk": {
2722
- "name": "ai_usage_log_organization_id_organization_id_fk",
2723
- "tableFrom": "ai_usage_log",
2724
- "tableTo": "organization",
2725
- "columnsFrom": ["organization_id"],
2726
- "columnsTo": ["id"],
2727
- "onDelete": "cascade",
2728
- "onUpdate": "no action"
2729
- },
2730
- "ai_usage_log_user_id_user_id_fk": {
2731
- "name": "ai_usage_log_user_id_user_id_fk",
2732
- "tableFrom": "ai_usage_log",
2733
- "tableTo": "user",
2734
- "columnsFrom": ["user_id"],
2735
- "columnsTo": ["id"],
2736
- "onDelete": "set null",
2737
- "onUpdate": "no action"
2738
- }
2739
- },
2740
- "compositePrimaryKeys": {},
2741
- "uniqueConstraints": {},
2742
- "policies": {},
2743
- "checkConstraints": {},
2744
- "isRLSEnabled": false
2745
- },
2746
- "public.ai_usage_monthly": {
2747
- "name": "ai_usage_monthly",
2748
- "schema": "",
2749
- "columns": {
2750
- "id": {
2751
- "name": "id",
2752
- "type": "text",
2753
- "primaryKey": true,
2754
- "notNull": true
2755
- },
2756
- "organization_id": {
2757
- "name": "organization_id",
2758
- "type": "text",
2759
- "primaryKey": false,
2760
- "notNull": true
2761
- },
2762
- "period_key": {
2763
- "name": "period_key",
2764
- "type": "text",
2765
- "primaryKey": false,
2766
- "notNull": true
2767
- },
2768
- "message_count": {
2769
- "name": "message_count",
2770
- "type": "integer",
2771
- "primaryKey": false,
2772
- "notNull": true,
2773
- "default": 0
2774
- },
2775
- "updated_at": {
2776
- "name": "updated_at",
2777
- "type": "timestamp",
2778
- "primaryKey": false,
2779
- "notNull": true,
2780
- "default": "now()"
2781
- }
2782
- },
2783
- "indexes": {
2784
- "ai_usage_monthly_org_period_idx": {
2785
- "name": "ai_usage_monthly_org_period_idx",
2786
- "columns": [
2787
- {
2788
- "expression": "organization_id",
2789
- "isExpression": false,
2790
- "asc": true,
2791
- "nulls": "last"
2792
- },
2793
- {
2794
- "expression": "period_key",
2795
- "isExpression": false,
2796
- "asc": true,
2797
- "nulls": "last"
2798
- }
2799
- ],
2800
- "isUnique": true,
2801
- "concurrently": false,
2802
- "method": "btree",
2803
- "with": {}
2804
- },
2805
- "ai_usage_monthly_period_idx": {
2806
- "name": "ai_usage_monthly_period_idx",
2807
- "columns": [
2808
- {
2809
- "expression": "period_key",
2810
- "isExpression": false,
2811
- "asc": true,
2812
- "nulls": "last"
2813
- }
2814
- ],
2815
- "isUnique": false,
2816
- "concurrently": false,
2817
- "method": "btree",
2818
- "with": {}
2819
- }
2820
- },
2821
- "foreignKeys": {
2822
- "ai_usage_monthly_organization_id_organization_id_fk": {
2823
- "name": "ai_usage_monthly_organization_id_organization_id_fk",
2824
- "tableFrom": "ai_usage_monthly",
2825
- "tableTo": "organization",
2826
- "columnsFrom": ["organization_id"],
2827
- "columnsTo": ["id"],
2828
- "onDelete": "cascade",
2829
- "onUpdate": "no action"
2830
- }
2831
- },
2832
- "compositePrimaryKeys": {},
2833
- "uniqueConstraints": {},
2834
- "policies": {},
2835
- "checkConstraints": {},
2836
- "isRLSEnabled": false
2837
- }
2838
- },
2839
- "enums": {
2840
- "public.template_status": {
2841
- "name": "template_status",
2842
- "schema": "public",
2843
- "values": ["DRAFT", "PUBLISHED", "ARCHIVED"]
2844
- },
2845
- "public.variable_type": {
2846
- "name": "variable_type",
2847
- "schema": "public",
2848
- "values": ["TEXT", "NUMBER", "BOOLEAN", "DATE", "URL", "EMAIL"]
2849
- }
2850
- },
2851
- "schemas": {},
2852
- "sequences": {},
2853
- "roles": {},
2854
- "policies": {},
2855
- "views": {},
2856
- "_meta": {
2857
- "columns": {},
2858
- "schemas": {},
2859
- "tables": {}
2860
- }
2861
- }