@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,3600 +0,0 @@
1
- {
2
- "id": "360b955a-2a18-4117-b335-cfe4fbe4199b",
3
- "prevId": "f391d985-382c-4db8-b84d-46ff49e87e42",
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
- "sms_enabled": {
355
- "name": "sms_enabled",
356
- "type": "boolean",
357
- "primaryKey": false,
358
- "notNull": true,
359
- "default": false
360
- },
361
- "sms_phone_number_count": {
362
- "name": "sms_phone_number_count",
363
- "type": "integer",
364
- "primaryKey": false,
365
- "notNull": true,
366
- "default": 0
367
- },
368
- "created_by": {
369
- "name": "created_by",
370
- "type": "text",
371
- "primaryKey": false,
372
- "notNull": false
373
- },
374
- "created_at": {
375
- "name": "created_at",
376
- "type": "timestamp",
377
- "primaryKey": false,
378
- "notNull": true,
379
- "default": "now()"
380
- },
381
- "updated_at": {
382
- "name": "updated_at",
383
- "type": "timestamp",
384
- "primaryKey": false,
385
- "notNull": true,
386
- "default": "now()"
387
- }
388
- },
389
- "indexes": {
390
- "aws_account_org_idx": {
391
- "name": "aws_account_org_idx",
392
- "columns": [
393
- {
394
- "expression": "organization_id",
395
- "isExpression": false,
396
- "asc": true,
397
- "nulls": "last"
398
- }
399
- ],
400
- "isUnique": false,
401
- "concurrently": false,
402
- "method": "btree",
403
- "with": {}
404
- },
405
- "aws_account_external_id_idx": {
406
- "name": "aws_account_external_id_idx",
407
- "columns": [
408
- {
409
- "expression": "external_id",
410
- "isExpression": false,
411
- "asc": true,
412
- "nulls": "last"
413
- }
414
- ],
415
- "isUnique": false,
416
- "concurrently": false,
417
- "method": "btree",
418
- "with": {}
419
- }
420
- },
421
- "foreignKeys": {
422
- "aws_account_organization_id_organization_id_fk": {
423
- "name": "aws_account_organization_id_organization_id_fk",
424
- "tableFrom": "aws_account",
425
- "tableTo": "organization",
426
- "columnsFrom": ["organization_id"],
427
- "columnsTo": ["id"],
428
- "onDelete": "cascade",
429
- "onUpdate": "no action"
430
- },
431
- "aws_account_created_by_user_id_fk": {
432
- "name": "aws_account_created_by_user_id_fk",
433
- "tableFrom": "aws_account",
434
- "tableTo": "user",
435
- "columnsFrom": ["created_by"],
436
- "columnsTo": ["id"],
437
- "onDelete": "no action",
438
- "onUpdate": "no action"
439
- }
440
- },
441
- "compositePrimaryKeys": {},
442
- "uniqueConstraints": {
443
- "aws_account_external_id_unique": {
444
- "name": "aws_account_external_id_unique",
445
- "nullsNotDistinct": false,
446
- "columns": ["external_id"]
447
- }
448
- },
449
- "policies": {},
450
- "checkConstraints": {},
451
- "isRLSEnabled": false
452
- },
453
- "public.aws_account_permission": {
454
- "name": "aws_account_permission",
455
- "schema": "",
456
- "columns": {
457
- "id": {
458
- "name": "id",
459
- "type": "text",
460
- "primaryKey": true,
461
- "notNull": true
462
- },
463
- "user_id": {
464
- "name": "user_id",
465
- "type": "text",
466
- "primaryKey": false,
467
- "notNull": true
468
- },
469
- "aws_account_id": {
470
- "name": "aws_account_id",
471
- "type": "text",
472
- "primaryKey": false,
473
- "notNull": true
474
- },
475
- "permissions": {
476
- "name": "permissions",
477
- "type": "json",
478
- "primaryKey": false,
479
- "notNull": true
480
- },
481
- "granted_by": {
482
- "name": "granted_by",
483
- "type": "text",
484
- "primaryKey": false,
485
- "notNull": true
486
- },
487
- "expires_at": {
488
- "name": "expires_at",
489
- "type": "timestamp",
490
- "primaryKey": false,
491
- "notNull": false
492
- },
493
- "created_at": {
494
- "name": "created_at",
495
- "type": "timestamp",
496
- "primaryKey": false,
497
- "notNull": true,
498
- "default": "now()"
499
- },
500
- "updated_at": {
501
- "name": "updated_at",
502
- "type": "timestamp",
503
- "primaryKey": false,
504
- "notNull": true,
505
- "default": "now()"
506
- }
507
- },
508
- "indexes": {
509
- "aws_account_permission_user_idx": {
510
- "name": "aws_account_permission_user_idx",
511
- "columns": [
512
- {
513
- "expression": "user_id",
514
- "isExpression": false,
515
- "asc": true,
516
- "nulls": "last"
517
- }
518
- ],
519
- "isUnique": false,
520
- "concurrently": false,
521
- "method": "btree",
522
- "with": {}
523
- },
524
- "aws_account_permission_account_idx": {
525
- "name": "aws_account_permission_account_idx",
526
- "columns": [
527
- {
528
- "expression": "aws_account_id",
529
- "isExpression": false,
530
- "asc": true,
531
- "nulls": "last"
532
- }
533
- ],
534
- "isUnique": false,
535
- "concurrently": false,
536
- "method": "btree",
537
- "with": {}
538
- },
539
- "aws_account_permission_unique_idx": {
540
- "name": "aws_account_permission_unique_idx",
541
- "columns": [
542
- {
543
- "expression": "user_id",
544
- "isExpression": false,
545
- "asc": true,
546
- "nulls": "last"
547
- },
548
- {
549
- "expression": "aws_account_id",
550
- "isExpression": false,
551
- "asc": true,
552
- "nulls": "last"
553
- }
554
- ],
555
- "isUnique": false,
556
- "concurrently": false,
557
- "method": "btree",
558
- "with": {}
559
- }
560
- },
561
- "foreignKeys": {
562
- "aws_account_permission_user_id_user_id_fk": {
563
- "name": "aws_account_permission_user_id_user_id_fk",
564
- "tableFrom": "aws_account_permission",
565
- "tableTo": "user",
566
- "columnsFrom": ["user_id"],
567
- "columnsTo": ["id"],
568
- "onDelete": "cascade",
569
- "onUpdate": "no action"
570
- },
571
- "aws_account_permission_aws_account_id_aws_account_id_fk": {
572
- "name": "aws_account_permission_aws_account_id_aws_account_id_fk",
573
- "tableFrom": "aws_account_permission",
574
- "tableTo": "aws_account",
575
- "columnsFrom": ["aws_account_id"],
576
- "columnsTo": ["id"],
577
- "onDelete": "cascade",
578
- "onUpdate": "no action"
579
- },
580
- "aws_account_permission_granted_by_user_id_fk": {
581
- "name": "aws_account_permission_granted_by_user_id_fk",
582
- "tableFrom": "aws_account_permission",
583
- "tableTo": "user",
584
- "columnsFrom": ["granted_by"],
585
- "columnsTo": ["id"],
586
- "onDelete": "no action",
587
- "onUpdate": "no action"
588
- }
589
- },
590
- "compositePrimaryKeys": {},
591
- "uniqueConstraints": {},
592
- "policies": {},
593
- "checkConstraints": {},
594
- "isRLSEnabled": false
595
- },
596
- "public.email_template": {
597
- "name": "email_template",
598
- "schema": "",
599
- "columns": {
600
- "id": {
601
- "name": "id",
602
- "type": "text",
603
- "primaryKey": true,
604
- "notNull": true
605
- },
606
- "organization_id": {
607
- "name": "organization_id",
608
- "type": "text",
609
- "primaryKey": false,
610
- "notNull": true
611
- },
612
- "name": {
613
- "name": "name",
614
- "type": "text",
615
- "primaryKey": false,
616
- "notNull": true
617
- },
618
- "subject": {
619
- "name": "subject",
620
- "type": "text",
621
- "primaryKey": false,
622
- "notNull": false
623
- },
624
- "html": {
625
- "name": "html",
626
- "type": "text",
627
- "primaryKey": false,
628
- "notNull": false
629
- },
630
- "variables": {
631
- "name": "variables",
632
- "type": "json",
633
- "primaryKey": false,
634
- "notNull": false,
635
- "default": "'[]'::json"
636
- },
637
- "created_by": {
638
- "name": "created_by",
639
- "type": "text",
640
- "primaryKey": false,
641
- "notNull": false
642
- },
643
- "created_at": {
644
- "name": "created_at",
645
- "type": "timestamp",
646
- "primaryKey": false,
647
- "notNull": true,
648
- "default": "now()"
649
- },
650
- "updated_at": {
651
- "name": "updated_at",
652
- "type": "timestamp",
653
- "primaryKey": false,
654
- "notNull": true,
655
- "default": "now()"
656
- }
657
- },
658
- "indexes": {
659
- "email_template_org_idx": {
660
- "name": "email_template_org_idx",
661
- "columns": [
662
- {
663
- "expression": "organization_id",
664
- "isExpression": false,
665
- "asc": true,
666
- "nulls": "last"
667
- }
668
- ],
669
- "isUnique": false,
670
- "concurrently": false,
671
- "method": "btree",
672
- "with": {}
673
- }
674
- },
675
- "foreignKeys": {
676
- "email_template_organization_id_organization_id_fk": {
677
- "name": "email_template_organization_id_organization_id_fk",
678
- "tableFrom": "email_template",
679
- "tableTo": "organization",
680
- "columnsFrom": ["organization_id"],
681
- "columnsTo": ["id"],
682
- "onDelete": "cascade",
683
- "onUpdate": "no action"
684
- },
685
- "email_template_created_by_user_id_fk": {
686
- "name": "email_template_created_by_user_id_fk",
687
- "tableFrom": "email_template",
688
- "tableTo": "user",
689
- "columnsFrom": ["created_by"],
690
- "columnsTo": ["id"],
691
- "onDelete": "no action",
692
- "onUpdate": "no action"
693
- }
694
- },
695
- "compositePrimaryKeys": {},
696
- "uniqueConstraints": {},
697
- "policies": {},
698
- "checkConstraints": {},
699
- "isRLSEnabled": false
700
- },
701
- "public.organization_extension": {
702
- "name": "organization_extension",
703
- "schema": "",
704
- "columns": {
705
- "organization_id": {
706
- "name": "organization_id",
707
- "type": "text",
708
- "primaryKey": true,
709
- "notNull": true
710
- },
711
- "plan": {
712
- "name": "plan",
713
- "type": "text",
714
- "primaryKey": false,
715
- "notNull": true,
716
- "default": "'free'"
717
- },
718
- "stripe_customer_id": {
719
- "name": "stripe_customer_id",
720
- "type": "text",
721
- "primaryKey": false,
722
- "notNull": false
723
- },
724
- "stripe_subscription_id": {
725
- "name": "stripe_subscription_id",
726
- "type": "text",
727
- "primaryKey": false,
728
- "notNull": false
729
- },
730
- "aws_account_count": {
731
- "name": "aws_account_count",
732
- "type": "integer",
733
- "primaryKey": false,
734
- "notNull": true,
735
- "default": 0
736
- },
737
- "member_count": {
738
- "name": "member_count",
739
- "type": "integer",
740
- "primaryKey": false,
741
- "notNull": true,
742
- "default": 1
743
- },
744
- "onboarding_completed": {
745
- "name": "onboarding_completed",
746
- "type": "boolean",
747
- "primaryKey": false,
748
- "notNull": true,
749
- "default": false
750
- },
751
- "onboarding_completed_at": {
752
- "name": "onboarding_completed_at",
753
- "type": "timestamp",
754
- "primaryKey": false,
755
- "notNull": false
756
- },
757
- "updated_at": {
758
- "name": "updated_at",
759
- "type": "timestamp",
760
- "primaryKey": false,
761
- "notNull": true,
762
- "default": "now()"
763
- }
764
- },
765
- "indexes": {},
766
- "foreignKeys": {
767
- "organization_extension_organization_id_organization_id_fk": {
768
- "name": "organization_extension_organization_id_organization_id_fk",
769
- "tableFrom": "organization_extension",
770
- "tableTo": "organization",
771
- "columnsFrom": ["organization_id"],
772
- "columnsTo": ["id"],
773
- "onDelete": "cascade",
774
- "onUpdate": "no action"
775
- }
776
- },
777
- "compositePrimaryKeys": {},
778
- "uniqueConstraints": {},
779
- "policies": {},
780
- "checkConstraints": {},
781
- "isRLSEnabled": false
782
- },
783
- "public.account": {
784
- "name": "account",
785
- "schema": "",
786
- "columns": {
787
- "id": {
788
- "name": "id",
789
- "type": "text",
790
- "primaryKey": true,
791
- "notNull": true
792
- },
793
- "account_id": {
794
- "name": "account_id",
795
- "type": "text",
796
- "primaryKey": false,
797
- "notNull": true
798
- },
799
- "provider_id": {
800
- "name": "provider_id",
801
- "type": "text",
802
- "primaryKey": false,
803
- "notNull": true
804
- },
805
- "user_id": {
806
- "name": "user_id",
807
- "type": "text",
808
- "primaryKey": false,
809
- "notNull": true
810
- },
811
- "access_token": {
812
- "name": "access_token",
813
- "type": "text",
814
- "primaryKey": false,
815
- "notNull": false
816
- },
817
- "refresh_token": {
818
- "name": "refresh_token",
819
- "type": "text",
820
- "primaryKey": false,
821
- "notNull": false
822
- },
823
- "id_token": {
824
- "name": "id_token",
825
- "type": "text",
826
- "primaryKey": false,
827
- "notNull": false
828
- },
829
- "access_token_expires_at": {
830
- "name": "access_token_expires_at",
831
- "type": "timestamp",
832
- "primaryKey": false,
833
- "notNull": false
834
- },
835
- "refresh_token_expires_at": {
836
- "name": "refresh_token_expires_at",
837
- "type": "timestamp",
838
- "primaryKey": false,
839
- "notNull": false
840
- },
841
- "scope": {
842
- "name": "scope",
843
- "type": "text",
844
- "primaryKey": false,
845
- "notNull": false
846
- },
847
- "password": {
848
- "name": "password",
849
- "type": "text",
850
- "primaryKey": false,
851
- "notNull": false
852
- },
853
- "created_at": {
854
- "name": "created_at",
855
- "type": "timestamp",
856
- "primaryKey": false,
857
- "notNull": true
858
- },
859
- "updated_at": {
860
- "name": "updated_at",
861
- "type": "timestamp",
862
- "primaryKey": false,
863
- "notNull": true
864
- }
865
- },
866
- "indexes": {},
867
- "foreignKeys": {
868
- "account_user_id_user_id_fk": {
869
- "name": "account_user_id_user_id_fk",
870
- "tableFrom": "account",
871
- "tableTo": "user",
872
- "columnsFrom": ["user_id"],
873
- "columnsTo": ["id"],
874
- "onDelete": "cascade",
875
- "onUpdate": "no action"
876
- }
877
- },
878
- "compositePrimaryKeys": {},
879
- "uniqueConstraints": {},
880
- "policies": {},
881
- "checkConstraints": {},
882
- "isRLSEnabled": false
883
- },
884
- "public.invitation": {
885
- "name": "invitation",
886
- "schema": "",
887
- "columns": {
888
- "id": {
889
- "name": "id",
890
- "type": "text",
891
- "primaryKey": true,
892
- "notNull": true
893
- },
894
- "organization_id": {
895
- "name": "organization_id",
896
- "type": "text",
897
- "primaryKey": false,
898
- "notNull": true
899
- },
900
- "email": {
901
- "name": "email",
902
- "type": "text",
903
- "primaryKey": false,
904
- "notNull": true
905
- },
906
- "role": {
907
- "name": "role",
908
- "type": "text",
909
- "primaryKey": false,
910
- "notNull": false
911
- },
912
- "status": {
913
- "name": "status",
914
- "type": "text",
915
- "primaryKey": false,
916
- "notNull": true
917
- },
918
- "expires_at": {
919
- "name": "expires_at",
920
- "type": "timestamp",
921
- "primaryKey": false,
922
- "notNull": true
923
- },
924
- "inviter_id": {
925
- "name": "inviter_id",
926
- "type": "text",
927
- "primaryKey": false,
928
- "notNull": true
929
- }
930
- },
931
- "indexes": {},
932
- "foreignKeys": {
933
- "invitation_organization_id_organization_id_fk": {
934
- "name": "invitation_organization_id_organization_id_fk",
935
- "tableFrom": "invitation",
936
- "tableTo": "organization",
937
- "columnsFrom": ["organization_id"],
938
- "columnsTo": ["id"],
939
- "onDelete": "cascade",
940
- "onUpdate": "no action"
941
- },
942
- "invitation_inviter_id_user_id_fk": {
943
- "name": "invitation_inviter_id_user_id_fk",
944
- "tableFrom": "invitation",
945
- "tableTo": "user",
946
- "columnsFrom": ["inviter_id"],
947
- "columnsTo": ["id"],
948
- "onDelete": "cascade",
949
- "onUpdate": "no action"
950
- }
951
- },
952
- "compositePrimaryKeys": {},
953
- "uniqueConstraints": {},
954
- "policies": {},
955
- "checkConstraints": {},
956
- "isRLSEnabled": false
957
- },
958
- "public.member": {
959
- "name": "member",
960
- "schema": "",
961
- "columns": {
962
- "id": {
963
- "name": "id",
964
- "type": "text",
965
- "primaryKey": true,
966
- "notNull": true
967
- },
968
- "organization_id": {
969
- "name": "organization_id",
970
- "type": "text",
971
- "primaryKey": false,
972
- "notNull": true
973
- },
974
- "user_id": {
975
- "name": "user_id",
976
- "type": "text",
977
- "primaryKey": false,
978
- "notNull": true
979
- },
980
- "role": {
981
- "name": "role",
982
- "type": "text",
983
- "primaryKey": false,
984
- "notNull": true
985
- },
986
- "created_at": {
987
- "name": "created_at",
988
- "type": "timestamp",
989
- "primaryKey": false,
990
- "notNull": true
991
- }
992
- },
993
- "indexes": {},
994
- "foreignKeys": {
995
- "member_organization_id_organization_id_fk": {
996
- "name": "member_organization_id_organization_id_fk",
997
- "tableFrom": "member",
998
- "tableTo": "organization",
999
- "columnsFrom": ["organization_id"],
1000
- "columnsTo": ["id"],
1001
- "onDelete": "cascade",
1002
- "onUpdate": "no action"
1003
- },
1004
- "member_user_id_user_id_fk": {
1005
- "name": "member_user_id_user_id_fk",
1006
- "tableFrom": "member",
1007
- "tableTo": "user",
1008
- "columnsFrom": ["user_id"],
1009
- "columnsTo": ["id"],
1010
- "onDelete": "cascade",
1011
- "onUpdate": "no action"
1012
- }
1013
- },
1014
- "compositePrimaryKeys": {},
1015
- "uniqueConstraints": {},
1016
- "policies": {},
1017
- "checkConstraints": {},
1018
- "isRLSEnabled": false
1019
- },
1020
- "public.organization": {
1021
- "name": "organization",
1022
- "schema": "",
1023
- "columns": {
1024
- "id": {
1025
- "name": "id",
1026
- "type": "text",
1027
- "primaryKey": true,
1028
- "notNull": true
1029
- },
1030
- "name": {
1031
- "name": "name",
1032
- "type": "text",
1033
- "primaryKey": false,
1034
- "notNull": true
1035
- },
1036
- "slug": {
1037
- "name": "slug",
1038
- "type": "text",
1039
- "primaryKey": false,
1040
- "notNull": false
1041
- },
1042
- "logo": {
1043
- "name": "logo",
1044
- "type": "text",
1045
- "primaryKey": false,
1046
- "notNull": false
1047
- },
1048
- "metadata": {
1049
- "name": "metadata",
1050
- "type": "text",
1051
- "primaryKey": false,
1052
- "notNull": false
1053
- },
1054
- "created_at": {
1055
- "name": "created_at",
1056
- "type": "timestamp",
1057
- "primaryKey": false,
1058
- "notNull": true
1059
- }
1060
- },
1061
- "indexes": {},
1062
- "foreignKeys": {},
1063
- "compositePrimaryKeys": {},
1064
- "uniqueConstraints": {
1065
- "organization_slug_unique": {
1066
- "name": "organization_slug_unique",
1067
- "nullsNotDistinct": false,
1068
- "columns": ["slug"]
1069
- }
1070
- },
1071
- "policies": {},
1072
- "checkConstraints": {},
1073
- "isRLSEnabled": false
1074
- },
1075
- "public.passkey": {
1076
- "name": "passkey",
1077
- "schema": "",
1078
- "columns": {
1079
- "id": {
1080
- "name": "id",
1081
- "type": "text",
1082
- "primaryKey": true,
1083
- "notNull": true
1084
- },
1085
- "name": {
1086
- "name": "name",
1087
- "type": "text",
1088
- "primaryKey": false,
1089
- "notNull": false
1090
- },
1091
- "public_key": {
1092
- "name": "public_key",
1093
- "type": "text",
1094
- "primaryKey": false,
1095
- "notNull": true
1096
- },
1097
- "user_id": {
1098
- "name": "user_id",
1099
- "type": "text",
1100
- "primaryKey": false,
1101
- "notNull": true
1102
- },
1103
- "credential_id": {
1104
- "name": "credential_id",
1105
- "type": "text",
1106
- "primaryKey": false,
1107
- "notNull": true
1108
- },
1109
- "counter": {
1110
- "name": "counter",
1111
- "type": "integer",
1112
- "primaryKey": false,
1113
- "notNull": true
1114
- },
1115
- "device_type": {
1116
- "name": "device_type",
1117
- "type": "text",
1118
- "primaryKey": false,
1119
- "notNull": true
1120
- },
1121
- "backed_up": {
1122
- "name": "backed_up",
1123
- "type": "boolean",
1124
- "primaryKey": false,
1125
- "notNull": true
1126
- },
1127
- "transports": {
1128
- "name": "transports",
1129
- "type": "text",
1130
- "primaryKey": false,
1131
- "notNull": false
1132
- },
1133
- "created_at": {
1134
- "name": "created_at",
1135
- "type": "timestamp",
1136
- "primaryKey": false,
1137
- "notNull": true
1138
- },
1139
- "aaguid": {
1140
- "name": "aaguid",
1141
- "type": "text",
1142
- "primaryKey": false,
1143
- "notNull": false
1144
- }
1145
- },
1146
- "indexes": {},
1147
- "foreignKeys": {
1148
- "passkey_user_id_user_id_fk": {
1149
- "name": "passkey_user_id_user_id_fk",
1150
- "tableFrom": "passkey",
1151
- "tableTo": "user",
1152
- "columnsFrom": ["user_id"],
1153
- "columnsTo": ["id"],
1154
- "onDelete": "cascade",
1155
- "onUpdate": "no action"
1156
- }
1157
- },
1158
- "compositePrimaryKeys": {},
1159
- "uniqueConstraints": {},
1160
- "policies": {},
1161
- "checkConstraints": {},
1162
- "isRLSEnabled": false
1163
- },
1164
- "public.session": {
1165
- "name": "session",
1166
- "schema": "",
1167
- "columns": {
1168
- "id": {
1169
- "name": "id",
1170
- "type": "text",
1171
- "primaryKey": true,
1172
- "notNull": true
1173
- },
1174
- "expires_at": {
1175
- "name": "expires_at",
1176
- "type": "timestamp",
1177
- "primaryKey": false,
1178
- "notNull": true
1179
- },
1180
- "token": {
1181
- "name": "token",
1182
- "type": "text",
1183
- "primaryKey": false,
1184
- "notNull": true
1185
- },
1186
- "created_at": {
1187
- "name": "created_at",
1188
- "type": "timestamp",
1189
- "primaryKey": false,
1190
- "notNull": true
1191
- },
1192
- "updated_at": {
1193
- "name": "updated_at",
1194
- "type": "timestamp",
1195
- "primaryKey": false,
1196
- "notNull": true
1197
- },
1198
- "ip_address": {
1199
- "name": "ip_address",
1200
- "type": "text",
1201
- "primaryKey": false,
1202
- "notNull": false
1203
- },
1204
- "user_agent": {
1205
- "name": "user_agent",
1206
- "type": "text",
1207
- "primaryKey": false,
1208
- "notNull": false
1209
- },
1210
- "user_id": {
1211
- "name": "user_id",
1212
- "type": "text",
1213
- "primaryKey": false,
1214
- "notNull": true
1215
- },
1216
- "active_organization_id": {
1217
- "name": "active_organization_id",
1218
- "type": "text",
1219
- "primaryKey": false,
1220
- "notNull": false
1221
- }
1222
- },
1223
- "indexes": {},
1224
- "foreignKeys": {
1225
- "session_user_id_user_id_fk": {
1226
- "name": "session_user_id_user_id_fk",
1227
- "tableFrom": "session",
1228
- "tableTo": "user",
1229
- "columnsFrom": ["user_id"],
1230
- "columnsTo": ["id"],
1231
- "onDelete": "cascade",
1232
- "onUpdate": "no action"
1233
- }
1234
- },
1235
- "compositePrimaryKeys": {},
1236
- "uniqueConstraints": {
1237
- "session_token_unique": {
1238
- "name": "session_token_unique",
1239
- "nullsNotDistinct": false,
1240
- "columns": ["token"]
1241
- }
1242
- },
1243
- "policies": {},
1244
- "checkConstraints": {},
1245
- "isRLSEnabled": false
1246
- },
1247
- "public.statement": {
1248
- "name": "statement",
1249
- "schema": "",
1250
- "columns": {
1251
- "id": {
1252
- "name": "id",
1253
- "type": "text",
1254
- "primaryKey": true,
1255
- "notNull": true
1256
- },
1257
- "user_id": {
1258
- "name": "user_id",
1259
- "type": "text",
1260
- "primaryKey": false,
1261
- "notNull": false
1262
- },
1263
- "organization_id": {
1264
- "name": "organization_id",
1265
- "type": "text",
1266
- "primaryKey": false,
1267
- "notNull": false
1268
- },
1269
- "role_id": {
1270
- "name": "role_id",
1271
- "type": "text",
1272
- "primaryKey": false,
1273
- "notNull": false
1274
- },
1275
- "effect": {
1276
- "name": "effect",
1277
- "type": "text",
1278
- "primaryKey": false,
1279
- "notNull": true
1280
- },
1281
- "action": {
1282
- "name": "action",
1283
- "type": "text",
1284
- "primaryKey": false,
1285
- "notNull": true
1286
- },
1287
- "resource": {
1288
- "name": "resource",
1289
- "type": "text",
1290
- "primaryKey": false,
1291
- "notNull": true
1292
- },
1293
- "condition": {
1294
- "name": "condition",
1295
- "type": "text",
1296
- "primaryKey": false,
1297
- "notNull": false
1298
- },
1299
- "expires_at": {
1300
- "name": "expires_at",
1301
- "type": "timestamp",
1302
- "primaryKey": false,
1303
- "notNull": false
1304
- },
1305
- "created_at": {
1306
- "name": "created_at",
1307
- "type": "timestamp",
1308
- "primaryKey": false,
1309
- "notNull": true
1310
- },
1311
- "updated_at": {
1312
- "name": "updated_at",
1313
- "type": "timestamp",
1314
- "primaryKey": false,
1315
- "notNull": true
1316
- }
1317
- },
1318
- "indexes": {},
1319
- "foreignKeys": {
1320
- "statement_user_id_user_id_fk": {
1321
- "name": "statement_user_id_user_id_fk",
1322
- "tableFrom": "statement",
1323
- "tableTo": "user",
1324
- "columnsFrom": ["user_id"],
1325
- "columnsTo": ["id"],
1326
- "onDelete": "cascade",
1327
- "onUpdate": "no action"
1328
- },
1329
- "statement_organization_id_organization_id_fk": {
1330
- "name": "statement_organization_id_organization_id_fk",
1331
- "tableFrom": "statement",
1332
- "tableTo": "organization",
1333
- "columnsFrom": ["organization_id"],
1334
- "columnsTo": ["id"],
1335
- "onDelete": "cascade",
1336
- "onUpdate": "no action"
1337
- }
1338
- },
1339
- "compositePrimaryKeys": {},
1340
- "uniqueConstraints": {},
1341
- "policies": {},
1342
- "checkConstraints": {},
1343
- "isRLSEnabled": false
1344
- },
1345
- "public.subscription": {
1346
- "name": "subscription",
1347
- "schema": "",
1348
- "columns": {
1349
- "id": {
1350
- "name": "id",
1351
- "type": "text",
1352
- "primaryKey": true,
1353
- "notNull": true
1354
- },
1355
- "plan": {
1356
- "name": "plan",
1357
- "type": "text",
1358
- "primaryKey": false,
1359
- "notNull": true
1360
- },
1361
- "reference_id": {
1362
- "name": "reference_id",
1363
- "type": "text",
1364
- "primaryKey": false,
1365
- "notNull": true
1366
- },
1367
- "stripe_customer_id": {
1368
- "name": "stripe_customer_id",
1369
- "type": "text",
1370
- "primaryKey": false,
1371
- "notNull": false
1372
- },
1373
- "stripe_subscription_id": {
1374
- "name": "stripe_subscription_id",
1375
- "type": "text",
1376
- "primaryKey": false,
1377
- "notNull": false
1378
- },
1379
- "status": {
1380
- "name": "status",
1381
- "type": "text",
1382
- "primaryKey": false,
1383
- "notNull": true
1384
- },
1385
- "period_start": {
1386
- "name": "period_start",
1387
- "type": "timestamp",
1388
- "primaryKey": false,
1389
- "notNull": false
1390
- },
1391
- "period_end": {
1392
- "name": "period_end",
1393
- "type": "timestamp",
1394
- "primaryKey": false,
1395
- "notNull": false
1396
- },
1397
- "cancel_at_period_end": {
1398
- "name": "cancel_at_period_end",
1399
- "type": "boolean",
1400
- "primaryKey": false,
1401
- "notNull": false
1402
- },
1403
- "seats": {
1404
- "name": "seats",
1405
- "type": "integer",
1406
- "primaryKey": false,
1407
- "notNull": false
1408
- },
1409
- "trial_start": {
1410
- "name": "trial_start",
1411
- "type": "timestamp",
1412
- "primaryKey": false,
1413
- "notNull": false
1414
- },
1415
- "trial_end": {
1416
- "name": "trial_end",
1417
- "type": "timestamp",
1418
- "primaryKey": false,
1419
- "notNull": false
1420
- },
1421
- "created_at": {
1422
- "name": "created_at",
1423
- "type": "timestamp",
1424
- "primaryKey": false,
1425
- "notNull": true,
1426
- "default": "now()"
1427
- },
1428
- "updated_at": {
1429
- "name": "updated_at",
1430
- "type": "timestamp",
1431
- "primaryKey": false,
1432
- "notNull": true,
1433
- "default": "now()"
1434
- }
1435
- },
1436
- "indexes": {},
1437
- "foreignKeys": {},
1438
- "compositePrimaryKeys": {},
1439
- "uniqueConstraints": {},
1440
- "policies": {},
1441
- "checkConstraints": {},
1442
- "isRLSEnabled": false
1443
- },
1444
- "public.two_factor": {
1445
- "name": "two_factor",
1446
- "schema": "",
1447
- "columns": {
1448
- "id": {
1449
- "name": "id",
1450
- "type": "text",
1451
- "primaryKey": true,
1452
- "notNull": true
1453
- },
1454
- "secret": {
1455
- "name": "secret",
1456
- "type": "text",
1457
- "primaryKey": false,
1458
- "notNull": true
1459
- },
1460
- "backup_codes": {
1461
- "name": "backup_codes",
1462
- "type": "text",
1463
- "primaryKey": false,
1464
- "notNull": true
1465
- },
1466
- "user_id": {
1467
- "name": "user_id",
1468
- "type": "text",
1469
- "primaryKey": false,
1470
- "notNull": true
1471
- }
1472
- },
1473
- "indexes": {},
1474
- "foreignKeys": {
1475
- "two_factor_user_id_user_id_fk": {
1476
- "name": "two_factor_user_id_user_id_fk",
1477
- "tableFrom": "two_factor",
1478
- "tableTo": "user",
1479
- "columnsFrom": ["user_id"],
1480
- "columnsTo": ["id"],
1481
- "onDelete": "cascade",
1482
- "onUpdate": "no action"
1483
- }
1484
- },
1485
- "compositePrimaryKeys": {},
1486
- "uniqueConstraints": {},
1487
- "policies": {},
1488
- "checkConstraints": {},
1489
- "isRLSEnabled": false
1490
- },
1491
- "public.user": {
1492
- "name": "user",
1493
- "schema": "",
1494
- "columns": {
1495
- "id": {
1496
- "name": "id",
1497
- "type": "text",
1498
- "primaryKey": true,
1499
- "notNull": true
1500
- },
1501
- "name": {
1502
- "name": "name",
1503
- "type": "text",
1504
- "primaryKey": false,
1505
- "notNull": true
1506
- },
1507
- "email": {
1508
- "name": "email",
1509
- "type": "text",
1510
- "primaryKey": false,
1511
- "notNull": true
1512
- },
1513
- "email_verified": {
1514
- "name": "email_verified",
1515
- "type": "boolean",
1516
- "primaryKey": false,
1517
- "notNull": true
1518
- },
1519
- "image": {
1520
- "name": "image",
1521
- "type": "text",
1522
- "primaryKey": false,
1523
- "notNull": false
1524
- },
1525
- "created_at": {
1526
- "name": "created_at",
1527
- "type": "timestamp",
1528
- "primaryKey": false,
1529
- "notNull": true
1530
- },
1531
- "updated_at": {
1532
- "name": "updated_at",
1533
- "type": "timestamp",
1534
- "primaryKey": false,
1535
- "notNull": true
1536
- },
1537
- "two_factor_enabled": {
1538
- "name": "two_factor_enabled",
1539
- "type": "boolean",
1540
- "primaryKey": false,
1541
- "notNull": false
1542
- },
1543
- "last_login_method": {
1544
- "name": "last_login_method",
1545
- "type": "text",
1546
- "primaryKey": false,
1547
- "notNull": false
1548
- },
1549
- "stripe_customer_id": {
1550
- "name": "stripe_customer_id",
1551
- "type": "text",
1552
- "primaryKey": false,
1553
- "notNull": false
1554
- }
1555
- },
1556
- "indexes": {},
1557
- "foreignKeys": {},
1558
- "compositePrimaryKeys": {},
1559
- "uniqueConstraints": {
1560
- "user_email_unique": {
1561
- "name": "user_email_unique",
1562
- "nullsNotDistinct": false,
1563
- "columns": ["email"]
1564
- }
1565
- },
1566
- "policies": {},
1567
- "checkConstraints": {},
1568
- "isRLSEnabled": false
1569
- },
1570
- "public.verification": {
1571
- "name": "verification",
1572
- "schema": "",
1573
- "columns": {
1574
- "id": {
1575
- "name": "id",
1576
- "type": "text",
1577
- "primaryKey": true,
1578
- "notNull": true
1579
- },
1580
- "identifier": {
1581
- "name": "identifier",
1582
- "type": "text",
1583
- "primaryKey": false,
1584
- "notNull": true
1585
- },
1586
- "value": {
1587
- "name": "value",
1588
- "type": "text",
1589
- "primaryKey": false,
1590
- "notNull": true
1591
- },
1592
- "expires_at": {
1593
- "name": "expires_at",
1594
- "type": "timestamp",
1595
- "primaryKey": false,
1596
- "notNull": true
1597
- },
1598
- "created_at": {
1599
- "name": "created_at",
1600
- "type": "timestamp",
1601
- "primaryKey": false,
1602
- "notNull": false
1603
- },
1604
- "updated_at": {
1605
- "name": "updated_at",
1606
- "type": "timestamp",
1607
- "primaryKey": false,
1608
- "notNull": false
1609
- }
1610
- },
1611
- "indexes": {},
1612
- "foreignKeys": {},
1613
- "compositePrimaryKeys": {},
1614
- "uniqueConstraints": {},
1615
- "policies": {},
1616
- "checkConstraints": {},
1617
- "isRLSEnabled": false
1618
- },
1619
- "public.contact": {
1620
- "name": "contact",
1621
- "schema": "",
1622
- "columns": {
1623
- "id": {
1624
- "name": "id",
1625
- "type": "text",
1626
- "primaryKey": true,
1627
- "notNull": true
1628
- },
1629
- "organization_id": {
1630
- "name": "organization_id",
1631
- "type": "text",
1632
- "primaryKey": false,
1633
- "notNull": true
1634
- },
1635
- "email": {
1636
- "name": "email",
1637
- "type": "text",
1638
- "primaryKey": false,
1639
- "notNull": true
1640
- },
1641
- "email_hash": {
1642
- "name": "email_hash",
1643
- "type": "text",
1644
- "primaryKey": false,
1645
- "notNull": true
1646
- },
1647
- "status": {
1648
- "name": "status",
1649
- "type": "text",
1650
- "primaryKey": false,
1651
- "notNull": true,
1652
- "default": "'active'"
1653
- },
1654
- "properties": {
1655
- "name": "properties",
1656
- "type": "json",
1657
- "primaryKey": false,
1658
- "notNull": true,
1659
- "default": "'{}'::json"
1660
- },
1661
- "last_activity_at": {
1662
- "name": "last_activity_at",
1663
- "type": "timestamp",
1664
- "primaryKey": false,
1665
- "notNull": false
1666
- },
1667
- "last_email_sent_at": {
1668
- "name": "last_email_sent_at",
1669
- "type": "timestamp",
1670
- "primaryKey": false,
1671
- "notNull": false
1672
- },
1673
- "last_email_opened_at": {
1674
- "name": "last_email_opened_at",
1675
- "type": "timestamp",
1676
- "primaryKey": false,
1677
- "notNull": false
1678
- },
1679
- "last_email_clicked_at": {
1680
- "name": "last_email_clicked_at",
1681
- "type": "timestamp",
1682
- "primaryKey": false,
1683
- "notNull": false
1684
- },
1685
- "emails_sent": {
1686
- "name": "emails_sent",
1687
- "type": "integer",
1688
- "primaryKey": false,
1689
- "notNull": true,
1690
- "default": 0
1691
- },
1692
- "emails_opened": {
1693
- "name": "emails_opened",
1694
- "type": "integer",
1695
- "primaryKey": false,
1696
- "notNull": true,
1697
- "default": 0
1698
- },
1699
- "emails_clicked": {
1700
- "name": "emails_clicked",
1701
- "type": "integer",
1702
- "primaryKey": false,
1703
- "notNull": true,
1704
- "default": 0
1705
- },
1706
- "created_at": {
1707
- "name": "created_at",
1708
- "type": "timestamp",
1709
- "primaryKey": false,
1710
- "notNull": true,
1711
- "default": "now()"
1712
- },
1713
- "updated_at": {
1714
- "name": "updated_at",
1715
- "type": "timestamp",
1716
- "primaryKey": false,
1717
- "notNull": true,
1718
- "default": "now()"
1719
- },
1720
- "confirmed_at": {
1721
- "name": "confirmed_at",
1722
- "type": "timestamp",
1723
- "primaryKey": false,
1724
- "notNull": false
1725
- },
1726
- "unsubscribed_at": {
1727
- "name": "unsubscribed_at",
1728
- "type": "timestamp",
1729
- "primaryKey": false,
1730
- "notNull": false
1731
- },
1732
- "bounced_at": {
1733
- "name": "bounced_at",
1734
- "type": "timestamp",
1735
- "primaryKey": false,
1736
- "notNull": false
1737
- },
1738
- "complained_at": {
1739
- "name": "complained_at",
1740
- "type": "timestamp",
1741
- "primaryKey": false,
1742
- "notNull": false
1743
- },
1744
- "created_by": {
1745
- "name": "created_by",
1746
- "type": "text",
1747
- "primaryKey": false,
1748
- "notNull": false
1749
- }
1750
- },
1751
- "indexes": {
1752
- "contact_org_idx": {
1753
- "name": "contact_org_idx",
1754
- "columns": [
1755
- {
1756
- "expression": "organization_id",
1757
- "isExpression": false,
1758
- "asc": true,
1759
- "nulls": "last"
1760
- }
1761
- ],
1762
- "isUnique": false,
1763
- "concurrently": false,
1764
- "method": "btree",
1765
- "with": {}
1766
- },
1767
- "contact_email_idx": {
1768
- "name": "contact_email_idx",
1769
- "columns": [
1770
- {
1771
- "expression": "email",
1772
- "isExpression": false,
1773
- "asc": true,
1774
- "nulls": "last"
1775
- }
1776
- ],
1777
- "isUnique": false,
1778
- "concurrently": false,
1779
- "method": "btree",
1780
- "with": {}
1781
- },
1782
- "contact_unique_org_email_idx": {
1783
- "name": "contact_unique_org_email_idx",
1784
- "columns": [
1785
- {
1786
- "expression": "organization_id",
1787
- "isExpression": false,
1788
- "asc": true,
1789
- "nulls": "last"
1790
- },
1791
- {
1792
- "expression": "email_hash",
1793
- "isExpression": false,
1794
- "asc": true,
1795
- "nulls": "last"
1796
- }
1797
- ],
1798
- "isUnique": true,
1799
- "concurrently": false,
1800
- "method": "btree",
1801
- "with": {}
1802
- },
1803
- "contact_status_idx": {
1804
- "name": "contact_status_idx",
1805
- "columns": [
1806
- {
1807
- "expression": "organization_id",
1808
- "isExpression": false,
1809
- "asc": true,
1810
- "nulls": "last"
1811
- },
1812
- {
1813
- "expression": "status",
1814
- "isExpression": false,
1815
- "asc": true,
1816
- "nulls": "last"
1817
- }
1818
- ],
1819
- "isUnique": false,
1820
- "concurrently": false,
1821
- "method": "btree",
1822
- "with": {}
1823
- }
1824
- },
1825
- "foreignKeys": {
1826
- "contact_organization_id_organization_id_fk": {
1827
- "name": "contact_organization_id_organization_id_fk",
1828
- "tableFrom": "contact",
1829
- "tableTo": "organization",
1830
- "columnsFrom": ["organization_id"],
1831
- "columnsTo": ["id"],
1832
- "onDelete": "cascade",
1833
- "onUpdate": "no action"
1834
- },
1835
- "contact_created_by_user_id_fk": {
1836
- "name": "contact_created_by_user_id_fk",
1837
- "tableFrom": "contact",
1838
- "tableTo": "user",
1839
- "columnsFrom": ["created_by"],
1840
- "columnsTo": ["id"],
1841
- "onDelete": "no action",
1842
- "onUpdate": "no action"
1843
- }
1844
- },
1845
- "compositePrimaryKeys": {},
1846
- "uniqueConstraints": {},
1847
- "policies": {},
1848
- "checkConstraints": {},
1849
- "isRLSEnabled": false
1850
- },
1851
- "public.contact_topic": {
1852
- "name": "contact_topic",
1853
- "schema": "",
1854
- "columns": {
1855
- "contact_id": {
1856
- "name": "contact_id",
1857
- "type": "text",
1858
- "primaryKey": false,
1859
- "notNull": true
1860
- },
1861
- "topic_id": {
1862
- "name": "topic_id",
1863
- "type": "text",
1864
- "primaryKey": false,
1865
- "notNull": true
1866
- },
1867
- "status": {
1868
- "name": "status",
1869
- "type": "text",
1870
- "primaryKey": false,
1871
- "notNull": true,
1872
- "default": "'subscribed'"
1873
- },
1874
- "subscribed_at": {
1875
- "name": "subscribed_at",
1876
- "type": "timestamp",
1877
- "primaryKey": false,
1878
- "notNull": false,
1879
- "default": "now()"
1880
- },
1881
- "unsubscribed_at": {
1882
- "name": "unsubscribed_at",
1883
- "type": "timestamp",
1884
- "primaryKey": false,
1885
- "notNull": false
1886
- }
1887
- },
1888
- "indexes": {
1889
- "contact_topic_topic_idx": {
1890
- "name": "contact_topic_topic_idx",
1891
- "columns": [
1892
- {
1893
- "expression": "topic_id",
1894
- "isExpression": false,
1895
- "asc": true,
1896
- "nulls": "last"
1897
- }
1898
- ],
1899
- "isUnique": false,
1900
- "concurrently": false,
1901
- "method": "btree",
1902
- "with": {}
1903
- },
1904
- "contact_topic_status_idx": {
1905
- "name": "contact_topic_status_idx",
1906
- "columns": [
1907
- {
1908
- "expression": "topic_id",
1909
- "isExpression": false,
1910
- "asc": true,
1911
- "nulls": "last"
1912
- },
1913
- {
1914
- "expression": "status",
1915
- "isExpression": false,
1916
- "asc": true,
1917
- "nulls": "last"
1918
- }
1919
- ],
1920
- "isUnique": false,
1921
- "concurrently": false,
1922
- "method": "btree",
1923
- "with": {}
1924
- }
1925
- },
1926
- "foreignKeys": {
1927
- "contact_topic_contact_id_contact_id_fk": {
1928
- "name": "contact_topic_contact_id_contact_id_fk",
1929
- "tableFrom": "contact_topic",
1930
- "tableTo": "contact",
1931
- "columnsFrom": ["contact_id"],
1932
- "columnsTo": ["id"],
1933
- "onDelete": "cascade",
1934
- "onUpdate": "no action"
1935
- },
1936
- "contact_topic_topic_id_topic_id_fk": {
1937
- "name": "contact_topic_topic_id_topic_id_fk",
1938
- "tableFrom": "contact_topic",
1939
- "tableTo": "topic",
1940
- "columnsFrom": ["topic_id"],
1941
- "columnsTo": ["id"],
1942
- "onDelete": "cascade",
1943
- "onUpdate": "no action"
1944
- }
1945
- },
1946
- "compositePrimaryKeys": {
1947
- "contact_topic_contact_id_topic_id_pk": {
1948
- "name": "contact_topic_contact_id_topic_id_pk",
1949
- "columns": ["contact_id", "topic_id"]
1950
- }
1951
- },
1952
- "uniqueConstraints": {},
1953
- "policies": {},
1954
- "checkConstraints": {},
1955
- "isRLSEnabled": false
1956
- },
1957
- "public.topic": {
1958
- "name": "topic",
1959
- "schema": "",
1960
- "columns": {
1961
- "id": {
1962
- "name": "id",
1963
- "type": "text",
1964
- "primaryKey": true,
1965
- "notNull": true
1966
- },
1967
- "organization_id": {
1968
- "name": "organization_id",
1969
- "type": "text",
1970
- "primaryKey": false,
1971
- "notNull": true
1972
- },
1973
- "name": {
1974
- "name": "name",
1975
- "type": "text",
1976
- "primaryKey": false,
1977
- "notNull": true
1978
- },
1979
- "slug": {
1980
- "name": "slug",
1981
- "type": "text",
1982
- "primaryKey": false,
1983
- "notNull": true
1984
- },
1985
- "description": {
1986
- "name": "description",
1987
- "type": "text",
1988
- "primaryKey": false,
1989
- "notNull": false
1990
- },
1991
- "public": {
1992
- "name": "public",
1993
- "type": "boolean",
1994
- "primaryKey": false,
1995
- "notNull": true,
1996
- "default": true
1997
- },
1998
- "double_opt_in": {
1999
- "name": "double_opt_in",
2000
- "type": "boolean",
2001
- "primaryKey": false,
2002
- "notNull": true,
2003
- "default": false
2004
- },
2005
- "subscriber_count": {
2006
- "name": "subscriber_count",
2007
- "type": "integer",
2008
- "primaryKey": false,
2009
- "notNull": true,
2010
- "default": 0
2011
- },
2012
- "created_at": {
2013
- "name": "created_at",
2014
- "type": "timestamp",
2015
- "primaryKey": false,
2016
- "notNull": true,
2017
- "default": "now()"
2018
- },
2019
- "updated_at": {
2020
- "name": "updated_at",
2021
- "type": "timestamp",
2022
- "primaryKey": false,
2023
- "notNull": true,
2024
- "default": "now()"
2025
- },
2026
- "created_by": {
2027
- "name": "created_by",
2028
- "type": "text",
2029
- "primaryKey": false,
2030
- "notNull": false
2031
- }
2032
- },
2033
- "indexes": {
2034
- "topic_org_idx": {
2035
- "name": "topic_org_idx",
2036
- "columns": [
2037
- {
2038
- "expression": "organization_id",
2039
- "isExpression": false,
2040
- "asc": true,
2041
- "nulls": "last"
2042
- }
2043
- ],
2044
- "isUnique": false,
2045
- "concurrently": false,
2046
- "method": "btree",
2047
- "with": {}
2048
- },
2049
- "topic_unique_org_slug_idx": {
2050
- "name": "topic_unique_org_slug_idx",
2051
- "columns": [
2052
- {
2053
- "expression": "organization_id",
2054
- "isExpression": false,
2055
- "asc": true,
2056
- "nulls": "last"
2057
- },
2058
- {
2059
- "expression": "slug",
2060
- "isExpression": false,
2061
- "asc": true,
2062
- "nulls": "last"
2063
- }
2064
- ],
2065
- "isUnique": true,
2066
- "concurrently": false,
2067
- "method": "btree",
2068
- "with": {}
2069
- }
2070
- },
2071
- "foreignKeys": {
2072
- "topic_organization_id_organization_id_fk": {
2073
- "name": "topic_organization_id_organization_id_fk",
2074
- "tableFrom": "topic",
2075
- "tableTo": "organization",
2076
- "columnsFrom": ["organization_id"],
2077
- "columnsTo": ["id"],
2078
- "onDelete": "cascade",
2079
- "onUpdate": "no action"
2080
- },
2081
- "topic_created_by_user_id_fk": {
2082
- "name": "topic_created_by_user_id_fk",
2083
- "tableFrom": "topic",
2084
- "tableTo": "user",
2085
- "columnsFrom": ["created_by"],
2086
- "columnsTo": ["id"],
2087
- "onDelete": "no action",
2088
- "onUpdate": "no action"
2089
- }
2090
- },
2091
- "compositePrimaryKeys": {},
2092
- "uniqueConstraints": {},
2093
- "policies": {},
2094
- "checkConstraints": {},
2095
- "isRLSEnabled": false
2096
- },
2097
- "public.segment": {
2098
- "name": "segment",
2099
- "schema": "",
2100
- "columns": {
2101
- "id": {
2102
- "name": "id",
2103
- "type": "text",
2104
- "primaryKey": true,
2105
- "notNull": true
2106
- },
2107
- "organization_id": {
2108
- "name": "organization_id",
2109
- "type": "text",
2110
- "primaryKey": false,
2111
- "notNull": true
2112
- },
2113
- "name": {
2114
- "name": "name",
2115
- "type": "text",
2116
- "primaryKey": false,
2117
- "notNull": true
2118
- },
2119
- "description": {
2120
- "name": "description",
2121
- "type": "text",
2122
- "primaryKey": false,
2123
- "notNull": false
2124
- },
2125
- "condition": {
2126
- "name": "condition",
2127
- "type": "json",
2128
- "primaryKey": false,
2129
- "notNull": true
2130
- },
2131
- "track_membership": {
2132
- "name": "track_membership",
2133
- "type": "boolean",
2134
- "primaryKey": false,
2135
- "notNull": true,
2136
- "default": false
2137
- },
2138
- "member_count": {
2139
- "name": "member_count",
2140
- "type": "integer",
2141
- "primaryKey": false,
2142
- "notNull": true,
2143
- "default": 0
2144
- },
2145
- "last_computed_at": {
2146
- "name": "last_computed_at",
2147
- "type": "timestamp",
2148
- "primaryKey": false,
2149
- "notNull": false
2150
- },
2151
- "created_by": {
2152
- "name": "created_by",
2153
- "type": "text",
2154
- "primaryKey": false,
2155
- "notNull": false
2156
- },
2157
- "created_at": {
2158
- "name": "created_at",
2159
- "type": "timestamp",
2160
- "primaryKey": false,
2161
- "notNull": true,
2162
- "default": "now()"
2163
- },
2164
- "updated_at": {
2165
- "name": "updated_at",
2166
- "type": "timestamp",
2167
- "primaryKey": false,
2168
- "notNull": true,
2169
- "default": "now()"
2170
- }
2171
- },
2172
- "indexes": {
2173
- "segment_org_idx": {
2174
- "name": "segment_org_idx",
2175
- "columns": [
2176
- {
2177
- "expression": "organization_id",
2178
- "isExpression": false,
2179
- "asc": true,
2180
- "nulls": "last"
2181
- }
2182
- ],
2183
- "isUnique": false,
2184
- "concurrently": false,
2185
- "method": "btree",
2186
- "with": {}
2187
- },
2188
- "segment_name_idx": {
2189
- "name": "segment_name_idx",
2190
- "columns": [
2191
- {
2192
- "expression": "organization_id",
2193
- "isExpression": false,
2194
- "asc": true,
2195
- "nulls": "last"
2196
- },
2197
- {
2198
- "expression": "name",
2199
- "isExpression": false,
2200
- "asc": true,
2201
- "nulls": "last"
2202
- }
2203
- ],
2204
- "isUnique": false,
2205
- "concurrently": false,
2206
- "method": "btree",
2207
- "with": {}
2208
- }
2209
- },
2210
- "foreignKeys": {
2211
- "segment_organization_id_organization_id_fk": {
2212
- "name": "segment_organization_id_organization_id_fk",
2213
- "tableFrom": "segment",
2214
- "tableTo": "organization",
2215
- "columnsFrom": ["organization_id"],
2216
- "columnsTo": ["id"],
2217
- "onDelete": "cascade",
2218
- "onUpdate": "no action"
2219
- },
2220
- "segment_created_by_user_id_fk": {
2221
- "name": "segment_created_by_user_id_fk",
2222
- "tableFrom": "segment",
2223
- "tableTo": "user",
2224
- "columnsFrom": ["created_by"],
2225
- "columnsTo": ["id"],
2226
- "onDelete": "no action",
2227
- "onUpdate": "no action"
2228
- }
2229
- },
2230
- "compositePrimaryKeys": {},
2231
- "uniqueConstraints": {},
2232
- "policies": {},
2233
- "checkConstraints": {},
2234
- "isRLSEnabled": false
2235
- },
2236
- "public.ai_conversation": {
2237
- "name": "ai_conversation",
2238
- "schema": "",
2239
- "columns": {
2240
- "id": {
2241
- "name": "id",
2242
- "type": "text",
2243
- "primaryKey": true,
2244
- "notNull": true
2245
- },
2246
- "organization_id": {
2247
- "name": "organization_id",
2248
- "type": "text",
2249
- "primaryKey": false,
2250
- "notNull": true
2251
- },
2252
- "template_id": {
2253
- "name": "template_id",
2254
- "type": "text",
2255
- "primaryKey": false,
2256
- "notNull": false
2257
- },
2258
- "messages": {
2259
- "name": "messages",
2260
- "type": "jsonb",
2261
- "primaryKey": false,
2262
- "notNull": false,
2263
- "default": "'[]'::jsonb"
2264
- },
2265
- "total_tokens": {
2266
- "name": "total_tokens",
2267
- "type": "integer",
2268
- "primaryKey": false,
2269
- "notNull": true,
2270
- "default": 0
2271
- },
2272
- "created_at": {
2273
- "name": "created_at",
2274
- "type": "timestamp",
2275
- "primaryKey": false,
2276
- "notNull": true,
2277
- "default": "now()"
2278
- },
2279
- "updated_at": {
2280
- "name": "updated_at",
2281
- "type": "timestamp",
2282
- "primaryKey": false,
2283
- "notNull": true,
2284
- "default": "now()"
2285
- },
2286
- "created_by": {
2287
- "name": "created_by",
2288
- "type": "text",
2289
- "primaryKey": false,
2290
- "notNull": true
2291
- }
2292
- },
2293
- "indexes": {
2294
- "ai_conversation_org_idx": {
2295
- "name": "ai_conversation_org_idx",
2296
- "columns": [
2297
- {
2298
- "expression": "organization_id",
2299
- "isExpression": false,
2300
- "asc": true,
2301
- "nulls": "last"
2302
- }
2303
- ],
2304
- "isUnique": false,
2305
- "concurrently": false,
2306
- "method": "btree",
2307
- "with": {}
2308
- },
2309
- "ai_conversation_template_idx": {
2310
- "name": "ai_conversation_template_idx",
2311
- "columns": [
2312
- {
2313
- "expression": "template_id",
2314
- "isExpression": false,
2315
- "asc": true,
2316
- "nulls": "last"
2317
- }
2318
- ],
2319
- "isUnique": false,
2320
- "concurrently": false,
2321
- "method": "btree",
2322
- "with": {}
2323
- }
2324
- },
2325
- "foreignKeys": {
2326
- "ai_conversation_organization_id_organization_id_fk": {
2327
- "name": "ai_conversation_organization_id_organization_id_fk",
2328
- "tableFrom": "ai_conversation",
2329
- "tableTo": "organization",
2330
- "columnsFrom": ["organization_id"],
2331
- "columnsTo": ["id"],
2332
- "onDelete": "cascade",
2333
- "onUpdate": "no action"
2334
- },
2335
- "ai_conversation_template_id_template_id_fk": {
2336
- "name": "ai_conversation_template_id_template_id_fk",
2337
- "tableFrom": "ai_conversation",
2338
- "tableTo": "template",
2339
- "columnsFrom": ["template_id"],
2340
- "columnsTo": ["id"],
2341
- "onDelete": "cascade",
2342
- "onUpdate": "no action"
2343
- },
2344
- "ai_conversation_created_by_user_id_fk": {
2345
- "name": "ai_conversation_created_by_user_id_fk",
2346
- "tableFrom": "ai_conversation",
2347
- "tableTo": "user",
2348
- "columnsFrom": ["created_by"],
2349
- "columnsTo": ["id"],
2350
- "onDelete": "set null",
2351
- "onUpdate": "no action"
2352
- }
2353
- },
2354
- "compositePrimaryKeys": {},
2355
- "uniqueConstraints": {},
2356
- "policies": {},
2357
- "checkConstraints": {},
2358
- "isRLSEnabled": false
2359
- },
2360
- "public.brand_kit": {
2361
- "name": "brand_kit",
2362
- "schema": "",
2363
- "columns": {
2364
- "id": {
2365
- "name": "id",
2366
- "type": "text",
2367
- "primaryKey": true,
2368
- "notNull": true
2369
- },
2370
- "organization_id": {
2371
- "name": "organization_id",
2372
- "type": "text",
2373
- "primaryKey": false,
2374
- "notNull": true
2375
- },
2376
- "name": {
2377
- "name": "name",
2378
- "type": "text",
2379
- "primaryKey": false,
2380
- "notNull": true,
2381
- "default": "'Default'"
2382
- },
2383
- "logo_url": {
2384
- "name": "logo_url",
2385
- "type": "text",
2386
- "primaryKey": false,
2387
- "notNull": false
2388
- },
2389
- "primary_color": {
2390
- "name": "primary_color",
2391
- "type": "text",
2392
- "primaryKey": false,
2393
- "notNull": true,
2394
- "default": "'#5046e5'"
2395
- },
2396
- "secondary_color": {
2397
- "name": "secondary_color",
2398
- "type": "text",
2399
- "primaryKey": false,
2400
- "notNull": true,
2401
- "default": "'#6366f1'"
2402
- },
2403
- "background_color": {
2404
- "name": "background_color",
2405
- "type": "text",
2406
- "primaryKey": false,
2407
- "notNull": true,
2408
- "default": "'#ffffff'"
2409
- },
2410
- "text_color": {
2411
- "name": "text_color",
2412
- "type": "text",
2413
- "primaryKey": false,
2414
- "notNull": true,
2415
- "default": "'#1f2937'"
2416
- },
2417
- "font_family": {
2418
- "name": "font_family",
2419
- "type": "text",
2420
- "primaryKey": false,
2421
- "notNull": true,
2422
- "default": "'system-ui, sans-serif'"
2423
- },
2424
- "heading_font_family": {
2425
- "name": "heading_font_family",
2426
- "type": "text",
2427
- "primaryKey": false,
2428
- "notNull": false
2429
- },
2430
- "button_style": {
2431
- "name": "button_style",
2432
- "type": "text",
2433
- "primaryKey": false,
2434
- "notNull": true,
2435
- "default": "'rounded'"
2436
- },
2437
- "button_radius": {
2438
- "name": "button_radius",
2439
- "type": "text",
2440
- "primaryKey": false,
2441
- "notNull": true,
2442
- "default": "'4px'"
2443
- },
2444
- "company_name": {
2445
- "name": "company_name",
2446
- "type": "text",
2447
- "primaryKey": false,
2448
- "notNull": false
2449
- },
2450
- "company_address": {
2451
- "name": "company_address",
2452
- "type": "text",
2453
- "primaryKey": false,
2454
- "notNull": false
2455
- },
2456
- "social_links": {
2457
- "name": "social_links",
2458
- "type": "jsonb",
2459
- "primaryKey": false,
2460
- "notNull": false,
2461
- "default": "'[]'::jsonb"
2462
- },
2463
- "source_domain": {
2464
- "name": "source_domain",
2465
- "type": "text",
2466
- "primaryKey": false,
2467
- "notNull": false
2468
- },
2469
- "auto_extracted": {
2470
- "name": "auto_extracted",
2471
- "type": "boolean",
2472
- "primaryKey": false,
2473
- "notNull": true,
2474
- "default": false
2475
- },
2476
- "is_default": {
2477
- "name": "is_default",
2478
- "type": "boolean",
2479
- "primaryKey": false,
2480
- "notNull": true,
2481
- "default": false
2482
- },
2483
- "created_at": {
2484
- "name": "created_at",
2485
- "type": "timestamp",
2486
- "primaryKey": false,
2487
- "notNull": true,
2488
- "default": "now()"
2489
- },
2490
- "updated_at": {
2491
- "name": "updated_at",
2492
- "type": "timestamp",
2493
- "primaryKey": false,
2494
- "notNull": true,
2495
- "default": "now()"
2496
- }
2497
- },
2498
- "indexes": {
2499
- "brand_kit_org_idx": {
2500
- "name": "brand_kit_org_idx",
2501
- "columns": [
2502
- {
2503
- "expression": "organization_id",
2504
- "isExpression": false,
2505
- "asc": true,
2506
- "nulls": "last"
2507
- }
2508
- ],
2509
- "isUnique": false,
2510
- "concurrently": false,
2511
- "method": "btree",
2512
- "with": {}
2513
- },
2514
- "brand_kit_default_idx": {
2515
- "name": "brand_kit_default_idx",
2516
- "columns": [
2517
- {
2518
- "expression": "organization_id",
2519
- "isExpression": false,
2520
- "asc": true,
2521
- "nulls": "last"
2522
- },
2523
- {
2524
- "expression": "is_default",
2525
- "isExpression": false,
2526
- "asc": true,
2527
- "nulls": "last"
2528
- }
2529
- ],
2530
- "isUnique": false,
2531
- "concurrently": false,
2532
- "method": "btree",
2533
- "with": {}
2534
- }
2535
- },
2536
- "foreignKeys": {
2537
- "brand_kit_organization_id_organization_id_fk": {
2538
- "name": "brand_kit_organization_id_organization_id_fk",
2539
- "tableFrom": "brand_kit",
2540
- "tableTo": "organization",
2541
- "columnsFrom": ["organization_id"],
2542
- "columnsTo": ["id"],
2543
- "onDelete": "cascade",
2544
- "onUpdate": "no action"
2545
- }
2546
- },
2547
- "compositePrimaryKeys": {},
2548
- "uniqueConstraints": {},
2549
- "policies": {},
2550
- "checkConstraints": {},
2551
- "isRLSEnabled": false
2552
- },
2553
- "public.reusable_block": {
2554
- "name": "reusable_block",
2555
- "schema": "",
2556
- "columns": {
2557
- "id": {
2558
- "name": "id",
2559
- "type": "text",
2560
- "primaryKey": true,
2561
- "notNull": true
2562
- },
2563
- "organization_id": {
2564
- "name": "organization_id",
2565
- "type": "text",
2566
- "primaryKey": false,
2567
- "notNull": true
2568
- },
2569
- "name": {
2570
- "name": "name",
2571
- "type": "text",
2572
- "primaryKey": false,
2573
- "notNull": true
2574
- },
2575
- "description": {
2576
- "name": "description",
2577
- "type": "text",
2578
- "primaryKey": false,
2579
- "notNull": false
2580
- },
2581
- "category": {
2582
- "name": "category",
2583
- "type": "text",
2584
- "primaryKey": false,
2585
- "notNull": true,
2586
- "default": "'custom'"
2587
- },
2588
- "content": {
2589
- "name": "content",
2590
- "type": "jsonb",
2591
- "primaryKey": false,
2592
- "notNull": true
2593
- },
2594
- "thumbnail": {
2595
- "name": "thumbnail",
2596
- "type": "text",
2597
- "primaryKey": false,
2598
- "notNull": false
2599
- },
2600
- "is_public": {
2601
- "name": "is_public",
2602
- "type": "boolean",
2603
- "primaryKey": false,
2604
- "notNull": true,
2605
- "default": false
2606
- },
2607
- "usage_count": {
2608
- "name": "usage_count",
2609
- "type": "integer",
2610
- "primaryKey": false,
2611
- "notNull": true,
2612
- "default": 0
2613
- },
2614
- "created_at": {
2615
- "name": "created_at",
2616
- "type": "timestamp",
2617
- "primaryKey": false,
2618
- "notNull": true,
2619
- "default": "now()"
2620
- },
2621
- "updated_at": {
2622
- "name": "updated_at",
2623
- "type": "timestamp",
2624
- "primaryKey": false,
2625
- "notNull": true,
2626
- "default": "now()"
2627
- },
2628
- "created_by": {
2629
- "name": "created_by",
2630
- "type": "text",
2631
- "primaryKey": false,
2632
- "notNull": true
2633
- }
2634
- },
2635
- "indexes": {
2636
- "reusable_block_org_idx": {
2637
- "name": "reusable_block_org_idx",
2638
- "columns": [
2639
- {
2640
- "expression": "organization_id",
2641
- "isExpression": false,
2642
- "asc": true,
2643
- "nulls": "last"
2644
- }
2645
- ],
2646
- "isUnique": false,
2647
- "concurrently": false,
2648
- "method": "btree",
2649
- "with": {}
2650
- },
2651
- "reusable_block_created_by_category_idx": {
2652
- "name": "reusable_block_created_by_category_idx",
2653
- "columns": [
2654
- {
2655
- "expression": "created_by",
2656
- "isExpression": false,
2657
- "asc": true,
2658
- "nulls": "last"
2659
- },
2660
- {
2661
- "expression": "category",
2662
- "isExpression": false,
2663
- "asc": true,
2664
- "nulls": "last"
2665
- }
2666
- ],
2667
- "isUnique": false,
2668
- "concurrently": false,
2669
- "method": "btree",
2670
- "with": {}
2671
- },
2672
- "reusable_block_public_category_idx": {
2673
- "name": "reusable_block_public_category_idx",
2674
- "columns": [
2675
- {
2676
- "expression": "is_public",
2677
- "isExpression": false,
2678
- "asc": true,
2679
- "nulls": "last"
2680
- },
2681
- {
2682
- "expression": "category",
2683
- "isExpression": false,
2684
- "asc": true,
2685
- "nulls": "last"
2686
- }
2687
- ],
2688
- "isUnique": false,
2689
- "concurrently": false,
2690
- "method": "btree",
2691
- "with": {}
2692
- }
2693
- },
2694
- "foreignKeys": {
2695
- "reusable_block_organization_id_organization_id_fk": {
2696
- "name": "reusable_block_organization_id_organization_id_fk",
2697
- "tableFrom": "reusable_block",
2698
- "tableTo": "organization",
2699
- "columnsFrom": ["organization_id"],
2700
- "columnsTo": ["id"],
2701
- "onDelete": "cascade",
2702
- "onUpdate": "no action"
2703
- },
2704
- "reusable_block_created_by_user_id_fk": {
2705
- "name": "reusable_block_created_by_user_id_fk",
2706
- "tableFrom": "reusable_block",
2707
- "tableTo": "user",
2708
- "columnsFrom": ["created_by"],
2709
- "columnsTo": ["id"],
2710
- "onDelete": "set null",
2711
- "onUpdate": "no action"
2712
- }
2713
- },
2714
- "compositePrimaryKeys": {},
2715
- "uniqueConstraints": {},
2716
- "policies": {},
2717
- "checkConstraints": {},
2718
- "isRLSEnabled": false
2719
- },
2720
- "public.template": {
2721
- "name": "template",
2722
- "schema": "",
2723
- "columns": {
2724
- "id": {
2725
- "name": "id",
2726
- "type": "text",
2727
- "primaryKey": true,
2728
- "notNull": true
2729
- },
2730
- "organization_id": {
2731
- "name": "organization_id",
2732
- "type": "text",
2733
- "primaryKey": false,
2734
- "notNull": true
2735
- },
2736
- "name": {
2737
- "name": "name",
2738
- "type": "text",
2739
- "primaryKey": false,
2740
- "notNull": true
2741
- },
2742
- "description": {
2743
- "name": "description",
2744
- "type": "text",
2745
- "primaryKey": false,
2746
- "notNull": false
2747
- },
2748
- "subject": {
2749
- "name": "subject",
2750
- "type": "text",
2751
- "primaryKey": false,
2752
- "notNull": false
2753
- },
2754
- "content": {
2755
- "name": "content",
2756
- "type": "jsonb",
2757
- "primaryKey": false,
2758
- "notNull": true
2759
- },
2760
- "compiled_html": {
2761
- "name": "compiled_html",
2762
- "type": "text",
2763
- "primaryKey": false,
2764
- "notNull": false
2765
- },
2766
- "compiled_text": {
2767
- "name": "compiled_text",
2768
- "type": "text",
2769
- "primaryKey": false,
2770
- "notNull": false
2771
- },
2772
- "variables": {
2773
- "name": "variables",
2774
- "type": "jsonb",
2775
- "primaryKey": false,
2776
- "notNull": false,
2777
- "default": "'[]'::jsonb"
2778
- },
2779
- "test_data": {
2780
- "name": "test_data",
2781
- "type": "jsonb",
2782
- "primaryKey": false,
2783
- "notNull": false,
2784
- "default": "'{}'::jsonb"
2785
- },
2786
- "room_id": {
2787
- "name": "room_id",
2788
- "type": "text",
2789
- "primaryKey": false,
2790
- "notNull": false
2791
- },
2792
- "is_collaborative": {
2793
- "name": "is_collaborative",
2794
- "type": "boolean",
2795
- "primaryKey": false,
2796
- "notNull": true,
2797
- "default": false
2798
- },
2799
- "ai_generated": {
2800
- "name": "ai_generated",
2801
- "type": "boolean",
2802
- "primaryKey": false,
2803
- "notNull": true,
2804
- "default": false
2805
- },
2806
- "ai_conversation_id": {
2807
- "name": "ai_conversation_id",
2808
- "type": "text",
2809
- "primaryKey": false,
2810
- "notNull": false
2811
- },
2812
- "ses_template_name": {
2813
- "name": "ses_template_name",
2814
- "type": "text",
2815
- "primaryKey": false,
2816
- "notNull": false
2817
- },
2818
- "published_at": {
2819
- "name": "published_at",
2820
- "type": "timestamp",
2821
- "primaryKey": false,
2822
- "notNull": false
2823
- },
2824
- "status": {
2825
- "name": "status",
2826
- "type": "template_status",
2827
- "typeSchema": "public",
2828
- "primaryKey": false,
2829
- "notNull": true,
2830
- "default": "'DRAFT'"
2831
- },
2832
- "created_at": {
2833
- "name": "created_at",
2834
- "type": "timestamp",
2835
- "primaryKey": false,
2836
- "notNull": true,
2837
- "default": "now()"
2838
- },
2839
- "updated_at": {
2840
- "name": "updated_at",
2841
- "type": "timestamp",
2842
- "primaryKey": false,
2843
- "notNull": true,
2844
- "default": "now()"
2845
- },
2846
- "created_by": {
2847
- "name": "created_by",
2848
- "type": "text",
2849
- "primaryKey": false,
2850
- "notNull": true
2851
- },
2852
- "last_edited_by": {
2853
- "name": "last_edited_by",
2854
- "type": "text",
2855
- "primaryKey": false,
2856
- "notNull": false
2857
- }
2858
- },
2859
- "indexes": {
2860
- "template_org_idx": {
2861
- "name": "template_org_idx",
2862
- "columns": [
2863
- {
2864
- "expression": "organization_id",
2865
- "isExpression": false,
2866
- "asc": true,
2867
- "nulls": "last"
2868
- }
2869
- ],
2870
- "isUnique": false,
2871
- "concurrently": false,
2872
- "method": "btree",
2873
- "with": {}
2874
- },
2875
- "template_status_updated_at_idx": {
2876
- "name": "template_status_updated_at_idx",
2877
- "columns": [
2878
- {
2879
- "expression": "status",
2880
- "isExpression": false,
2881
- "asc": true,
2882
- "nulls": "last"
2883
- },
2884
- {
2885
- "expression": "updated_at",
2886
- "isExpression": false,
2887
- "asc": true,
2888
- "nulls": "last"
2889
- }
2890
- ],
2891
- "isUnique": false,
2892
- "concurrently": false,
2893
- "method": "btree",
2894
- "with": {}
2895
- },
2896
- "template_created_by_idx": {
2897
- "name": "template_created_by_idx",
2898
- "columns": [
2899
- {
2900
- "expression": "created_by",
2901
- "isExpression": false,
2902
- "asc": true,
2903
- "nulls": "last"
2904
- }
2905
- ],
2906
- "isUnique": false,
2907
- "concurrently": false,
2908
- "method": "btree",
2909
- "with": {}
2910
- },
2911
- "template_room_id_idx": {
2912
- "name": "template_room_id_idx",
2913
- "columns": [
2914
- {
2915
- "expression": "room_id",
2916
- "isExpression": false,
2917
- "asc": true,
2918
- "nulls": "last"
2919
- }
2920
- ],
2921
- "isUnique": true,
2922
- "concurrently": false,
2923
- "method": "btree",
2924
- "with": {}
2925
- }
2926
- },
2927
- "foreignKeys": {
2928
- "template_organization_id_organization_id_fk": {
2929
- "name": "template_organization_id_organization_id_fk",
2930
- "tableFrom": "template",
2931
- "tableTo": "organization",
2932
- "columnsFrom": ["organization_id"],
2933
- "columnsTo": ["id"],
2934
- "onDelete": "cascade",
2935
- "onUpdate": "no action"
2936
- },
2937
- "template_created_by_user_id_fk": {
2938
- "name": "template_created_by_user_id_fk",
2939
- "tableFrom": "template",
2940
- "tableTo": "user",
2941
- "columnsFrom": ["created_by"],
2942
- "columnsTo": ["id"],
2943
- "onDelete": "set null",
2944
- "onUpdate": "no action"
2945
- },
2946
- "template_last_edited_by_user_id_fk": {
2947
- "name": "template_last_edited_by_user_id_fk",
2948
- "tableFrom": "template",
2949
- "tableTo": "user",
2950
- "columnsFrom": ["last_edited_by"],
2951
- "columnsTo": ["id"],
2952
- "onDelete": "set null",
2953
- "onUpdate": "no action"
2954
- }
2955
- },
2956
- "compositePrimaryKeys": {},
2957
- "uniqueConstraints": {},
2958
- "policies": {},
2959
- "checkConstraints": {},
2960
- "isRLSEnabled": false
2961
- },
2962
- "public.template_variable": {
2963
- "name": "template_variable",
2964
- "schema": "",
2965
- "columns": {
2966
- "id": {
2967
- "name": "id",
2968
- "type": "text",
2969
- "primaryKey": true,
2970
- "notNull": true
2971
- },
2972
- "organization_id": {
2973
- "name": "organization_id",
2974
- "type": "text",
2975
- "primaryKey": false,
2976
- "notNull": true
2977
- },
2978
- "name": {
2979
- "name": "name",
2980
- "type": "text",
2981
- "primaryKey": false,
2982
- "notNull": true
2983
- },
2984
- "label": {
2985
- "name": "label",
2986
- "type": "text",
2987
- "primaryKey": false,
2988
- "notNull": true
2989
- },
2990
- "type": {
2991
- "name": "type",
2992
- "type": "variable_type",
2993
- "typeSchema": "public",
2994
- "primaryKey": false,
2995
- "notNull": true
2996
- },
2997
- "required": {
2998
- "name": "required",
2999
- "type": "boolean",
3000
- "primaryKey": false,
3001
- "notNull": true,
3002
- "default": false
3003
- },
3004
- "fallback": {
3005
- "name": "fallback",
3006
- "type": "text",
3007
- "primaryKey": false,
3008
- "notNull": false
3009
- },
3010
- "validation": {
3011
- "name": "validation",
3012
- "type": "jsonb",
3013
- "primaryKey": false,
3014
- "notNull": false
3015
- },
3016
- "created_at": {
3017
- "name": "created_at",
3018
- "type": "timestamp",
3019
- "primaryKey": false,
3020
- "notNull": true,
3021
- "default": "now()"
3022
- },
3023
- "updated_at": {
3024
- "name": "updated_at",
3025
- "type": "timestamp",
3026
- "primaryKey": false,
3027
- "notNull": true,
3028
- "default": "now()"
3029
- }
3030
- },
3031
- "indexes": {
3032
- "template_variable_org_name_idx": {
3033
- "name": "template_variable_org_name_idx",
3034
- "columns": [
3035
- {
3036
- "expression": "organization_id",
3037
- "isExpression": false,
3038
- "asc": true,
3039
- "nulls": "last"
3040
- },
3041
- {
3042
- "expression": "name",
3043
- "isExpression": false,
3044
- "asc": true,
3045
- "nulls": "last"
3046
- }
3047
- ],
3048
- "isUnique": true,
3049
- "concurrently": false,
3050
- "method": "btree",
3051
- "with": {}
3052
- }
3053
- },
3054
- "foreignKeys": {
3055
- "template_variable_organization_id_organization_id_fk": {
3056
- "name": "template_variable_organization_id_organization_id_fk",
3057
- "tableFrom": "template_variable",
3058
- "tableTo": "organization",
3059
- "columnsFrom": ["organization_id"],
3060
- "columnsTo": ["id"],
3061
- "onDelete": "cascade",
3062
- "onUpdate": "no action"
3063
- }
3064
- },
3065
- "compositePrimaryKeys": {},
3066
- "uniqueConstraints": {},
3067
- "policies": {},
3068
- "checkConstraints": {},
3069
- "isRLSEnabled": false
3070
- },
3071
- "public.template_version": {
3072
- "name": "template_version",
3073
- "schema": "",
3074
- "columns": {
3075
- "id": {
3076
- "name": "id",
3077
- "type": "text",
3078
- "primaryKey": true,
3079
- "notNull": true
3080
- },
3081
- "template_id": {
3082
- "name": "template_id",
3083
- "type": "text",
3084
- "primaryKey": false,
3085
- "notNull": true
3086
- },
3087
- "content": {
3088
- "name": "content",
3089
- "type": "jsonb",
3090
- "primaryKey": false,
3091
- "notNull": true
3092
- },
3093
- "version": {
3094
- "name": "version",
3095
- "type": "integer",
3096
- "primaryKey": false,
3097
- "notNull": true
3098
- },
3099
- "created_at": {
3100
- "name": "created_at",
3101
- "type": "timestamp",
3102
- "primaryKey": false,
3103
- "notNull": true,
3104
- "default": "now()"
3105
- },
3106
- "created_by": {
3107
- "name": "created_by",
3108
- "type": "text",
3109
- "primaryKey": false,
3110
- "notNull": true
3111
- },
3112
- "change_note": {
3113
- "name": "change_note",
3114
- "type": "text",
3115
- "primaryKey": false,
3116
- "notNull": false
3117
- }
3118
- },
3119
- "indexes": {
3120
- "template_version_template_version_idx": {
3121
- "name": "template_version_template_version_idx",
3122
- "columns": [
3123
- {
3124
- "expression": "template_id",
3125
- "isExpression": false,
3126
- "asc": true,
3127
- "nulls": "last"
3128
- },
3129
- {
3130
- "expression": "version",
3131
- "isExpression": false,
3132
- "asc": true,
3133
- "nulls": "last"
3134
- }
3135
- ],
3136
- "isUnique": true,
3137
- "concurrently": false,
3138
- "method": "btree",
3139
- "with": {}
3140
- },
3141
- "template_version_template_created_at_idx": {
3142
- "name": "template_version_template_created_at_idx",
3143
- "columns": [
3144
- {
3145
- "expression": "template_id",
3146
- "isExpression": false,
3147
- "asc": true,
3148
- "nulls": "last"
3149
- },
3150
- {
3151
- "expression": "created_at",
3152
- "isExpression": false,
3153
- "asc": true,
3154
- "nulls": "last"
3155
- }
3156
- ],
3157
- "isUnique": false,
3158
- "concurrently": false,
3159
- "method": "btree",
3160
- "with": {}
3161
- }
3162
- },
3163
- "foreignKeys": {
3164
- "template_version_template_id_template_id_fk": {
3165
- "name": "template_version_template_id_template_id_fk",
3166
- "tableFrom": "template_version",
3167
- "tableTo": "template",
3168
- "columnsFrom": ["template_id"],
3169
- "columnsTo": ["id"],
3170
- "onDelete": "cascade",
3171
- "onUpdate": "no action"
3172
- },
3173
- "template_version_created_by_user_id_fk": {
3174
- "name": "template_version_created_by_user_id_fk",
3175
- "tableFrom": "template_version",
3176
- "tableTo": "user",
3177
- "columnsFrom": ["created_by"],
3178
- "columnsTo": ["id"],
3179
- "onDelete": "set null",
3180
- "onUpdate": "no action"
3181
- }
3182
- },
3183
- "compositePrimaryKeys": {},
3184
- "uniqueConstraints": {},
3185
- "policies": {},
3186
- "checkConstraints": {},
3187
- "isRLSEnabled": false
3188
- },
3189
- "public.ai_usage_log": {
3190
- "name": "ai_usage_log",
3191
- "schema": "",
3192
- "columns": {
3193
- "id": {
3194
- "name": "id",
3195
- "type": "text",
3196
- "primaryKey": true,
3197
- "notNull": true
3198
- },
3199
- "organization_id": {
3200
- "name": "organization_id",
3201
- "type": "text",
3202
- "primaryKey": false,
3203
- "notNull": true
3204
- },
3205
- "user_id": {
3206
- "name": "user_id",
3207
- "type": "text",
3208
- "primaryKey": false,
3209
- "notNull": false
3210
- },
3211
- "period_key": {
3212
- "name": "period_key",
3213
- "type": "text",
3214
- "primaryKey": false,
3215
- "notNull": true
3216
- },
3217
- "feature_type": {
3218
- "name": "feature_type",
3219
- "type": "text",
3220
- "primaryKey": false,
3221
- "notNull": true,
3222
- "default": "'ai_chat'"
3223
- },
3224
- "template_id": {
3225
- "name": "template_id",
3226
- "type": "text",
3227
- "primaryKey": false,
3228
- "notNull": false
3229
- },
3230
- "input_tokens": {
3231
- "name": "input_tokens",
3232
- "type": "integer",
3233
- "primaryKey": false,
3234
- "notNull": false
3235
- },
3236
- "output_tokens": {
3237
- "name": "output_tokens",
3238
- "type": "integer",
3239
- "primaryKey": false,
3240
- "notNull": false
3241
- },
3242
- "total_tokens": {
3243
- "name": "total_tokens",
3244
- "type": "integer",
3245
- "primaryKey": false,
3246
- "notNull": false
3247
- },
3248
- "model": {
3249
- "name": "model",
3250
- "type": "text",
3251
- "primaryKey": false,
3252
- "notNull": false
3253
- },
3254
- "duration_ms": {
3255
- "name": "duration_ms",
3256
- "type": "integer",
3257
- "primaryKey": false,
3258
- "notNull": false
3259
- },
3260
- "created_at": {
3261
- "name": "created_at",
3262
- "type": "timestamp",
3263
- "primaryKey": false,
3264
- "notNull": true,
3265
- "default": "now()"
3266
- }
3267
- },
3268
- "indexes": {
3269
- "ai_usage_log_org_idx": {
3270
- "name": "ai_usage_log_org_idx",
3271
- "columns": [
3272
- {
3273
- "expression": "organization_id",
3274
- "isExpression": false,
3275
- "asc": true,
3276
- "nulls": "last"
3277
- }
3278
- ],
3279
- "isUnique": false,
3280
- "concurrently": false,
3281
- "method": "btree",
3282
- "with": {}
3283
- },
3284
- "ai_usage_log_period_idx": {
3285
- "name": "ai_usage_log_period_idx",
3286
- "columns": [
3287
- {
3288
- "expression": "period_key",
3289
- "isExpression": false,
3290
- "asc": true,
3291
- "nulls": "last"
3292
- }
3293
- ],
3294
- "isUnique": false,
3295
- "concurrently": false,
3296
- "method": "btree",
3297
- "with": {}
3298
- },
3299
- "ai_usage_log_org_period_idx": {
3300
- "name": "ai_usage_log_org_period_idx",
3301
- "columns": [
3302
- {
3303
- "expression": "organization_id",
3304
- "isExpression": false,
3305
- "asc": true,
3306
- "nulls": "last"
3307
- },
3308
- {
3309
- "expression": "period_key",
3310
- "isExpression": false,
3311
- "asc": true,
3312
- "nulls": "last"
3313
- }
3314
- ],
3315
- "isUnique": false,
3316
- "concurrently": false,
3317
- "method": "btree",
3318
- "with": {}
3319
- },
3320
- "ai_usage_log_user_idx": {
3321
- "name": "ai_usage_log_user_idx",
3322
- "columns": [
3323
- {
3324
- "expression": "user_id",
3325
- "isExpression": false,
3326
- "asc": true,
3327
- "nulls": "last"
3328
- }
3329
- ],
3330
- "isUnique": false,
3331
- "concurrently": false,
3332
- "method": "btree",
3333
- "with": {}
3334
- },
3335
- "ai_usage_log_created_idx": {
3336
- "name": "ai_usage_log_created_idx",
3337
- "columns": [
3338
- {
3339
- "expression": "created_at",
3340
- "isExpression": false,
3341
- "asc": true,
3342
- "nulls": "last"
3343
- }
3344
- ],
3345
- "isUnique": false,
3346
- "concurrently": false,
3347
- "method": "btree",
3348
- "with": {}
3349
- }
3350
- },
3351
- "foreignKeys": {
3352
- "ai_usage_log_organization_id_organization_id_fk": {
3353
- "name": "ai_usage_log_organization_id_organization_id_fk",
3354
- "tableFrom": "ai_usage_log",
3355
- "tableTo": "organization",
3356
- "columnsFrom": ["organization_id"],
3357
- "columnsTo": ["id"],
3358
- "onDelete": "cascade",
3359
- "onUpdate": "no action"
3360
- },
3361
- "ai_usage_log_user_id_user_id_fk": {
3362
- "name": "ai_usage_log_user_id_user_id_fk",
3363
- "tableFrom": "ai_usage_log",
3364
- "tableTo": "user",
3365
- "columnsFrom": ["user_id"],
3366
- "columnsTo": ["id"],
3367
- "onDelete": "set null",
3368
- "onUpdate": "no action"
3369
- }
3370
- },
3371
- "compositePrimaryKeys": {},
3372
- "uniqueConstraints": {},
3373
- "policies": {},
3374
- "checkConstraints": {},
3375
- "isRLSEnabled": false
3376
- },
3377
- "public.ai_usage_monthly": {
3378
- "name": "ai_usage_monthly",
3379
- "schema": "",
3380
- "columns": {
3381
- "id": {
3382
- "name": "id",
3383
- "type": "text",
3384
- "primaryKey": true,
3385
- "notNull": true
3386
- },
3387
- "organization_id": {
3388
- "name": "organization_id",
3389
- "type": "text",
3390
- "primaryKey": false,
3391
- "notNull": true
3392
- },
3393
- "period_key": {
3394
- "name": "period_key",
3395
- "type": "text",
3396
- "primaryKey": false,
3397
- "notNull": true
3398
- },
3399
- "message_count": {
3400
- "name": "message_count",
3401
- "type": "integer",
3402
- "primaryKey": false,
3403
- "notNull": true,
3404
- "default": 0
3405
- },
3406
- "updated_at": {
3407
- "name": "updated_at",
3408
- "type": "timestamp",
3409
- "primaryKey": false,
3410
- "notNull": true,
3411
- "default": "now()"
3412
- }
3413
- },
3414
- "indexes": {
3415
- "ai_usage_monthly_org_period_idx": {
3416
- "name": "ai_usage_monthly_org_period_idx",
3417
- "columns": [
3418
- {
3419
- "expression": "organization_id",
3420
- "isExpression": false,
3421
- "asc": true,
3422
- "nulls": "last"
3423
- },
3424
- {
3425
- "expression": "period_key",
3426
- "isExpression": false,
3427
- "asc": true,
3428
- "nulls": "last"
3429
- }
3430
- ],
3431
- "isUnique": true,
3432
- "concurrently": false,
3433
- "method": "btree",
3434
- "with": {}
3435
- },
3436
- "ai_usage_monthly_period_idx": {
3437
- "name": "ai_usage_monthly_period_idx",
3438
- "columns": [
3439
- {
3440
- "expression": "period_key",
3441
- "isExpression": false,
3442
- "asc": true,
3443
- "nulls": "last"
3444
- }
3445
- ],
3446
- "isUnique": false,
3447
- "concurrently": false,
3448
- "method": "btree",
3449
- "with": {}
3450
- }
3451
- },
3452
- "foreignKeys": {
3453
- "ai_usage_monthly_organization_id_organization_id_fk": {
3454
- "name": "ai_usage_monthly_organization_id_organization_id_fk",
3455
- "tableFrom": "ai_usage_monthly",
3456
- "tableTo": "organization",
3457
- "columnsFrom": ["organization_id"],
3458
- "columnsTo": ["id"],
3459
- "onDelete": "cascade",
3460
- "onUpdate": "no action"
3461
- }
3462
- },
3463
- "compositePrimaryKeys": {},
3464
- "uniqueConstraints": {},
3465
- "policies": {},
3466
- "checkConstraints": {},
3467
- "isRLSEnabled": false
3468
- },
3469
- "public.waitlist": {
3470
- "name": "waitlist",
3471
- "schema": "",
3472
- "columns": {
3473
- "id": {
3474
- "name": "id",
3475
- "type": "text",
3476
- "primaryKey": true,
3477
- "notNull": true
3478
- },
3479
- "email": {
3480
- "name": "email",
3481
- "type": "text",
3482
- "primaryKey": false,
3483
- "notNull": true
3484
- },
3485
- "email_hash": {
3486
- "name": "email_hash",
3487
- "type": "text",
3488
- "primaryKey": false,
3489
- "notNull": true
3490
- },
3491
- "product": {
3492
- "name": "product",
3493
- "type": "text",
3494
- "primaryKey": false,
3495
- "notNull": true
3496
- },
3497
- "source": {
3498
- "name": "source",
3499
- "type": "text",
3500
- "primaryKey": false,
3501
- "notNull": false
3502
- },
3503
- "referrer": {
3504
- "name": "referrer",
3505
- "type": "text",
3506
- "primaryKey": false,
3507
- "notNull": false
3508
- },
3509
- "created_at": {
3510
- "name": "created_at",
3511
- "type": "timestamp",
3512
- "primaryKey": false,
3513
- "notNull": true,
3514
- "default": "now()"
3515
- }
3516
- },
3517
- "indexes": {
3518
- "waitlist_email_product_idx": {
3519
- "name": "waitlist_email_product_idx",
3520
- "columns": [
3521
- {
3522
- "expression": "email_hash",
3523
- "isExpression": false,
3524
- "asc": true,
3525
- "nulls": "last"
3526
- },
3527
- {
3528
- "expression": "product",
3529
- "isExpression": false,
3530
- "asc": true,
3531
- "nulls": "last"
3532
- }
3533
- ],
3534
- "isUnique": true,
3535
- "concurrently": false,
3536
- "method": "btree",
3537
- "with": {}
3538
- },
3539
- "waitlist_product_idx": {
3540
- "name": "waitlist_product_idx",
3541
- "columns": [
3542
- {
3543
- "expression": "product",
3544
- "isExpression": false,
3545
- "asc": true,
3546
- "nulls": "last"
3547
- }
3548
- ],
3549
- "isUnique": false,
3550
- "concurrently": false,
3551
- "method": "btree",
3552
- "with": {}
3553
- },
3554
- "waitlist_created_at_idx": {
3555
- "name": "waitlist_created_at_idx",
3556
- "columns": [
3557
- {
3558
- "expression": "created_at",
3559
- "isExpression": false,
3560
- "asc": true,
3561
- "nulls": "last"
3562
- }
3563
- ],
3564
- "isUnique": false,
3565
- "concurrently": false,
3566
- "method": "btree",
3567
- "with": {}
3568
- }
3569
- },
3570
- "foreignKeys": {},
3571
- "compositePrimaryKeys": {},
3572
- "uniqueConstraints": {},
3573
- "policies": {},
3574
- "checkConstraints": {},
3575
- "isRLSEnabled": false
3576
- }
3577
- },
3578
- "enums": {
3579
- "public.template_status": {
3580
- "name": "template_status",
3581
- "schema": "public",
3582
- "values": ["DRAFT", "PUBLISHED", "ARCHIVED"]
3583
- },
3584
- "public.variable_type": {
3585
- "name": "variable_type",
3586
- "schema": "public",
3587
- "values": ["TEXT", "NUMBER", "BOOLEAN", "DATE", "URL", "EMAIL"]
3588
- }
3589
- },
3590
- "schemas": {},
3591
- "sequences": {},
3592
- "roles": {},
3593
- "policies": {},
3594
- "views": {},
3595
- "_meta": {
3596
- "columns": {},
3597
- "schemas": {},
3598
- "tables": {}
3599
- }
3600
- }