@wraps.dev/cli 2.21.10 → 2.21.11

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 (63) hide show
  1. package/dist/api-lambda.zip +0 -0
  2. package/dist/lambda/event-processor/.bundled +1 -1
  3. package/dist/lambda/inbound-processor/.bundled +1 -1
  4. package/dist/lambda/sms-event-processor/.bundled +1 -1
  5. package/dist/selfhost-migrations/meta/0000_snapshot.json +1311 -0
  6. package/dist/selfhost-migrations/meta/0001_snapshot.json +1454 -0
  7. package/dist/selfhost-migrations/meta/0002_snapshot.json +1460 -0
  8. package/dist/selfhost-migrations/meta/0003_snapshot.json +1467 -0
  9. package/dist/selfhost-migrations/meta/0004_snapshot.json +1473 -0
  10. package/dist/selfhost-migrations/meta/0005_snapshot.json +1499 -0
  11. package/dist/selfhost-migrations/meta/0006_snapshot.json +1617 -0
  12. package/dist/selfhost-migrations/meta/0007_snapshot.json +2581 -0
  13. package/dist/selfhost-migrations/meta/0008_snapshot.json +2861 -0
  14. package/dist/selfhost-migrations/meta/0009_snapshot.json +3447 -0
  15. package/dist/selfhost-migrations/meta/0010_snapshot.json +3586 -0
  16. package/dist/selfhost-migrations/meta/0011_snapshot.json +3600 -0
  17. package/dist/selfhost-migrations/meta/0012_snapshot.json +3607 -0
  18. package/dist/selfhost-migrations/meta/0013_snapshot.json +4697 -0
  19. package/dist/selfhost-migrations/meta/0014_snapshot.json +4704 -0
  20. package/dist/selfhost-migrations/meta/0015_snapshot.json +4697 -0
  21. package/dist/selfhost-migrations/meta/0016_snapshot.json +4703 -0
  22. package/dist/selfhost-migrations/meta/0017_snapshot.json +4769 -0
  23. package/dist/selfhost-migrations/meta/0018_snapshot.json +4821 -0
  24. package/dist/selfhost-migrations/meta/0019_snapshot.json +4840 -0
  25. package/dist/selfhost-migrations/meta/0020_snapshot.json +5602 -0
  26. package/dist/selfhost-migrations/meta/0021_snapshot.json +5729 -0
  27. package/dist/selfhost-migrations/meta/0022_snapshot.json +5792 -0
  28. package/dist/selfhost-migrations/meta/0023_snapshot.json +5799 -0
  29. package/dist/selfhost-migrations/meta/0024_snapshot.json +5821 -0
  30. package/dist/selfhost-migrations/meta/0025_snapshot.json +5831 -0
  31. package/dist/selfhost-migrations/meta/0026_snapshot.json +5844 -0
  32. package/dist/selfhost-migrations/meta/0027_snapshot.json +5864 -0
  33. package/dist/selfhost-migrations/meta/0028_snapshot.json +5871 -0
  34. package/dist/selfhost-migrations/meta/0029_snapshot.json +5984 -0
  35. package/dist/selfhost-migrations/meta/0030_snapshot.json +5990 -0
  36. package/dist/selfhost-migrations/meta/0031_snapshot.json +5950 -0
  37. package/dist/selfhost-migrations/meta/0032_snapshot.json +6042 -0
  38. package/dist/selfhost-migrations/meta/0033_snapshot.json +6057 -0
  39. package/dist/selfhost-migrations/meta/0034_snapshot.json +6130 -0
  40. package/dist/selfhost-migrations/meta/0035_snapshot.json +6195 -0
  41. package/dist/selfhost-migrations/meta/0036_snapshot.json +6201 -0
  42. package/dist/selfhost-migrations/meta/0037_snapshot.json +6265 -0
  43. package/dist/selfhost-migrations/meta/0038_snapshot.json +6271 -0
  44. package/dist/selfhost-migrations/meta/0039_snapshot.json +6278 -0
  45. package/dist/selfhost-migrations/meta/0041_snapshot.json +6284 -0
  46. package/dist/selfhost-migrations/meta/0042_snapshot.json +6297 -0
  47. package/dist/selfhost-migrations/meta/0043_snapshot.json +6297 -0
  48. package/dist/selfhost-migrations/meta/0044_snapshot.json +6297 -0
  49. package/dist/selfhost-migrations/meta/0045_snapshot.json +6303 -0
  50. package/dist/selfhost-migrations/meta/0046_snapshot.json +6315 -0
  51. package/dist/selfhost-migrations/meta/0047_snapshot.json +6330 -0
  52. package/dist/selfhost-migrations/meta/0048_snapshot.json +6336 -0
  53. package/dist/selfhost-migrations/meta/0049_snapshot.json +6366 -0
  54. package/dist/selfhost-migrations/meta/0050_snapshot.json +6390 -0
  55. package/dist/selfhost-migrations/meta/0051_snapshot.json +6403 -0
  56. package/dist/selfhost-migrations/meta/0052_snapshot.json +6470 -0
  57. package/dist/selfhost-migrations/meta/0053_snapshot.json +6470 -0
  58. package/dist/selfhost-migrations/meta/0054_snapshot.json +6646 -0
  59. package/dist/selfhost-migrations/meta/0055_snapshot.json +6677 -0
  60. package/dist/selfhost-migrations/meta/0056_snapshot.json +6677 -0
  61. package/dist/selfhost-migrations/meta/0057_snapshot.json +6674 -0
  62. package/dist/selfhost-migrations/meta/_journal.json +412 -0
  63. package/package.json +3 -3
@@ -0,0 +1,4697 @@
1
+ {
2
+ "id": "bb7f8e01-4fda-4e54-abad-ea330bf88191",
3
+ "prevId": "f37c1022-3ada-489d-abf3-943303802f88",
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
+ "webhook_secret": {
303
+ "name": "webhook_secret",
304
+ "type": "text",
305
+ "primaryKey": false,
306
+ "notNull": false
307
+ },
308
+ "is_verified": {
309
+ "name": "is_verified",
310
+ "type": "boolean",
311
+ "primaryKey": false,
312
+ "notNull": true,
313
+ "default": false
314
+ },
315
+ "last_verified_at": {
316
+ "name": "last_verified_at",
317
+ "type": "timestamp",
318
+ "primaryKey": false,
319
+ "notNull": false
320
+ },
321
+ "archiving_enabled": {
322
+ "name": "archiving_enabled",
323
+ "type": "boolean",
324
+ "primaryKey": false,
325
+ "notNull": true,
326
+ "default": false
327
+ },
328
+ "archive_arn": {
329
+ "name": "archive_arn",
330
+ "type": "text",
331
+ "primaryKey": false,
332
+ "notNull": false
333
+ },
334
+ "event_history_enabled": {
335
+ "name": "event_history_enabled",
336
+ "type": "boolean",
337
+ "primaryKey": false,
338
+ "notNull": true,
339
+ "default": false
340
+ },
341
+ "event_tracking_enabled": {
342
+ "name": "event_tracking_enabled",
343
+ "type": "boolean",
344
+ "primaryKey": false,
345
+ "notNull": true,
346
+ "default": false
347
+ },
348
+ "config_set_name": {
349
+ "name": "config_set_name",
350
+ "type": "text",
351
+ "primaryKey": false,
352
+ "notNull": false
353
+ },
354
+ "custom_tracking_domain": {
355
+ "name": "custom_tracking_domain",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": false
359
+ },
360
+ "sms_enabled": {
361
+ "name": "sms_enabled",
362
+ "type": "boolean",
363
+ "primaryKey": false,
364
+ "notNull": true,
365
+ "default": false
366
+ },
367
+ "sms_phone_number_count": {
368
+ "name": "sms_phone_number_count",
369
+ "type": "integer",
370
+ "primaryKey": false,
371
+ "notNull": true,
372
+ "default": 0
373
+ },
374
+ "sms_event_history_enabled": {
375
+ "name": "sms_event_history_enabled",
376
+ "type": "boolean",
377
+ "primaryKey": false,
378
+ "notNull": true,
379
+ "default": false
380
+ },
381
+ "created_by": {
382
+ "name": "created_by",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": false
386
+ },
387
+ "created_at": {
388
+ "name": "created_at",
389
+ "type": "timestamp",
390
+ "primaryKey": false,
391
+ "notNull": true,
392
+ "default": "now()"
393
+ },
394
+ "updated_at": {
395
+ "name": "updated_at",
396
+ "type": "timestamp",
397
+ "primaryKey": false,
398
+ "notNull": true,
399
+ "default": "now()"
400
+ }
401
+ },
402
+ "indexes": {
403
+ "aws_account_org_idx": {
404
+ "name": "aws_account_org_idx",
405
+ "columns": [
406
+ {
407
+ "expression": "organization_id",
408
+ "isExpression": false,
409
+ "asc": true,
410
+ "nulls": "last"
411
+ }
412
+ ],
413
+ "isUnique": false,
414
+ "concurrently": false,
415
+ "method": "btree",
416
+ "with": {}
417
+ },
418
+ "aws_account_external_id_idx": {
419
+ "name": "aws_account_external_id_idx",
420
+ "columns": [
421
+ {
422
+ "expression": "external_id",
423
+ "isExpression": false,
424
+ "asc": true,
425
+ "nulls": "last"
426
+ }
427
+ ],
428
+ "isUnique": false,
429
+ "concurrently": false,
430
+ "method": "btree",
431
+ "with": {}
432
+ }
433
+ },
434
+ "foreignKeys": {
435
+ "aws_account_organization_id_organization_id_fk": {
436
+ "name": "aws_account_organization_id_organization_id_fk",
437
+ "tableFrom": "aws_account",
438
+ "tableTo": "organization",
439
+ "columnsFrom": ["organization_id"],
440
+ "columnsTo": ["id"],
441
+ "onDelete": "cascade",
442
+ "onUpdate": "no action"
443
+ },
444
+ "aws_account_created_by_user_id_fk": {
445
+ "name": "aws_account_created_by_user_id_fk",
446
+ "tableFrom": "aws_account",
447
+ "tableTo": "user",
448
+ "columnsFrom": ["created_by"],
449
+ "columnsTo": ["id"],
450
+ "onDelete": "no action",
451
+ "onUpdate": "no action"
452
+ }
453
+ },
454
+ "compositePrimaryKeys": {},
455
+ "uniqueConstraints": {
456
+ "aws_account_external_id_unique": {
457
+ "name": "aws_account_external_id_unique",
458
+ "nullsNotDistinct": false,
459
+ "columns": ["external_id"]
460
+ }
461
+ },
462
+ "policies": {},
463
+ "checkConstraints": {},
464
+ "isRLSEnabled": false
465
+ },
466
+ "public.aws_account_permission": {
467
+ "name": "aws_account_permission",
468
+ "schema": "",
469
+ "columns": {
470
+ "id": {
471
+ "name": "id",
472
+ "type": "text",
473
+ "primaryKey": true,
474
+ "notNull": true
475
+ },
476
+ "user_id": {
477
+ "name": "user_id",
478
+ "type": "text",
479
+ "primaryKey": false,
480
+ "notNull": true
481
+ },
482
+ "aws_account_id": {
483
+ "name": "aws_account_id",
484
+ "type": "text",
485
+ "primaryKey": false,
486
+ "notNull": true
487
+ },
488
+ "permissions": {
489
+ "name": "permissions",
490
+ "type": "json",
491
+ "primaryKey": false,
492
+ "notNull": true
493
+ },
494
+ "granted_by": {
495
+ "name": "granted_by",
496
+ "type": "text",
497
+ "primaryKey": false,
498
+ "notNull": true
499
+ },
500
+ "expires_at": {
501
+ "name": "expires_at",
502
+ "type": "timestamp",
503
+ "primaryKey": false,
504
+ "notNull": false
505
+ },
506
+ "created_at": {
507
+ "name": "created_at",
508
+ "type": "timestamp",
509
+ "primaryKey": false,
510
+ "notNull": true,
511
+ "default": "now()"
512
+ },
513
+ "updated_at": {
514
+ "name": "updated_at",
515
+ "type": "timestamp",
516
+ "primaryKey": false,
517
+ "notNull": true,
518
+ "default": "now()"
519
+ }
520
+ },
521
+ "indexes": {
522
+ "aws_account_permission_user_idx": {
523
+ "name": "aws_account_permission_user_idx",
524
+ "columns": [
525
+ {
526
+ "expression": "user_id",
527
+ "isExpression": false,
528
+ "asc": true,
529
+ "nulls": "last"
530
+ }
531
+ ],
532
+ "isUnique": false,
533
+ "concurrently": false,
534
+ "method": "btree",
535
+ "with": {}
536
+ },
537
+ "aws_account_permission_account_idx": {
538
+ "name": "aws_account_permission_account_idx",
539
+ "columns": [
540
+ {
541
+ "expression": "aws_account_id",
542
+ "isExpression": false,
543
+ "asc": true,
544
+ "nulls": "last"
545
+ }
546
+ ],
547
+ "isUnique": false,
548
+ "concurrently": false,
549
+ "method": "btree",
550
+ "with": {}
551
+ },
552
+ "aws_account_permission_unique_idx": {
553
+ "name": "aws_account_permission_unique_idx",
554
+ "columns": [
555
+ {
556
+ "expression": "user_id",
557
+ "isExpression": false,
558
+ "asc": true,
559
+ "nulls": "last"
560
+ },
561
+ {
562
+ "expression": "aws_account_id",
563
+ "isExpression": false,
564
+ "asc": true,
565
+ "nulls": "last"
566
+ }
567
+ ],
568
+ "isUnique": false,
569
+ "concurrently": false,
570
+ "method": "btree",
571
+ "with": {}
572
+ }
573
+ },
574
+ "foreignKeys": {
575
+ "aws_account_permission_user_id_user_id_fk": {
576
+ "name": "aws_account_permission_user_id_user_id_fk",
577
+ "tableFrom": "aws_account_permission",
578
+ "tableTo": "user",
579
+ "columnsFrom": ["user_id"],
580
+ "columnsTo": ["id"],
581
+ "onDelete": "cascade",
582
+ "onUpdate": "no action"
583
+ },
584
+ "aws_account_permission_aws_account_id_aws_account_id_fk": {
585
+ "name": "aws_account_permission_aws_account_id_aws_account_id_fk",
586
+ "tableFrom": "aws_account_permission",
587
+ "tableTo": "aws_account",
588
+ "columnsFrom": ["aws_account_id"],
589
+ "columnsTo": ["id"],
590
+ "onDelete": "cascade",
591
+ "onUpdate": "no action"
592
+ },
593
+ "aws_account_permission_granted_by_user_id_fk": {
594
+ "name": "aws_account_permission_granted_by_user_id_fk",
595
+ "tableFrom": "aws_account_permission",
596
+ "tableTo": "user",
597
+ "columnsFrom": ["granted_by"],
598
+ "columnsTo": ["id"],
599
+ "onDelete": "no action",
600
+ "onUpdate": "no action"
601
+ }
602
+ },
603
+ "compositePrimaryKeys": {},
604
+ "uniqueConstraints": {},
605
+ "policies": {},
606
+ "checkConstraints": {},
607
+ "isRLSEnabled": false
608
+ },
609
+ "public.email_template": {
610
+ "name": "email_template",
611
+ "schema": "",
612
+ "columns": {
613
+ "id": {
614
+ "name": "id",
615
+ "type": "text",
616
+ "primaryKey": true,
617
+ "notNull": true
618
+ },
619
+ "organization_id": {
620
+ "name": "organization_id",
621
+ "type": "text",
622
+ "primaryKey": false,
623
+ "notNull": true
624
+ },
625
+ "name": {
626
+ "name": "name",
627
+ "type": "text",
628
+ "primaryKey": false,
629
+ "notNull": true
630
+ },
631
+ "subject": {
632
+ "name": "subject",
633
+ "type": "text",
634
+ "primaryKey": false,
635
+ "notNull": false
636
+ },
637
+ "html": {
638
+ "name": "html",
639
+ "type": "text",
640
+ "primaryKey": false,
641
+ "notNull": false
642
+ },
643
+ "variables": {
644
+ "name": "variables",
645
+ "type": "json",
646
+ "primaryKey": false,
647
+ "notNull": false,
648
+ "default": "'[]'::json"
649
+ },
650
+ "created_by": {
651
+ "name": "created_by",
652
+ "type": "text",
653
+ "primaryKey": false,
654
+ "notNull": false
655
+ },
656
+ "created_at": {
657
+ "name": "created_at",
658
+ "type": "timestamp",
659
+ "primaryKey": false,
660
+ "notNull": true,
661
+ "default": "now()"
662
+ },
663
+ "updated_at": {
664
+ "name": "updated_at",
665
+ "type": "timestamp",
666
+ "primaryKey": false,
667
+ "notNull": true,
668
+ "default": "now()"
669
+ }
670
+ },
671
+ "indexes": {
672
+ "email_template_org_idx": {
673
+ "name": "email_template_org_idx",
674
+ "columns": [
675
+ {
676
+ "expression": "organization_id",
677
+ "isExpression": false,
678
+ "asc": true,
679
+ "nulls": "last"
680
+ }
681
+ ],
682
+ "isUnique": false,
683
+ "concurrently": false,
684
+ "method": "btree",
685
+ "with": {}
686
+ }
687
+ },
688
+ "foreignKeys": {
689
+ "email_template_organization_id_organization_id_fk": {
690
+ "name": "email_template_organization_id_organization_id_fk",
691
+ "tableFrom": "email_template",
692
+ "tableTo": "organization",
693
+ "columnsFrom": ["organization_id"],
694
+ "columnsTo": ["id"],
695
+ "onDelete": "cascade",
696
+ "onUpdate": "no action"
697
+ },
698
+ "email_template_created_by_user_id_fk": {
699
+ "name": "email_template_created_by_user_id_fk",
700
+ "tableFrom": "email_template",
701
+ "tableTo": "user",
702
+ "columnsFrom": ["created_by"],
703
+ "columnsTo": ["id"],
704
+ "onDelete": "no action",
705
+ "onUpdate": "no action"
706
+ }
707
+ },
708
+ "compositePrimaryKeys": {},
709
+ "uniqueConstraints": {},
710
+ "policies": {},
711
+ "checkConstraints": {},
712
+ "isRLSEnabled": false
713
+ },
714
+ "public.organization_extension": {
715
+ "name": "organization_extension",
716
+ "schema": "",
717
+ "columns": {
718
+ "organization_id": {
719
+ "name": "organization_id",
720
+ "type": "text",
721
+ "primaryKey": true,
722
+ "notNull": true
723
+ },
724
+ "aws_account_count": {
725
+ "name": "aws_account_count",
726
+ "type": "integer",
727
+ "primaryKey": false,
728
+ "notNull": true,
729
+ "default": 0
730
+ },
731
+ "member_count": {
732
+ "name": "member_count",
733
+ "type": "integer",
734
+ "primaryKey": false,
735
+ "notNull": true,
736
+ "default": 1
737
+ },
738
+ "onboarding_completed": {
739
+ "name": "onboarding_completed",
740
+ "type": "boolean",
741
+ "primaryKey": false,
742
+ "notNull": true,
743
+ "default": false
744
+ },
745
+ "onboarding_completed_at": {
746
+ "name": "onboarding_completed_at",
747
+ "type": "timestamp",
748
+ "primaryKey": false,
749
+ "notNull": false
750
+ },
751
+ "updated_at": {
752
+ "name": "updated_at",
753
+ "type": "timestamp",
754
+ "primaryKey": false,
755
+ "notNull": true,
756
+ "default": "now()"
757
+ }
758
+ },
759
+ "indexes": {},
760
+ "foreignKeys": {
761
+ "organization_extension_organization_id_organization_id_fk": {
762
+ "name": "organization_extension_organization_id_organization_id_fk",
763
+ "tableFrom": "organization_extension",
764
+ "tableTo": "organization",
765
+ "columnsFrom": ["organization_id"],
766
+ "columnsTo": ["id"],
767
+ "onDelete": "cascade",
768
+ "onUpdate": "no action"
769
+ }
770
+ },
771
+ "compositePrimaryKeys": {},
772
+ "uniqueConstraints": {},
773
+ "policies": {},
774
+ "checkConstraints": {},
775
+ "isRLSEnabled": false
776
+ },
777
+ "public.account": {
778
+ "name": "account",
779
+ "schema": "",
780
+ "columns": {
781
+ "id": {
782
+ "name": "id",
783
+ "type": "text",
784
+ "primaryKey": true,
785
+ "notNull": true
786
+ },
787
+ "account_id": {
788
+ "name": "account_id",
789
+ "type": "text",
790
+ "primaryKey": false,
791
+ "notNull": true
792
+ },
793
+ "provider_id": {
794
+ "name": "provider_id",
795
+ "type": "text",
796
+ "primaryKey": false,
797
+ "notNull": true
798
+ },
799
+ "user_id": {
800
+ "name": "user_id",
801
+ "type": "text",
802
+ "primaryKey": false,
803
+ "notNull": true
804
+ },
805
+ "access_token": {
806
+ "name": "access_token",
807
+ "type": "text",
808
+ "primaryKey": false,
809
+ "notNull": false
810
+ },
811
+ "refresh_token": {
812
+ "name": "refresh_token",
813
+ "type": "text",
814
+ "primaryKey": false,
815
+ "notNull": false
816
+ },
817
+ "id_token": {
818
+ "name": "id_token",
819
+ "type": "text",
820
+ "primaryKey": false,
821
+ "notNull": false
822
+ },
823
+ "access_token_expires_at": {
824
+ "name": "access_token_expires_at",
825
+ "type": "timestamp",
826
+ "primaryKey": false,
827
+ "notNull": false
828
+ },
829
+ "refresh_token_expires_at": {
830
+ "name": "refresh_token_expires_at",
831
+ "type": "timestamp",
832
+ "primaryKey": false,
833
+ "notNull": false
834
+ },
835
+ "scope": {
836
+ "name": "scope",
837
+ "type": "text",
838
+ "primaryKey": false,
839
+ "notNull": false
840
+ },
841
+ "password": {
842
+ "name": "password",
843
+ "type": "text",
844
+ "primaryKey": false,
845
+ "notNull": false
846
+ },
847
+ "created_at": {
848
+ "name": "created_at",
849
+ "type": "timestamp",
850
+ "primaryKey": false,
851
+ "notNull": true
852
+ },
853
+ "updated_at": {
854
+ "name": "updated_at",
855
+ "type": "timestamp",
856
+ "primaryKey": false,
857
+ "notNull": true
858
+ }
859
+ },
860
+ "indexes": {},
861
+ "foreignKeys": {
862
+ "account_user_id_user_id_fk": {
863
+ "name": "account_user_id_user_id_fk",
864
+ "tableFrom": "account",
865
+ "tableTo": "user",
866
+ "columnsFrom": ["user_id"],
867
+ "columnsTo": ["id"],
868
+ "onDelete": "cascade",
869
+ "onUpdate": "no action"
870
+ }
871
+ },
872
+ "compositePrimaryKeys": {},
873
+ "uniqueConstraints": {},
874
+ "policies": {},
875
+ "checkConstraints": {},
876
+ "isRLSEnabled": false
877
+ },
878
+ "public.invitation": {
879
+ "name": "invitation",
880
+ "schema": "",
881
+ "columns": {
882
+ "id": {
883
+ "name": "id",
884
+ "type": "text",
885
+ "primaryKey": true,
886
+ "notNull": true
887
+ },
888
+ "organization_id": {
889
+ "name": "organization_id",
890
+ "type": "text",
891
+ "primaryKey": false,
892
+ "notNull": true
893
+ },
894
+ "email": {
895
+ "name": "email",
896
+ "type": "text",
897
+ "primaryKey": false,
898
+ "notNull": true
899
+ },
900
+ "role": {
901
+ "name": "role",
902
+ "type": "text",
903
+ "primaryKey": false,
904
+ "notNull": false
905
+ },
906
+ "status": {
907
+ "name": "status",
908
+ "type": "text",
909
+ "primaryKey": false,
910
+ "notNull": true
911
+ },
912
+ "expires_at": {
913
+ "name": "expires_at",
914
+ "type": "timestamp",
915
+ "primaryKey": false,
916
+ "notNull": true
917
+ },
918
+ "inviter_id": {
919
+ "name": "inviter_id",
920
+ "type": "text",
921
+ "primaryKey": false,
922
+ "notNull": true
923
+ }
924
+ },
925
+ "indexes": {},
926
+ "foreignKeys": {
927
+ "invitation_organization_id_organization_id_fk": {
928
+ "name": "invitation_organization_id_organization_id_fk",
929
+ "tableFrom": "invitation",
930
+ "tableTo": "organization",
931
+ "columnsFrom": ["organization_id"],
932
+ "columnsTo": ["id"],
933
+ "onDelete": "cascade",
934
+ "onUpdate": "no action"
935
+ },
936
+ "invitation_inviter_id_user_id_fk": {
937
+ "name": "invitation_inviter_id_user_id_fk",
938
+ "tableFrom": "invitation",
939
+ "tableTo": "user",
940
+ "columnsFrom": ["inviter_id"],
941
+ "columnsTo": ["id"],
942
+ "onDelete": "cascade",
943
+ "onUpdate": "no action"
944
+ }
945
+ },
946
+ "compositePrimaryKeys": {},
947
+ "uniqueConstraints": {},
948
+ "policies": {},
949
+ "checkConstraints": {},
950
+ "isRLSEnabled": false
951
+ },
952
+ "public.member": {
953
+ "name": "member",
954
+ "schema": "",
955
+ "columns": {
956
+ "id": {
957
+ "name": "id",
958
+ "type": "text",
959
+ "primaryKey": true,
960
+ "notNull": true
961
+ },
962
+ "organization_id": {
963
+ "name": "organization_id",
964
+ "type": "text",
965
+ "primaryKey": false,
966
+ "notNull": true
967
+ },
968
+ "user_id": {
969
+ "name": "user_id",
970
+ "type": "text",
971
+ "primaryKey": false,
972
+ "notNull": true
973
+ },
974
+ "role": {
975
+ "name": "role",
976
+ "type": "text",
977
+ "primaryKey": false,
978
+ "notNull": true
979
+ },
980
+ "created_at": {
981
+ "name": "created_at",
982
+ "type": "timestamp",
983
+ "primaryKey": false,
984
+ "notNull": true
985
+ }
986
+ },
987
+ "indexes": {},
988
+ "foreignKeys": {
989
+ "member_organization_id_organization_id_fk": {
990
+ "name": "member_organization_id_organization_id_fk",
991
+ "tableFrom": "member",
992
+ "tableTo": "organization",
993
+ "columnsFrom": ["organization_id"],
994
+ "columnsTo": ["id"],
995
+ "onDelete": "cascade",
996
+ "onUpdate": "no action"
997
+ },
998
+ "member_user_id_user_id_fk": {
999
+ "name": "member_user_id_user_id_fk",
1000
+ "tableFrom": "member",
1001
+ "tableTo": "user",
1002
+ "columnsFrom": ["user_id"],
1003
+ "columnsTo": ["id"],
1004
+ "onDelete": "cascade",
1005
+ "onUpdate": "no action"
1006
+ }
1007
+ },
1008
+ "compositePrimaryKeys": {},
1009
+ "uniqueConstraints": {},
1010
+ "policies": {},
1011
+ "checkConstraints": {},
1012
+ "isRLSEnabled": false
1013
+ },
1014
+ "public.organization": {
1015
+ "name": "organization",
1016
+ "schema": "",
1017
+ "columns": {
1018
+ "id": {
1019
+ "name": "id",
1020
+ "type": "text",
1021
+ "primaryKey": true,
1022
+ "notNull": true
1023
+ },
1024
+ "name": {
1025
+ "name": "name",
1026
+ "type": "text",
1027
+ "primaryKey": false,
1028
+ "notNull": true
1029
+ },
1030
+ "slug": {
1031
+ "name": "slug",
1032
+ "type": "text",
1033
+ "primaryKey": false,
1034
+ "notNull": false
1035
+ },
1036
+ "logo": {
1037
+ "name": "logo",
1038
+ "type": "text",
1039
+ "primaryKey": false,
1040
+ "notNull": false
1041
+ },
1042
+ "metadata": {
1043
+ "name": "metadata",
1044
+ "type": "text",
1045
+ "primaryKey": false,
1046
+ "notNull": false
1047
+ },
1048
+ "created_at": {
1049
+ "name": "created_at",
1050
+ "type": "timestamp",
1051
+ "primaryKey": false,
1052
+ "notNull": true
1053
+ }
1054
+ },
1055
+ "indexes": {},
1056
+ "foreignKeys": {},
1057
+ "compositePrimaryKeys": {},
1058
+ "uniqueConstraints": {
1059
+ "organization_slug_unique": {
1060
+ "name": "organization_slug_unique",
1061
+ "nullsNotDistinct": false,
1062
+ "columns": ["slug"]
1063
+ }
1064
+ },
1065
+ "policies": {},
1066
+ "checkConstraints": {},
1067
+ "isRLSEnabled": false
1068
+ },
1069
+ "public.passkey": {
1070
+ "name": "passkey",
1071
+ "schema": "",
1072
+ "columns": {
1073
+ "id": {
1074
+ "name": "id",
1075
+ "type": "text",
1076
+ "primaryKey": true,
1077
+ "notNull": true
1078
+ },
1079
+ "name": {
1080
+ "name": "name",
1081
+ "type": "text",
1082
+ "primaryKey": false,
1083
+ "notNull": false
1084
+ },
1085
+ "public_key": {
1086
+ "name": "public_key",
1087
+ "type": "text",
1088
+ "primaryKey": false,
1089
+ "notNull": true
1090
+ },
1091
+ "user_id": {
1092
+ "name": "user_id",
1093
+ "type": "text",
1094
+ "primaryKey": false,
1095
+ "notNull": true
1096
+ },
1097
+ "credential_id": {
1098
+ "name": "credential_id",
1099
+ "type": "text",
1100
+ "primaryKey": false,
1101
+ "notNull": true
1102
+ },
1103
+ "counter": {
1104
+ "name": "counter",
1105
+ "type": "integer",
1106
+ "primaryKey": false,
1107
+ "notNull": true
1108
+ },
1109
+ "device_type": {
1110
+ "name": "device_type",
1111
+ "type": "text",
1112
+ "primaryKey": false,
1113
+ "notNull": true
1114
+ },
1115
+ "backed_up": {
1116
+ "name": "backed_up",
1117
+ "type": "boolean",
1118
+ "primaryKey": false,
1119
+ "notNull": true
1120
+ },
1121
+ "transports": {
1122
+ "name": "transports",
1123
+ "type": "text",
1124
+ "primaryKey": false,
1125
+ "notNull": false
1126
+ },
1127
+ "created_at": {
1128
+ "name": "created_at",
1129
+ "type": "timestamp",
1130
+ "primaryKey": false,
1131
+ "notNull": true
1132
+ },
1133
+ "aaguid": {
1134
+ "name": "aaguid",
1135
+ "type": "text",
1136
+ "primaryKey": false,
1137
+ "notNull": false
1138
+ }
1139
+ },
1140
+ "indexes": {},
1141
+ "foreignKeys": {
1142
+ "passkey_user_id_user_id_fk": {
1143
+ "name": "passkey_user_id_user_id_fk",
1144
+ "tableFrom": "passkey",
1145
+ "tableTo": "user",
1146
+ "columnsFrom": ["user_id"],
1147
+ "columnsTo": ["id"],
1148
+ "onDelete": "cascade",
1149
+ "onUpdate": "no action"
1150
+ }
1151
+ },
1152
+ "compositePrimaryKeys": {},
1153
+ "uniqueConstraints": {},
1154
+ "policies": {},
1155
+ "checkConstraints": {},
1156
+ "isRLSEnabled": false
1157
+ },
1158
+ "public.session": {
1159
+ "name": "session",
1160
+ "schema": "",
1161
+ "columns": {
1162
+ "id": {
1163
+ "name": "id",
1164
+ "type": "text",
1165
+ "primaryKey": true,
1166
+ "notNull": true
1167
+ },
1168
+ "expires_at": {
1169
+ "name": "expires_at",
1170
+ "type": "timestamp",
1171
+ "primaryKey": false,
1172
+ "notNull": true
1173
+ },
1174
+ "token": {
1175
+ "name": "token",
1176
+ "type": "text",
1177
+ "primaryKey": false,
1178
+ "notNull": true
1179
+ },
1180
+ "created_at": {
1181
+ "name": "created_at",
1182
+ "type": "timestamp",
1183
+ "primaryKey": false,
1184
+ "notNull": true
1185
+ },
1186
+ "updated_at": {
1187
+ "name": "updated_at",
1188
+ "type": "timestamp",
1189
+ "primaryKey": false,
1190
+ "notNull": true
1191
+ },
1192
+ "ip_address": {
1193
+ "name": "ip_address",
1194
+ "type": "text",
1195
+ "primaryKey": false,
1196
+ "notNull": false
1197
+ },
1198
+ "user_agent": {
1199
+ "name": "user_agent",
1200
+ "type": "text",
1201
+ "primaryKey": false,
1202
+ "notNull": false
1203
+ },
1204
+ "user_id": {
1205
+ "name": "user_id",
1206
+ "type": "text",
1207
+ "primaryKey": false,
1208
+ "notNull": true
1209
+ },
1210
+ "active_organization_id": {
1211
+ "name": "active_organization_id",
1212
+ "type": "text",
1213
+ "primaryKey": false,
1214
+ "notNull": false
1215
+ }
1216
+ },
1217
+ "indexes": {},
1218
+ "foreignKeys": {
1219
+ "session_user_id_user_id_fk": {
1220
+ "name": "session_user_id_user_id_fk",
1221
+ "tableFrom": "session",
1222
+ "tableTo": "user",
1223
+ "columnsFrom": ["user_id"],
1224
+ "columnsTo": ["id"],
1225
+ "onDelete": "cascade",
1226
+ "onUpdate": "no action"
1227
+ }
1228
+ },
1229
+ "compositePrimaryKeys": {},
1230
+ "uniqueConstraints": {
1231
+ "session_token_unique": {
1232
+ "name": "session_token_unique",
1233
+ "nullsNotDistinct": false,
1234
+ "columns": ["token"]
1235
+ }
1236
+ },
1237
+ "policies": {},
1238
+ "checkConstraints": {},
1239
+ "isRLSEnabled": false
1240
+ },
1241
+ "public.statement": {
1242
+ "name": "statement",
1243
+ "schema": "",
1244
+ "columns": {
1245
+ "id": {
1246
+ "name": "id",
1247
+ "type": "text",
1248
+ "primaryKey": true,
1249
+ "notNull": true
1250
+ },
1251
+ "user_id": {
1252
+ "name": "user_id",
1253
+ "type": "text",
1254
+ "primaryKey": false,
1255
+ "notNull": false
1256
+ },
1257
+ "organization_id": {
1258
+ "name": "organization_id",
1259
+ "type": "text",
1260
+ "primaryKey": false,
1261
+ "notNull": false
1262
+ },
1263
+ "role_id": {
1264
+ "name": "role_id",
1265
+ "type": "text",
1266
+ "primaryKey": false,
1267
+ "notNull": false
1268
+ },
1269
+ "effect": {
1270
+ "name": "effect",
1271
+ "type": "text",
1272
+ "primaryKey": false,
1273
+ "notNull": true
1274
+ },
1275
+ "action": {
1276
+ "name": "action",
1277
+ "type": "text",
1278
+ "primaryKey": false,
1279
+ "notNull": true
1280
+ },
1281
+ "resource": {
1282
+ "name": "resource",
1283
+ "type": "text",
1284
+ "primaryKey": false,
1285
+ "notNull": true
1286
+ },
1287
+ "condition": {
1288
+ "name": "condition",
1289
+ "type": "text",
1290
+ "primaryKey": false,
1291
+ "notNull": false
1292
+ },
1293
+ "expires_at": {
1294
+ "name": "expires_at",
1295
+ "type": "timestamp",
1296
+ "primaryKey": false,
1297
+ "notNull": false
1298
+ },
1299
+ "created_at": {
1300
+ "name": "created_at",
1301
+ "type": "timestamp",
1302
+ "primaryKey": false,
1303
+ "notNull": true
1304
+ },
1305
+ "updated_at": {
1306
+ "name": "updated_at",
1307
+ "type": "timestamp",
1308
+ "primaryKey": false,
1309
+ "notNull": true
1310
+ }
1311
+ },
1312
+ "indexes": {},
1313
+ "foreignKeys": {
1314
+ "statement_user_id_user_id_fk": {
1315
+ "name": "statement_user_id_user_id_fk",
1316
+ "tableFrom": "statement",
1317
+ "tableTo": "user",
1318
+ "columnsFrom": ["user_id"],
1319
+ "columnsTo": ["id"],
1320
+ "onDelete": "cascade",
1321
+ "onUpdate": "no action"
1322
+ },
1323
+ "statement_organization_id_organization_id_fk": {
1324
+ "name": "statement_organization_id_organization_id_fk",
1325
+ "tableFrom": "statement",
1326
+ "tableTo": "organization",
1327
+ "columnsFrom": ["organization_id"],
1328
+ "columnsTo": ["id"],
1329
+ "onDelete": "cascade",
1330
+ "onUpdate": "no action"
1331
+ }
1332
+ },
1333
+ "compositePrimaryKeys": {},
1334
+ "uniqueConstraints": {},
1335
+ "policies": {},
1336
+ "checkConstraints": {},
1337
+ "isRLSEnabled": false
1338
+ },
1339
+ "public.subscription": {
1340
+ "name": "subscription",
1341
+ "schema": "",
1342
+ "columns": {
1343
+ "id": {
1344
+ "name": "id",
1345
+ "type": "text",
1346
+ "primaryKey": true,
1347
+ "notNull": true
1348
+ },
1349
+ "plan": {
1350
+ "name": "plan",
1351
+ "type": "text",
1352
+ "primaryKey": false,
1353
+ "notNull": true
1354
+ },
1355
+ "reference_id": {
1356
+ "name": "reference_id",
1357
+ "type": "text",
1358
+ "primaryKey": false,
1359
+ "notNull": true
1360
+ },
1361
+ "stripe_customer_id": {
1362
+ "name": "stripe_customer_id",
1363
+ "type": "text",
1364
+ "primaryKey": false,
1365
+ "notNull": false
1366
+ },
1367
+ "stripe_subscription_id": {
1368
+ "name": "stripe_subscription_id",
1369
+ "type": "text",
1370
+ "primaryKey": false,
1371
+ "notNull": false
1372
+ },
1373
+ "status": {
1374
+ "name": "status",
1375
+ "type": "text",
1376
+ "primaryKey": false,
1377
+ "notNull": true
1378
+ },
1379
+ "period_start": {
1380
+ "name": "period_start",
1381
+ "type": "timestamp",
1382
+ "primaryKey": false,
1383
+ "notNull": false
1384
+ },
1385
+ "period_end": {
1386
+ "name": "period_end",
1387
+ "type": "timestamp",
1388
+ "primaryKey": false,
1389
+ "notNull": false
1390
+ },
1391
+ "cancel_at_period_end": {
1392
+ "name": "cancel_at_period_end",
1393
+ "type": "boolean",
1394
+ "primaryKey": false,
1395
+ "notNull": false
1396
+ },
1397
+ "seats": {
1398
+ "name": "seats",
1399
+ "type": "integer",
1400
+ "primaryKey": false,
1401
+ "notNull": false
1402
+ },
1403
+ "trial_start": {
1404
+ "name": "trial_start",
1405
+ "type": "timestamp",
1406
+ "primaryKey": false,
1407
+ "notNull": false
1408
+ },
1409
+ "trial_end": {
1410
+ "name": "trial_end",
1411
+ "type": "timestamp",
1412
+ "primaryKey": false,
1413
+ "notNull": false
1414
+ },
1415
+ "created_at": {
1416
+ "name": "created_at",
1417
+ "type": "timestamp",
1418
+ "primaryKey": false,
1419
+ "notNull": true,
1420
+ "default": "now()"
1421
+ },
1422
+ "updated_at": {
1423
+ "name": "updated_at",
1424
+ "type": "timestamp",
1425
+ "primaryKey": false,
1426
+ "notNull": true,
1427
+ "default": "now()"
1428
+ }
1429
+ },
1430
+ "indexes": {},
1431
+ "foreignKeys": {},
1432
+ "compositePrimaryKeys": {},
1433
+ "uniqueConstraints": {},
1434
+ "policies": {},
1435
+ "checkConstraints": {},
1436
+ "isRLSEnabled": false
1437
+ },
1438
+ "public.two_factor": {
1439
+ "name": "two_factor",
1440
+ "schema": "",
1441
+ "columns": {
1442
+ "id": {
1443
+ "name": "id",
1444
+ "type": "text",
1445
+ "primaryKey": true,
1446
+ "notNull": true
1447
+ },
1448
+ "secret": {
1449
+ "name": "secret",
1450
+ "type": "text",
1451
+ "primaryKey": false,
1452
+ "notNull": true
1453
+ },
1454
+ "backup_codes": {
1455
+ "name": "backup_codes",
1456
+ "type": "text",
1457
+ "primaryKey": false,
1458
+ "notNull": true
1459
+ },
1460
+ "user_id": {
1461
+ "name": "user_id",
1462
+ "type": "text",
1463
+ "primaryKey": false,
1464
+ "notNull": true
1465
+ }
1466
+ },
1467
+ "indexes": {},
1468
+ "foreignKeys": {
1469
+ "two_factor_user_id_user_id_fk": {
1470
+ "name": "two_factor_user_id_user_id_fk",
1471
+ "tableFrom": "two_factor",
1472
+ "tableTo": "user",
1473
+ "columnsFrom": ["user_id"],
1474
+ "columnsTo": ["id"],
1475
+ "onDelete": "cascade",
1476
+ "onUpdate": "no action"
1477
+ }
1478
+ },
1479
+ "compositePrimaryKeys": {},
1480
+ "uniqueConstraints": {},
1481
+ "policies": {},
1482
+ "checkConstraints": {},
1483
+ "isRLSEnabled": false
1484
+ },
1485
+ "public.user": {
1486
+ "name": "user",
1487
+ "schema": "",
1488
+ "columns": {
1489
+ "id": {
1490
+ "name": "id",
1491
+ "type": "text",
1492
+ "primaryKey": true,
1493
+ "notNull": true
1494
+ },
1495
+ "name": {
1496
+ "name": "name",
1497
+ "type": "text",
1498
+ "primaryKey": false,
1499
+ "notNull": true
1500
+ },
1501
+ "email": {
1502
+ "name": "email",
1503
+ "type": "text",
1504
+ "primaryKey": false,
1505
+ "notNull": true
1506
+ },
1507
+ "email_verified": {
1508
+ "name": "email_verified",
1509
+ "type": "boolean",
1510
+ "primaryKey": false,
1511
+ "notNull": true
1512
+ },
1513
+ "image": {
1514
+ "name": "image",
1515
+ "type": "text",
1516
+ "primaryKey": false,
1517
+ "notNull": false
1518
+ },
1519
+ "created_at": {
1520
+ "name": "created_at",
1521
+ "type": "timestamp",
1522
+ "primaryKey": false,
1523
+ "notNull": true
1524
+ },
1525
+ "updated_at": {
1526
+ "name": "updated_at",
1527
+ "type": "timestamp",
1528
+ "primaryKey": false,
1529
+ "notNull": true
1530
+ },
1531
+ "two_factor_enabled": {
1532
+ "name": "two_factor_enabled",
1533
+ "type": "boolean",
1534
+ "primaryKey": false,
1535
+ "notNull": false
1536
+ },
1537
+ "last_login_method": {
1538
+ "name": "last_login_method",
1539
+ "type": "text",
1540
+ "primaryKey": false,
1541
+ "notNull": false
1542
+ },
1543
+ "stripe_customer_id": {
1544
+ "name": "stripe_customer_id",
1545
+ "type": "text",
1546
+ "primaryKey": false,
1547
+ "notNull": false
1548
+ }
1549
+ },
1550
+ "indexes": {},
1551
+ "foreignKeys": {},
1552
+ "compositePrimaryKeys": {},
1553
+ "uniqueConstraints": {
1554
+ "user_email_unique": {
1555
+ "name": "user_email_unique",
1556
+ "nullsNotDistinct": false,
1557
+ "columns": ["email"]
1558
+ }
1559
+ },
1560
+ "policies": {},
1561
+ "checkConstraints": {},
1562
+ "isRLSEnabled": false
1563
+ },
1564
+ "public.verification": {
1565
+ "name": "verification",
1566
+ "schema": "",
1567
+ "columns": {
1568
+ "id": {
1569
+ "name": "id",
1570
+ "type": "text",
1571
+ "primaryKey": true,
1572
+ "notNull": true
1573
+ },
1574
+ "identifier": {
1575
+ "name": "identifier",
1576
+ "type": "text",
1577
+ "primaryKey": false,
1578
+ "notNull": true
1579
+ },
1580
+ "value": {
1581
+ "name": "value",
1582
+ "type": "text",
1583
+ "primaryKey": false,
1584
+ "notNull": true
1585
+ },
1586
+ "expires_at": {
1587
+ "name": "expires_at",
1588
+ "type": "timestamp",
1589
+ "primaryKey": false,
1590
+ "notNull": true
1591
+ },
1592
+ "created_at": {
1593
+ "name": "created_at",
1594
+ "type": "timestamp",
1595
+ "primaryKey": false,
1596
+ "notNull": false
1597
+ },
1598
+ "updated_at": {
1599
+ "name": "updated_at",
1600
+ "type": "timestamp",
1601
+ "primaryKey": false,
1602
+ "notNull": false
1603
+ }
1604
+ },
1605
+ "indexes": {},
1606
+ "foreignKeys": {},
1607
+ "compositePrimaryKeys": {},
1608
+ "uniqueConstraints": {},
1609
+ "policies": {},
1610
+ "checkConstraints": {},
1611
+ "isRLSEnabled": false
1612
+ },
1613
+ "public.batch_send": {
1614
+ "name": "batch_send",
1615
+ "schema": "",
1616
+ "columns": {
1617
+ "id": {
1618
+ "name": "id",
1619
+ "type": "text",
1620
+ "primaryKey": true,
1621
+ "notNull": true
1622
+ },
1623
+ "organization_id": {
1624
+ "name": "organization_id",
1625
+ "type": "text",
1626
+ "primaryKey": false,
1627
+ "notNull": true
1628
+ },
1629
+ "aws_account_id": {
1630
+ "name": "aws_account_id",
1631
+ "type": "text",
1632
+ "primaryKey": false,
1633
+ "notNull": false
1634
+ },
1635
+ "name": {
1636
+ "name": "name",
1637
+ "type": "text",
1638
+ "primaryKey": false,
1639
+ "notNull": false
1640
+ },
1641
+ "channel": {
1642
+ "name": "channel",
1643
+ "type": "text",
1644
+ "primaryKey": false,
1645
+ "notNull": true,
1646
+ "default": "'email'"
1647
+ },
1648
+ "subject": {
1649
+ "name": "subject",
1650
+ "type": "text",
1651
+ "primaryKey": false,
1652
+ "notNull": false
1653
+ },
1654
+ "preview_text": {
1655
+ "name": "preview_text",
1656
+ "type": "text",
1657
+ "primaryKey": false,
1658
+ "notNull": false
1659
+ },
1660
+ "from": {
1661
+ "name": "from",
1662
+ "type": "text",
1663
+ "primaryKey": false,
1664
+ "notNull": false
1665
+ },
1666
+ "from_name": {
1667
+ "name": "from_name",
1668
+ "type": "text",
1669
+ "primaryKey": false,
1670
+ "notNull": false
1671
+ },
1672
+ "reply_to": {
1673
+ "name": "reply_to",
1674
+ "type": "text",
1675
+ "primaryKey": false,
1676
+ "notNull": false
1677
+ },
1678
+ "email_template_id": {
1679
+ "name": "email_template_id",
1680
+ "type": "text",
1681
+ "primaryKey": false,
1682
+ "notNull": false
1683
+ },
1684
+ "html_content": {
1685
+ "name": "html_content",
1686
+ "type": "text",
1687
+ "primaryKey": false,
1688
+ "notNull": false
1689
+ },
1690
+ "text_content": {
1691
+ "name": "text_content",
1692
+ "type": "text",
1693
+ "primaryKey": false,
1694
+ "notNull": false
1695
+ },
1696
+ "body": {
1697
+ "name": "body",
1698
+ "type": "text",
1699
+ "primaryKey": false,
1700
+ "notNull": false
1701
+ },
1702
+ "sender_id": {
1703
+ "name": "sender_id",
1704
+ "type": "text",
1705
+ "primaryKey": false,
1706
+ "notNull": false
1707
+ },
1708
+ "status": {
1709
+ "name": "status",
1710
+ "type": "batch_send_status",
1711
+ "typeSchema": "public",
1712
+ "primaryKey": false,
1713
+ "notNull": true,
1714
+ "default": "'draft'"
1715
+ },
1716
+ "total_recipients": {
1717
+ "name": "total_recipients",
1718
+ "type": "integer",
1719
+ "primaryKey": false,
1720
+ "notNull": true,
1721
+ "default": 0
1722
+ },
1723
+ "processed_recipients": {
1724
+ "name": "processed_recipients",
1725
+ "type": "integer",
1726
+ "primaryKey": false,
1727
+ "notNull": true,
1728
+ "default": 0
1729
+ },
1730
+ "sent": {
1731
+ "name": "sent",
1732
+ "type": "integer",
1733
+ "primaryKey": false,
1734
+ "notNull": true,
1735
+ "default": 0
1736
+ },
1737
+ "delivered": {
1738
+ "name": "delivered",
1739
+ "type": "integer",
1740
+ "primaryKey": false,
1741
+ "notNull": true,
1742
+ "default": 0
1743
+ },
1744
+ "failed": {
1745
+ "name": "failed",
1746
+ "type": "integer",
1747
+ "primaryKey": false,
1748
+ "notNull": true,
1749
+ "default": 0
1750
+ },
1751
+ "opened": {
1752
+ "name": "opened",
1753
+ "type": "integer",
1754
+ "primaryKey": false,
1755
+ "notNull": true,
1756
+ "default": 0
1757
+ },
1758
+ "clicked": {
1759
+ "name": "clicked",
1760
+ "type": "integer",
1761
+ "primaryKey": false,
1762
+ "notNull": true,
1763
+ "default": 0
1764
+ },
1765
+ "bounced": {
1766
+ "name": "bounced",
1767
+ "type": "integer",
1768
+ "primaryKey": false,
1769
+ "notNull": true,
1770
+ "default": 0
1771
+ },
1772
+ "complained": {
1773
+ "name": "complained",
1774
+ "type": "integer",
1775
+ "primaryKey": false,
1776
+ "notNull": true,
1777
+ "default": 0
1778
+ },
1779
+ "sms_segments": {
1780
+ "name": "sms_segments",
1781
+ "type": "integer",
1782
+ "primaryKey": false,
1783
+ "notNull": true,
1784
+ "default": 0
1785
+ },
1786
+ "sms_opted_out": {
1787
+ "name": "sms_opted_out",
1788
+ "type": "integer",
1789
+ "primaryKey": false,
1790
+ "notNull": true,
1791
+ "default": 0
1792
+ },
1793
+ "error_message": {
1794
+ "name": "error_message",
1795
+ "type": "text",
1796
+ "primaryKey": false,
1797
+ "notNull": false
1798
+ },
1799
+ "error_details": {
1800
+ "name": "error_details",
1801
+ "type": "json",
1802
+ "primaryKey": false,
1803
+ "notNull": false
1804
+ },
1805
+ "scheduled_for": {
1806
+ "name": "scheduled_for",
1807
+ "type": "timestamp",
1808
+ "primaryKey": false,
1809
+ "notNull": false
1810
+ },
1811
+ "started_at": {
1812
+ "name": "started_at",
1813
+ "type": "timestamp",
1814
+ "primaryKey": false,
1815
+ "notNull": false
1816
+ },
1817
+ "completed_at": {
1818
+ "name": "completed_at",
1819
+ "type": "timestamp",
1820
+ "primaryKey": false,
1821
+ "notNull": false
1822
+ },
1823
+ "created_by": {
1824
+ "name": "created_by",
1825
+ "type": "text",
1826
+ "primaryKey": false,
1827
+ "notNull": false
1828
+ },
1829
+ "created_at": {
1830
+ "name": "created_at",
1831
+ "type": "timestamp",
1832
+ "primaryKey": false,
1833
+ "notNull": true,
1834
+ "default": "now()"
1835
+ },
1836
+ "updated_at": {
1837
+ "name": "updated_at",
1838
+ "type": "timestamp",
1839
+ "primaryKey": false,
1840
+ "notNull": true,
1841
+ "default": "now()"
1842
+ }
1843
+ },
1844
+ "indexes": {
1845
+ "batch_send_org_idx": {
1846
+ "name": "batch_send_org_idx",
1847
+ "columns": [
1848
+ {
1849
+ "expression": "organization_id",
1850
+ "isExpression": false,
1851
+ "asc": true,
1852
+ "nulls": "last"
1853
+ }
1854
+ ],
1855
+ "isUnique": false,
1856
+ "concurrently": false,
1857
+ "method": "btree",
1858
+ "with": {}
1859
+ },
1860
+ "batch_send_channel_idx": {
1861
+ "name": "batch_send_channel_idx",
1862
+ "columns": [
1863
+ {
1864
+ "expression": "channel",
1865
+ "isExpression": false,
1866
+ "asc": true,
1867
+ "nulls": "last"
1868
+ }
1869
+ ],
1870
+ "isUnique": false,
1871
+ "concurrently": false,
1872
+ "method": "btree",
1873
+ "with": {}
1874
+ },
1875
+ "batch_send_status_idx": {
1876
+ "name": "batch_send_status_idx",
1877
+ "columns": [
1878
+ {
1879
+ "expression": "organization_id",
1880
+ "isExpression": false,
1881
+ "asc": true,
1882
+ "nulls": "last"
1883
+ },
1884
+ {
1885
+ "expression": "status",
1886
+ "isExpression": false,
1887
+ "asc": true,
1888
+ "nulls": "last"
1889
+ }
1890
+ ],
1891
+ "isUnique": false,
1892
+ "concurrently": false,
1893
+ "method": "btree",
1894
+ "with": {}
1895
+ },
1896
+ "batch_send_created_at_idx": {
1897
+ "name": "batch_send_created_at_idx",
1898
+ "columns": [
1899
+ {
1900
+ "expression": "organization_id",
1901
+ "isExpression": false,
1902
+ "asc": true,
1903
+ "nulls": "last"
1904
+ },
1905
+ {
1906
+ "expression": "created_at",
1907
+ "isExpression": false,
1908
+ "asc": true,
1909
+ "nulls": "last"
1910
+ }
1911
+ ],
1912
+ "isUnique": false,
1913
+ "concurrently": false,
1914
+ "method": "btree",
1915
+ "with": {}
1916
+ }
1917
+ },
1918
+ "foreignKeys": {
1919
+ "batch_send_organization_id_organization_id_fk": {
1920
+ "name": "batch_send_organization_id_organization_id_fk",
1921
+ "tableFrom": "batch_send",
1922
+ "tableTo": "organization",
1923
+ "columnsFrom": ["organization_id"],
1924
+ "columnsTo": ["id"],
1925
+ "onDelete": "cascade",
1926
+ "onUpdate": "no action"
1927
+ },
1928
+ "batch_send_aws_account_id_aws_account_id_fk": {
1929
+ "name": "batch_send_aws_account_id_aws_account_id_fk",
1930
+ "tableFrom": "batch_send",
1931
+ "tableTo": "aws_account",
1932
+ "columnsFrom": ["aws_account_id"],
1933
+ "columnsTo": ["id"],
1934
+ "onDelete": "set null",
1935
+ "onUpdate": "no action"
1936
+ },
1937
+ "batch_send_email_template_id_template_id_fk": {
1938
+ "name": "batch_send_email_template_id_template_id_fk",
1939
+ "tableFrom": "batch_send",
1940
+ "tableTo": "template",
1941
+ "columnsFrom": ["email_template_id"],
1942
+ "columnsTo": ["id"],
1943
+ "onDelete": "set null",
1944
+ "onUpdate": "no action"
1945
+ },
1946
+ "batch_send_created_by_user_id_fk": {
1947
+ "name": "batch_send_created_by_user_id_fk",
1948
+ "tableFrom": "batch_send",
1949
+ "tableTo": "user",
1950
+ "columnsFrom": ["created_by"],
1951
+ "columnsTo": ["id"],
1952
+ "onDelete": "set null",
1953
+ "onUpdate": "no action"
1954
+ }
1955
+ },
1956
+ "compositePrimaryKeys": {},
1957
+ "uniqueConstraints": {},
1958
+ "policies": {},
1959
+ "checkConstraints": {},
1960
+ "isRLSEnabled": false
1961
+ },
1962
+ "public.message_send": {
1963
+ "name": "message_send",
1964
+ "schema": "",
1965
+ "columns": {
1966
+ "id": {
1967
+ "name": "id",
1968
+ "type": "text",
1969
+ "primaryKey": true,
1970
+ "notNull": true
1971
+ },
1972
+ "organization_id": {
1973
+ "name": "organization_id",
1974
+ "type": "text",
1975
+ "primaryKey": false,
1976
+ "notNull": true
1977
+ },
1978
+ "contact_id": {
1979
+ "name": "contact_id",
1980
+ "type": "text",
1981
+ "primaryKey": false,
1982
+ "notNull": false
1983
+ },
1984
+ "aws_account_id": {
1985
+ "name": "aws_account_id",
1986
+ "type": "text",
1987
+ "primaryKey": false,
1988
+ "notNull": true
1989
+ },
1990
+ "channel": {
1991
+ "name": "channel",
1992
+ "type": "text",
1993
+ "primaryKey": false,
1994
+ "notNull": true,
1995
+ "default": "'email'"
1996
+ },
1997
+ "source_type": {
1998
+ "name": "source_type",
1999
+ "type": "message_source_type",
2000
+ "typeSchema": "public",
2001
+ "primaryKey": false,
2002
+ "notNull": true
2003
+ },
2004
+ "batch_send_id": {
2005
+ "name": "batch_send_id",
2006
+ "type": "text",
2007
+ "primaryKey": false,
2008
+ "notNull": false
2009
+ },
2010
+ "recipient": {
2011
+ "name": "recipient",
2012
+ "type": "text",
2013
+ "primaryKey": false,
2014
+ "notNull": true
2015
+ },
2016
+ "subject": {
2017
+ "name": "subject",
2018
+ "type": "text",
2019
+ "primaryKey": false,
2020
+ "notNull": false
2021
+ },
2022
+ "from": {
2023
+ "name": "from",
2024
+ "type": "text",
2025
+ "primaryKey": false,
2026
+ "notNull": false
2027
+ },
2028
+ "from_name": {
2029
+ "name": "from_name",
2030
+ "type": "text",
2031
+ "primaryKey": false,
2032
+ "notNull": false
2033
+ },
2034
+ "email_template_id": {
2035
+ "name": "email_template_id",
2036
+ "type": "text",
2037
+ "primaryKey": false,
2038
+ "notNull": false
2039
+ },
2040
+ "body": {
2041
+ "name": "body",
2042
+ "type": "text",
2043
+ "primaryKey": false,
2044
+ "notNull": false
2045
+ },
2046
+ "sender_id": {
2047
+ "name": "sender_id",
2048
+ "type": "text",
2049
+ "primaryKey": false,
2050
+ "notNull": false
2051
+ },
2052
+ "sms_segment_count": {
2053
+ "name": "sms_segment_count",
2054
+ "type": "integer",
2055
+ "primaryKey": false,
2056
+ "notNull": false
2057
+ },
2058
+ "variables": {
2059
+ "name": "variables",
2060
+ "type": "json",
2061
+ "primaryKey": false,
2062
+ "notNull": false,
2063
+ "default": "'{}'::json"
2064
+ },
2065
+ "message_id": {
2066
+ "name": "message_id",
2067
+ "type": "text",
2068
+ "primaryKey": false,
2069
+ "notNull": false
2070
+ },
2071
+ "status": {
2072
+ "name": "status",
2073
+ "type": "message_send_status",
2074
+ "typeSchema": "public",
2075
+ "primaryKey": false,
2076
+ "notNull": true,
2077
+ "default": "'pending'"
2078
+ },
2079
+ "sent_at": {
2080
+ "name": "sent_at",
2081
+ "type": "timestamp",
2082
+ "primaryKey": false,
2083
+ "notNull": false
2084
+ },
2085
+ "delivered_at": {
2086
+ "name": "delivered_at",
2087
+ "type": "timestamp",
2088
+ "primaryKey": false,
2089
+ "notNull": false
2090
+ },
2091
+ "opened_at": {
2092
+ "name": "opened_at",
2093
+ "type": "timestamp",
2094
+ "primaryKey": false,
2095
+ "notNull": false
2096
+ },
2097
+ "clicked_at": {
2098
+ "name": "clicked_at",
2099
+ "type": "timestamp",
2100
+ "primaryKey": false,
2101
+ "notNull": false
2102
+ },
2103
+ "bounced_at": {
2104
+ "name": "bounced_at",
2105
+ "type": "timestamp",
2106
+ "primaryKey": false,
2107
+ "notNull": false
2108
+ },
2109
+ "complained_at": {
2110
+ "name": "complained_at",
2111
+ "type": "timestamp",
2112
+ "primaryKey": false,
2113
+ "notNull": false
2114
+ },
2115
+ "opted_out_at": {
2116
+ "name": "opted_out_at",
2117
+ "type": "timestamp",
2118
+ "primaryKey": false,
2119
+ "notNull": false
2120
+ },
2121
+ "error": {
2122
+ "name": "error",
2123
+ "type": "text",
2124
+ "primaryKey": false,
2125
+ "notNull": false
2126
+ },
2127
+ "bounce_type": {
2128
+ "name": "bounce_type",
2129
+ "type": "text",
2130
+ "primaryKey": false,
2131
+ "notNull": false
2132
+ },
2133
+ "bounce_sub_type": {
2134
+ "name": "bounce_sub_type",
2135
+ "type": "text",
2136
+ "primaryKey": false,
2137
+ "notNull": false
2138
+ },
2139
+ "created_at": {
2140
+ "name": "created_at",
2141
+ "type": "timestamp",
2142
+ "primaryKey": false,
2143
+ "notNull": true,
2144
+ "default": "now()"
2145
+ }
2146
+ },
2147
+ "indexes": {
2148
+ "message_send_org_idx": {
2149
+ "name": "message_send_org_idx",
2150
+ "columns": [
2151
+ {
2152
+ "expression": "organization_id",
2153
+ "isExpression": false,
2154
+ "asc": true,
2155
+ "nulls": "last"
2156
+ }
2157
+ ],
2158
+ "isUnique": false,
2159
+ "concurrently": false,
2160
+ "method": "btree",
2161
+ "with": {}
2162
+ },
2163
+ "message_send_contact_idx": {
2164
+ "name": "message_send_contact_idx",
2165
+ "columns": [
2166
+ {
2167
+ "expression": "contact_id",
2168
+ "isExpression": false,
2169
+ "asc": true,
2170
+ "nulls": "last"
2171
+ }
2172
+ ],
2173
+ "isUnique": false,
2174
+ "concurrently": false,
2175
+ "method": "btree",
2176
+ "with": {}
2177
+ },
2178
+ "message_send_channel_idx": {
2179
+ "name": "message_send_channel_idx",
2180
+ "columns": [
2181
+ {
2182
+ "expression": "channel",
2183
+ "isExpression": false,
2184
+ "asc": true,
2185
+ "nulls": "last"
2186
+ }
2187
+ ],
2188
+ "isUnique": false,
2189
+ "concurrently": false,
2190
+ "method": "btree",
2191
+ "with": {}
2192
+ },
2193
+ "message_send_batch_idx": {
2194
+ "name": "message_send_batch_idx",
2195
+ "columns": [
2196
+ {
2197
+ "expression": "batch_send_id",
2198
+ "isExpression": false,
2199
+ "asc": true,
2200
+ "nulls": "last"
2201
+ }
2202
+ ],
2203
+ "isUnique": false,
2204
+ "concurrently": false,
2205
+ "method": "btree",
2206
+ "with": {}
2207
+ },
2208
+ "message_send_status_idx": {
2209
+ "name": "message_send_status_idx",
2210
+ "columns": [
2211
+ {
2212
+ "expression": "batch_send_id",
2213
+ "isExpression": false,
2214
+ "asc": true,
2215
+ "nulls": "last"
2216
+ },
2217
+ {
2218
+ "expression": "status",
2219
+ "isExpression": false,
2220
+ "asc": true,
2221
+ "nulls": "last"
2222
+ }
2223
+ ],
2224
+ "isUnique": false,
2225
+ "concurrently": false,
2226
+ "method": "btree",
2227
+ "with": {}
2228
+ },
2229
+ "message_send_message_id_idx": {
2230
+ "name": "message_send_message_id_idx",
2231
+ "columns": [
2232
+ {
2233
+ "expression": "message_id",
2234
+ "isExpression": false,
2235
+ "asc": true,
2236
+ "nulls": "last"
2237
+ }
2238
+ ],
2239
+ "isUnique": true,
2240
+ "concurrently": false,
2241
+ "method": "btree",
2242
+ "with": {}
2243
+ },
2244
+ "message_send_source_type_idx": {
2245
+ "name": "message_send_source_type_idx",
2246
+ "columns": [
2247
+ {
2248
+ "expression": "source_type",
2249
+ "isExpression": false,
2250
+ "asc": true,
2251
+ "nulls": "last"
2252
+ }
2253
+ ],
2254
+ "isUnique": false,
2255
+ "concurrently": false,
2256
+ "method": "btree",
2257
+ "with": {}
2258
+ },
2259
+ "message_send_created_at_idx": {
2260
+ "name": "message_send_created_at_idx",
2261
+ "columns": [
2262
+ {
2263
+ "expression": "created_at",
2264
+ "isExpression": false,
2265
+ "asc": true,
2266
+ "nulls": "last"
2267
+ }
2268
+ ],
2269
+ "isUnique": false,
2270
+ "concurrently": false,
2271
+ "method": "btree",
2272
+ "with": {}
2273
+ }
2274
+ },
2275
+ "foreignKeys": {
2276
+ "message_send_organization_id_organization_id_fk": {
2277
+ "name": "message_send_organization_id_organization_id_fk",
2278
+ "tableFrom": "message_send",
2279
+ "tableTo": "organization",
2280
+ "columnsFrom": ["organization_id"],
2281
+ "columnsTo": ["id"],
2282
+ "onDelete": "cascade",
2283
+ "onUpdate": "no action"
2284
+ },
2285
+ "message_send_contact_id_contact_id_fk": {
2286
+ "name": "message_send_contact_id_contact_id_fk",
2287
+ "tableFrom": "message_send",
2288
+ "tableTo": "contact",
2289
+ "columnsFrom": ["contact_id"],
2290
+ "columnsTo": ["id"],
2291
+ "onDelete": "set null",
2292
+ "onUpdate": "no action"
2293
+ },
2294
+ "message_send_aws_account_id_aws_account_id_fk": {
2295
+ "name": "message_send_aws_account_id_aws_account_id_fk",
2296
+ "tableFrom": "message_send",
2297
+ "tableTo": "aws_account",
2298
+ "columnsFrom": ["aws_account_id"],
2299
+ "columnsTo": ["id"],
2300
+ "onDelete": "set null",
2301
+ "onUpdate": "no action"
2302
+ },
2303
+ "message_send_batch_send_id_batch_send_id_fk": {
2304
+ "name": "message_send_batch_send_id_batch_send_id_fk",
2305
+ "tableFrom": "message_send",
2306
+ "tableTo": "batch_send",
2307
+ "columnsFrom": ["batch_send_id"],
2308
+ "columnsTo": ["id"],
2309
+ "onDelete": "set null",
2310
+ "onUpdate": "no action"
2311
+ },
2312
+ "message_send_email_template_id_template_id_fk": {
2313
+ "name": "message_send_email_template_id_template_id_fk",
2314
+ "tableFrom": "message_send",
2315
+ "tableTo": "template",
2316
+ "columnsFrom": ["email_template_id"],
2317
+ "columnsTo": ["id"],
2318
+ "onDelete": "set null",
2319
+ "onUpdate": "no action"
2320
+ }
2321
+ },
2322
+ "compositePrimaryKeys": {},
2323
+ "uniqueConstraints": {},
2324
+ "policies": {},
2325
+ "checkConstraints": {},
2326
+ "isRLSEnabled": false
2327
+ },
2328
+ "public.contact": {
2329
+ "name": "contact",
2330
+ "schema": "",
2331
+ "columns": {
2332
+ "id": {
2333
+ "name": "id",
2334
+ "type": "text",
2335
+ "primaryKey": true,
2336
+ "notNull": true
2337
+ },
2338
+ "organization_id": {
2339
+ "name": "organization_id",
2340
+ "type": "text",
2341
+ "primaryKey": false,
2342
+ "notNull": true
2343
+ },
2344
+ "email": {
2345
+ "name": "email",
2346
+ "type": "text",
2347
+ "primaryKey": false,
2348
+ "notNull": false
2349
+ },
2350
+ "email_hash": {
2351
+ "name": "email_hash",
2352
+ "type": "text",
2353
+ "primaryKey": false,
2354
+ "notNull": false
2355
+ },
2356
+ "email_status": {
2357
+ "name": "email_status",
2358
+ "type": "text",
2359
+ "primaryKey": false,
2360
+ "notNull": false
2361
+ },
2362
+ "email_verified_at": {
2363
+ "name": "email_verified_at",
2364
+ "type": "timestamp",
2365
+ "primaryKey": false,
2366
+ "notNull": false
2367
+ },
2368
+ "email_unsubscribed_at": {
2369
+ "name": "email_unsubscribed_at",
2370
+ "type": "timestamp",
2371
+ "primaryKey": false,
2372
+ "notNull": false
2373
+ },
2374
+ "email_bounced_at": {
2375
+ "name": "email_bounced_at",
2376
+ "type": "timestamp",
2377
+ "primaryKey": false,
2378
+ "notNull": false
2379
+ },
2380
+ "email_complained_at": {
2381
+ "name": "email_complained_at",
2382
+ "type": "timestamp",
2383
+ "primaryKey": false,
2384
+ "notNull": false
2385
+ },
2386
+ "last_email_sent_at": {
2387
+ "name": "last_email_sent_at",
2388
+ "type": "timestamp",
2389
+ "primaryKey": false,
2390
+ "notNull": false
2391
+ },
2392
+ "last_email_opened_at": {
2393
+ "name": "last_email_opened_at",
2394
+ "type": "timestamp",
2395
+ "primaryKey": false,
2396
+ "notNull": false
2397
+ },
2398
+ "last_email_clicked_at": {
2399
+ "name": "last_email_clicked_at",
2400
+ "type": "timestamp",
2401
+ "primaryKey": false,
2402
+ "notNull": false
2403
+ },
2404
+ "emails_sent": {
2405
+ "name": "emails_sent",
2406
+ "type": "integer",
2407
+ "primaryKey": false,
2408
+ "notNull": true,
2409
+ "default": 0
2410
+ },
2411
+ "emails_opened": {
2412
+ "name": "emails_opened",
2413
+ "type": "integer",
2414
+ "primaryKey": false,
2415
+ "notNull": true,
2416
+ "default": 0
2417
+ },
2418
+ "emails_clicked": {
2419
+ "name": "emails_clicked",
2420
+ "type": "integer",
2421
+ "primaryKey": false,
2422
+ "notNull": true,
2423
+ "default": 0
2424
+ },
2425
+ "phone": {
2426
+ "name": "phone",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": false
2430
+ },
2431
+ "phone_hash": {
2432
+ "name": "phone_hash",
2433
+ "type": "text",
2434
+ "primaryKey": false,
2435
+ "notNull": false
2436
+ },
2437
+ "sms_status": {
2438
+ "name": "sms_status",
2439
+ "type": "text",
2440
+ "primaryKey": false,
2441
+ "notNull": false
2442
+ },
2443
+ "sms_consented_at": {
2444
+ "name": "sms_consented_at",
2445
+ "type": "timestamp",
2446
+ "primaryKey": false,
2447
+ "notNull": false
2448
+ },
2449
+ "sms_opted_out_at": {
2450
+ "name": "sms_opted_out_at",
2451
+ "type": "timestamp",
2452
+ "primaryKey": false,
2453
+ "notNull": false
2454
+ },
2455
+ "sms_invalid_at": {
2456
+ "name": "sms_invalid_at",
2457
+ "type": "timestamp",
2458
+ "primaryKey": false,
2459
+ "notNull": false
2460
+ },
2461
+ "last_sms_sent_at": {
2462
+ "name": "last_sms_sent_at",
2463
+ "type": "timestamp",
2464
+ "primaryKey": false,
2465
+ "notNull": false
2466
+ },
2467
+ "last_sms_clicked_at": {
2468
+ "name": "last_sms_clicked_at",
2469
+ "type": "timestamp",
2470
+ "primaryKey": false,
2471
+ "notNull": false
2472
+ },
2473
+ "sms_sent": {
2474
+ "name": "sms_sent",
2475
+ "type": "integer",
2476
+ "primaryKey": false,
2477
+ "notNull": true,
2478
+ "default": 0
2479
+ },
2480
+ "sms_clicked": {
2481
+ "name": "sms_clicked",
2482
+ "type": "integer",
2483
+ "primaryKey": false,
2484
+ "notNull": true,
2485
+ "default": 0
2486
+ },
2487
+ "properties": {
2488
+ "name": "properties",
2489
+ "type": "json",
2490
+ "primaryKey": false,
2491
+ "notNull": true,
2492
+ "default": "'{}'::json"
2493
+ },
2494
+ "last_activity_at": {
2495
+ "name": "last_activity_at",
2496
+ "type": "timestamp",
2497
+ "primaryKey": false,
2498
+ "notNull": false
2499
+ },
2500
+ "created_at": {
2501
+ "name": "created_at",
2502
+ "type": "timestamp",
2503
+ "primaryKey": false,
2504
+ "notNull": true,
2505
+ "default": "now()"
2506
+ },
2507
+ "updated_at": {
2508
+ "name": "updated_at",
2509
+ "type": "timestamp",
2510
+ "primaryKey": false,
2511
+ "notNull": true,
2512
+ "default": "now()"
2513
+ },
2514
+ "created_by": {
2515
+ "name": "created_by",
2516
+ "type": "text",
2517
+ "primaryKey": false,
2518
+ "notNull": false
2519
+ },
2520
+ "status": {
2521
+ "name": "status",
2522
+ "type": "text",
2523
+ "primaryKey": false,
2524
+ "notNull": true,
2525
+ "default": "'active'"
2526
+ },
2527
+ "confirmed_at": {
2528
+ "name": "confirmed_at",
2529
+ "type": "timestamp",
2530
+ "primaryKey": false,
2531
+ "notNull": false
2532
+ },
2533
+ "unsubscribed_at": {
2534
+ "name": "unsubscribed_at",
2535
+ "type": "timestamp",
2536
+ "primaryKey": false,
2537
+ "notNull": false
2538
+ },
2539
+ "bounced_at": {
2540
+ "name": "bounced_at",
2541
+ "type": "timestamp",
2542
+ "primaryKey": false,
2543
+ "notNull": false
2544
+ },
2545
+ "complained_at": {
2546
+ "name": "complained_at",
2547
+ "type": "timestamp",
2548
+ "primaryKey": false,
2549
+ "notNull": false
2550
+ }
2551
+ },
2552
+ "indexes": {
2553
+ "contact_org_idx": {
2554
+ "name": "contact_org_idx",
2555
+ "columns": [
2556
+ {
2557
+ "expression": "organization_id",
2558
+ "isExpression": false,
2559
+ "asc": true,
2560
+ "nulls": "last"
2561
+ }
2562
+ ],
2563
+ "isUnique": false,
2564
+ "concurrently": false,
2565
+ "method": "btree",
2566
+ "with": {}
2567
+ },
2568
+ "contact_email_idx": {
2569
+ "name": "contact_email_idx",
2570
+ "columns": [
2571
+ {
2572
+ "expression": "email",
2573
+ "isExpression": false,
2574
+ "asc": true,
2575
+ "nulls": "last"
2576
+ }
2577
+ ],
2578
+ "isUnique": false,
2579
+ "concurrently": false,
2580
+ "method": "btree",
2581
+ "with": {}
2582
+ },
2583
+ "contact_unique_org_email_idx": {
2584
+ "name": "contact_unique_org_email_idx",
2585
+ "columns": [
2586
+ {
2587
+ "expression": "organization_id",
2588
+ "isExpression": false,
2589
+ "asc": true,
2590
+ "nulls": "last"
2591
+ },
2592
+ {
2593
+ "expression": "email_hash",
2594
+ "isExpression": false,
2595
+ "asc": true,
2596
+ "nulls": "last"
2597
+ }
2598
+ ],
2599
+ "isUnique": true,
2600
+ "where": "email_hash IS NOT NULL",
2601
+ "concurrently": false,
2602
+ "method": "btree",
2603
+ "with": {}
2604
+ },
2605
+ "contact_email_status_idx": {
2606
+ "name": "contact_email_status_idx",
2607
+ "columns": [
2608
+ {
2609
+ "expression": "organization_id",
2610
+ "isExpression": false,
2611
+ "asc": true,
2612
+ "nulls": "last"
2613
+ },
2614
+ {
2615
+ "expression": "email_status",
2616
+ "isExpression": false,
2617
+ "asc": true,
2618
+ "nulls": "last"
2619
+ }
2620
+ ],
2621
+ "isUnique": false,
2622
+ "concurrently": false,
2623
+ "method": "btree",
2624
+ "with": {}
2625
+ },
2626
+ "contact_phone_idx": {
2627
+ "name": "contact_phone_idx",
2628
+ "columns": [
2629
+ {
2630
+ "expression": "phone",
2631
+ "isExpression": false,
2632
+ "asc": true,
2633
+ "nulls": "last"
2634
+ }
2635
+ ],
2636
+ "isUnique": false,
2637
+ "concurrently": false,
2638
+ "method": "btree",
2639
+ "with": {}
2640
+ },
2641
+ "contact_unique_org_phone_idx": {
2642
+ "name": "contact_unique_org_phone_idx",
2643
+ "columns": [
2644
+ {
2645
+ "expression": "organization_id",
2646
+ "isExpression": false,
2647
+ "asc": true,
2648
+ "nulls": "last"
2649
+ },
2650
+ {
2651
+ "expression": "phone_hash",
2652
+ "isExpression": false,
2653
+ "asc": true,
2654
+ "nulls": "last"
2655
+ }
2656
+ ],
2657
+ "isUnique": true,
2658
+ "where": "phone_hash IS NOT NULL",
2659
+ "concurrently": false,
2660
+ "method": "btree",
2661
+ "with": {}
2662
+ },
2663
+ "contact_sms_status_idx": {
2664
+ "name": "contact_sms_status_idx",
2665
+ "columns": [
2666
+ {
2667
+ "expression": "organization_id",
2668
+ "isExpression": false,
2669
+ "asc": true,
2670
+ "nulls": "last"
2671
+ },
2672
+ {
2673
+ "expression": "sms_status",
2674
+ "isExpression": false,
2675
+ "asc": true,
2676
+ "nulls": "last"
2677
+ }
2678
+ ],
2679
+ "isUnique": false,
2680
+ "concurrently": false,
2681
+ "method": "btree",
2682
+ "with": {}
2683
+ },
2684
+ "contact_status_idx": {
2685
+ "name": "contact_status_idx",
2686
+ "columns": [
2687
+ {
2688
+ "expression": "organization_id",
2689
+ "isExpression": false,
2690
+ "asc": true,
2691
+ "nulls": "last"
2692
+ },
2693
+ {
2694
+ "expression": "status",
2695
+ "isExpression": false,
2696
+ "asc": true,
2697
+ "nulls": "last"
2698
+ }
2699
+ ],
2700
+ "isUnique": false,
2701
+ "concurrently": false,
2702
+ "method": "btree",
2703
+ "with": {}
2704
+ }
2705
+ },
2706
+ "foreignKeys": {
2707
+ "contact_organization_id_organization_id_fk": {
2708
+ "name": "contact_organization_id_organization_id_fk",
2709
+ "tableFrom": "contact",
2710
+ "tableTo": "organization",
2711
+ "columnsFrom": ["organization_id"],
2712
+ "columnsTo": ["id"],
2713
+ "onDelete": "cascade",
2714
+ "onUpdate": "no action"
2715
+ },
2716
+ "contact_created_by_user_id_fk": {
2717
+ "name": "contact_created_by_user_id_fk",
2718
+ "tableFrom": "contact",
2719
+ "tableTo": "user",
2720
+ "columnsFrom": ["created_by"],
2721
+ "columnsTo": ["id"],
2722
+ "onDelete": "no action",
2723
+ "onUpdate": "no action"
2724
+ }
2725
+ },
2726
+ "compositePrimaryKeys": {},
2727
+ "uniqueConstraints": {},
2728
+ "policies": {},
2729
+ "checkConstraints": {},
2730
+ "isRLSEnabled": false
2731
+ },
2732
+ "public.contact_topic": {
2733
+ "name": "contact_topic",
2734
+ "schema": "",
2735
+ "columns": {
2736
+ "contact_id": {
2737
+ "name": "contact_id",
2738
+ "type": "text",
2739
+ "primaryKey": false,
2740
+ "notNull": true
2741
+ },
2742
+ "topic_id": {
2743
+ "name": "topic_id",
2744
+ "type": "text",
2745
+ "primaryKey": false,
2746
+ "notNull": true
2747
+ },
2748
+ "status": {
2749
+ "name": "status",
2750
+ "type": "text",
2751
+ "primaryKey": false,
2752
+ "notNull": true,
2753
+ "default": "'subscribed'"
2754
+ },
2755
+ "subscribed_at": {
2756
+ "name": "subscribed_at",
2757
+ "type": "timestamp",
2758
+ "primaryKey": false,
2759
+ "notNull": false,
2760
+ "default": "now()"
2761
+ },
2762
+ "unsubscribed_at": {
2763
+ "name": "unsubscribed_at",
2764
+ "type": "timestamp",
2765
+ "primaryKey": false,
2766
+ "notNull": false
2767
+ }
2768
+ },
2769
+ "indexes": {
2770
+ "contact_topic_topic_idx": {
2771
+ "name": "contact_topic_topic_idx",
2772
+ "columns": [
2773
+ {
2774
+ "expression": "topic_id",
2775
+ "isExpression": false,
2776
+ "asc": true,
2777
+ "nulls": "last"
2778
+ }
2779
+ ],
2780
+ "isUnique": false,
2781
+ "concurrently": false,
2782
+ "method": "btree",
2783
+ "with": {}
2784
+ },
2785
+ "contact_topic_status_idx": {
2786
+ "name": "contact_topic_status_idx",
2787
+ "columns": [
2788
+ {
2789
+ "expression": "topic_id",
2790
+ "isExpression": false,
2791
+ "asc": true,
2792
+ "nulls": "last"
2793
+ },
2794
+ {
2795
+ "expression": "status",
2796
+ "isExpression": false,
2797
+ "asc": true,
2798
+ "nulls": "last"
2799
+ }
2800
+ ],
2801
+ "isUnique": false,
2802
+ "concurrently": false,
2803
+ "method": "btree",
2804
+ "with": {}
2805
+ }
2806
+ },
2807
+ "foreignKeys": {
2808
+ "contact_topic_contact_id_contact_id_fk": {
2809
+ "name": "contact_topic_contact_id_contact_id_fk",
2810
+ "tableFrom": "contact_topic",
2811
+ "tableTo": "contact",
2812
+ "columnsFrom": ["contact_id"],
2813
+ "columnsTo": ["id"],
2814
+ "onDelete": "cascade",
2815
+ "onUpdate": "no action"
2816
+ },
2817
+ "contact_topic_topic_id_topic_id_fk": {
2818
+ "name": "contact_topic_topic_id_topic_id_fk",
2819
+ "tableFrom": "contact_topic",
2820
+ "tableTo": "topic",
2821
+ "columnsFrom": ["topic_id"],
2822
+ "columnsTo": ["id"],
2823
+ "onDelete": "cascade",
2824
+ "onUpdate": "no action"
2825
+ }
2826
+ },
2827
+ "compositePrimaryKeys": {
2828
+ "contact_topic_contact_id_topic_id_pk": {
2829
+ "name": "contact_topic_contact_id_topic_id_pk",
2830
+ "columns": ["contact_id", "topic_id"]
2831
+ }
2832
+ },
2833
+ "uniqueConstraints": {},
2834
+ "policies": {},
2835
+ "checkConstraints": {},
2836
+ "isRLSEnabled": false
2837
+ },
2838
+ "public.topic": {
2839
+ "name": "topic",
2840
+ "schema": "",
2841
+ "columns": {
2842
+ "id": {
2843
+ "name": "id",
2844
+ "type": "text",
2845
+ "primaryKey": true,
2846
+ "notNull": true
2847
+ },
2848
+ "organization_id": {
2849
+ "name": "organization_id",
2850
+ "type": "text",
2851
+ "primaryKey": false,
2852
+ "notNull": true
2853
+ },
2854
+ "name": {
2855
+ "name": "name",
2856
+ "type": "text",
2857
+ "primaryKey": false,
2858
+ "notNull": true
2859
+ },
2860
+ "slug": {
2861
+ "name": "slug",
2862
+ "type": "text",
2863
+ "primaryKey": false,
2864
+ "notNull": true
2865
+ },
2866
+ "description": {
2867
+ "name": "description",
2868
+ "type": "text",
2869
+ "primaryKey": false,
2870
+ "notNull": false
2871
+ },
2872
+ "public": {
2873
+ "name": "public",
2874
+ "type": "boolean",
2875
+ "primaryKey": false,
2876
+ "notNull": true,
2877
+ "default": true
2878
+ },
2879
+ "double_opt_in": {
2880
+ "name": "double_opt_in",
2881
+ "type": "boolean",
2882
+ "primaryKey": false,
2883
+ "notNull": true,
2884
+ "default": false
2885
+ },
2886
+ "subscriber_count": {
2887
+ "name": "subscriber_count",
2888
+ "type": "integer",
2889
+ "primaryKey": false,
2890
+ "notNull": true,
2891
+ "default": 0
2892
+ },
2893
+ "created_at": {
2894
+ "name": "created_at",
2895
+ "type": "timestamp",
2896
+ "primaryKey": false,
2897
+ "notNull": true,
2898
+ "default": "now()"
2899
+ },
2900
+ "updated_at": {
2901
+ "name": "updated_at",
2902
+ "type": "timestamp",
2903
+ "primaryKey": false,
2904
+ "notNull": true,
2905
+ "default": "now()"
2906
+ },
2907
+ "created_by": {
2908
+ "name": "created_by",
2909
+ "type": "text",
2910
+ "primaryKey": false,
2911
+ "notNull": false
2912
+ }
2913
+ },
2914
+ "indexes": {
2915
+ "topic_org_idx": {
2916
+ "name": "topic_org_idx",
2917
+ "columns": [
2918
+ {
2919
+ "expression": "organization_id",
2920
+ "isExpression": false,
2921
+ "asc": true,
2922
+ "nulls": "last"
2923
+ }
2924
+ ],
2925
+ "isUnique": false,
2926
+ "concurrently": false,
2927
+ "method": "btree",
2928
+ "with": {}
2929
+ },
2930
+ "topic_unique_org_slug_idx": {
2931
+ "name": "topic_unique_org_slug_idx",
2932
+ "columns": [
2933
+ {
2934
+ "expression": "organization_id",
2935
+ "isExpression": false,
2936
+ "asc": true,
2937
+ "nulls": "last"
2938
+ },
2939
+ {
2940
+ "expression": "slug",
2941
+ "isExpression": false,
2942
+ "asc": true,
2943
+ "nulls": "last"
2944
+ }
2945
+ ],
2946
+ "isUnique": true,
2947
+ "concurrently": false,
2948
+ "method": "btree",
2949
+ "with": {}
2950
+ }
2951
+ },
2952
+ "foreignKeys": {
2953
+ "topic_organization_id_organization_id_fk": {
2954
+ "name": "topic_organization_id_organization_id_fk",
2955
+ "tableFrom": "topic",
2956
+ "tableTo": "organization",
2957
+ "columnsFrom": ["organization_id"],
2958
+ "columnsTo": ["id"],
2959
+ "onDelete": "cascade",
2960
+ "onUpdate": "no action"
2961
+ },
2962
+ "topic_created_by_user_id_fk": {
2963
+ "name": "topic_created_by_user_id_fk",
2964
+ "tableFrom": "topic",
2965
+ "tableTo": "user",
2966
+ "columnsFrom": ["created_by"],
2967
+ "columnsTo": ["id"],
2968
+ "onDelete": "no action",
2969
+ "onUpdate": "no action"
2970
+ }
2971
+ },
2972
+ "compositePrimaryKeys": {},
2973
+ "uniqueConstraints": {},
2974
+ "policies": {},
2975
+ "checkConstraints": {},
2976
+ "isRLSEnabled": false
2977
+ },
2978
+ "public.segment": {
2979
+ "name": "segment",
2980
+ "schema": "",
2981
+ "columns": {
2982
+ "id": {
2983
+ "name": "id",
2984
+ "type": "text",
2985
+ "primaryKey": true,
2986
+ "notNull": true
2987
+ },
2988
+ "organization_id": {
2989
+ "name": "organization_id",
2990
+ "type": "text",
2991
+ "primaryKey": false,
2992
+ "notNull": true
2993
+ },
2994
+ "name": {
2995
+ "name": "name",
2996
+ "type": "text",
2997
+ "primaryKey": false,
2998
+ "notNull": true
2999
+ },
3000
+ "description": {
3001
+ "name": "description",
3002
+ "type": "text",
3003
+ "primaryKey": false,
3004
+ "notNull": false
3005
+ },
3006
+ "condition": {
3007
+ "name": "condition",
3008
+ "type": "json",
3009
+ "primaryKey": false,
3010
+ "notNull": true
3011
+ },
3012
+ "track_membership": {
3013
+ "name": "track_membership",
3014
+ "type": "boolean",
3015
+ "primaryKey": false,
3016
+ "notNull": true,
3017
+ "default": false
3018
+ },
3019
+ "member_count": {
3020
+ "name": "member_count",
3021
+ "type": "integer",
3022
+ "primaryKey": false,
3023
+ "notNull": true,
3024
+ "default": 0
3025
+ },
3026
+ "last_computed_at": {
3027
+ "name": "last_computed_at",
3028
+ "type": "timestamp",
3029
+ "primaryKey": false,
3030
+ "notNull": false
3031
+ },
3032
+ "created_by": {
3033
+ "name": "created_by",
3034
+ "type": "text",
3035
+ "primaryKey": false,
3036
+ "notNull": false
3037
+ },
3038
+ "created_at": {
3039
+ "name": "created_at",
3040
+ "type": "timestamp",
3041
+ "primaryKey": false,
3042
+ "notNull": true,
3043
+ "default": "now()"
3044
+ },
3045
+ "updated_at": {
3046
+ "name": "updated_at",
3047
+ "type": "timestamp",
3048
+ "primaryKey": false,
3049
+ "notNull": true,
3050
+ "default": "now()"
3051
+ }
3052
+ },
3053
+ "indexes": {
3054
+ "segment_org_idx": {
3055
+ "name": "segment_org_idx",
3056
+ "columns": [
3057
+ {
3058
+ "expression": "organization_id",
3059
+ "isExpression": false,
3060
+ "asc": true,
3061
+ "nulls": "last"
3062
+ }
3063
+ ],
3064
+ "isUnique": false,
3065
+ "concurrently": false,
3066
+ "method": "btree",
3067
+ "with": {}
3068
+ },
3069
+ "segment_name_idx": {
3070
+ "name": "segment_name_idx",
3071
+ "columns": [
3072
+ {
3073
+ "expression": "organization_id",
3074
+ "isExpression": false,
3075
+ "asc": true,
3076
+ "nulls": "last"
3077
+ },
3078
+ {
3079
+ "expression": "name",
3080
+ "isExpression": false,
3081
+ "asc": true,
3082
+ "nulls": "last"
3083
+ }
3084
+ ],
3085
+ "isUnique": false,
3086
+ "concurrently": false,
3087
+ "method": "btree",
3088
+ "with": {}
3089
+ }
3090
+ },
3091
+ "foreignKeys": {
3092
+ "segment_organization_id_organization_id_fk": {
3093
+ "name": "segment_organization_id_organization_id_fk",
3094
+ "tableFrom": "segment",
3095
+ "tableTo": "organization",
3096
+ "columnsFrom": ["organization_id"],
3097
+ "columnsTo": ["id"],
3098
+ "onDelete": "cascade",
3099
+ "onUpdate": "no action"
3100
+ },
3101
+ "segment_created_by_user_id_fk": {
3102
+ "name": "segment_created_by_user_id_fk",
3103
+ "tableFrom": "segment",
3104
+ "tableTo": "user",
3105
+ "columnsFrom": ["created_by"],
3106
+ "columnsTo": ["id"],
3107
+ "onDelete": "no action",
3108
+ "onUpdate": "no action"
3109
+ }
3110
+ },
3111
+ "compositePrimaryKeys": {},
3112
+ "uniqueConstraints": {},
3113
+ "policies": {},
3114
+ "checkConstraints": {},
3115
+ "isRLSEnabled": false
3116
+ },
3117
+ "public.ai_conversation": {
3118
+ "name": "ai_conversation",
3119
+ "schema": "",
3120
+ "columns": {
3121
+ "id": {
3122
+ "name": "id",
3123
+ "type": "text",
3124
+ "primaryKey": true,
3125
+ "notNull": true
3126
+ },
3127
+ "organization_id": {
3128
+ "name": "organization_id",
3129
+ "type": "text",
3130
+ "primaryKey": false,
3131
+ "notNull": true
3132
+ },
3133
+ "template_id": {
3134
+ "name": "template_id",
3135
+ "type": "text",
3136
+ "primaryKey": false,
3137
+ "notNull": false
3138
+ },
3139
+ "messages": {
3140
+ "name": "messages",
3141
+ "type": "jsonb",
3142
+ "primaryKey": false,
3143
+ "notNull": false,
3144
+ "default": "'[]'::jsonb"
3145
+ },
3146
+ "total_tokens": {
3147
+ "name": "total_tokens",
3148
+ "type": "integer",
3149
+ "primaryKey": false,
3150
+ "notNull": true,
3151
+ "default": 0
3152
+ },
3153
+ "created_at": {
3154
+ "name": "created_at",
3155
+ "type": "timestamp",
3156
+ "primaryKey": false,
3157
+ "notNull": true,
3158
+ "default": "now()"
3159
+ },
3160
+ "updated_at": {
3161
+ "name": "updated_at",
3162
+ "type": "timestamp",
3163
+ "primaryKey": false,
3164
+ "notNull": true,
3165
+ "default": "now()"
3166
+ },
3167
+ "created_by": {
3168
+ "name": "created_by",
3169
+ "type": "text",
3170
+ "primaryKey": false,
3171
+ "notNull": true
3172
+ }
3173
+ },
3174
+ "indexes": {
3175
+ "ai_conversation_org_idx": {
3176
+ "name": "ai_conversation_org_idx",
3177
+ "columns": [
3178
+ {
3179
+ "expression": "organization_id",
3180
+ "isExpression": false,
3181
+ "asc": true,
3182
+ "nulls": "last"
3183
+ }
3184
+ ],
3185
+ "isUnique": false,
3186
+ "concurrently": false,
3187
+ "method": "btree",
3188
+ "with": {}
3189
+ },
3190
+ "ai_conversation_template_idx": {
3191
+ "name": "ai_conversation_template_idx",
3192
+ "columns": [
3193
+ {
3194
+ "expression": "template_id",
3195
+ "isExpression": false,
3196
+ "asc": true,
3197
+ "nulls": "last"
3198
+ }
3199
+ ],
3200
+ "isUnique": false,
3201
+ "concurrently": false,
3202
+ "method": "btree",
3203
+ "with": {}
3204
+ }
3205
+ },
3206
+ "foreignKeys": {
3207
+ "ai_conversation_organization_id_organization_id_fk": {
3208
+ "name": "ai_conversation_organization_id_organization_id_fk",
3209
+ "tableFrom": "ai_conversation",
3210
+ "tableTo": "organization",
3211
+ "columnsFrom": ["organization_id"],
3212
+ "columnsTo": ["id"],
3213
+ "onDelete": "cascade",
3214
+ "onUpdate": "no action"
3215
+ },
3216
+ "ai_conversation_template_id_template_id_fk": {
3217
+ "name": "ai_conversation_template_id_template_id_fk",
3218
+ "tableFrom": "ai_conversation",
3219
+ "tableTo": "template",
3220
+ "columnsFrom": ["template_id"],
3221
+ "columnsTo": ["id"],
3222
+ "onDelete": "cascade",
3223
+ "onUpdate": "no action"
3224
+ },
3225
+ "ai_conversation_created_by_user_id_fk": {
3226
+ "name": "ai_conversation_created_by_user_id_fk",
3227
+ "tableFrom": "ai_conversation",
3228
+ "tableTo": "user",
3229
+ "columnsFrom": ["created_by"],
3230
+ "columnsTo": ["id"],
3231
+ "onDelete": "set null",
3232
+ "onUpdate": "no action"
3233
+ }
3234
+ },
3235
+ "compositePrimaryKeys": {},
3236
+ "uniqueConstraints": {},
3237
+ "policies": {},
3238
+ "checkConstraints": {},
3239
+ "isRLSEnabled": false
3240
+ },
3241
+ "public.brand_kit": {
3242
+ "name": "brand_kit",
3243
+ "schema": "",
3244
+ "columns": {
3245
+ "id": {
3246
+ "name": "id",
3247
+ "type": "text",
3248
+ "primaryKey": true,
3249
+ "notNull": true
3250
+ },
3251
+ "organization_id": {
3252
+ "name": "organization_id",
3253
+ "type": "text",
3254
+ "primaryKey": false,
3255
+ "notNull": true
3256
+ },
3257
+ "name": {
3258
+ "name": "name",
3259
+ "type": "text",
3260
+ "primaryKey": false,
3261
+ "notNull": true,
3262
+ "default": "'Default'"
3263
+ },
3264
+ "logo_url": {
3265
+ "name": "logo_url",
3266
+ "type": "text",
3267
+ "primaryKey": false,
3268
+ "notNull": false
3269
+ },
3270
+ "primary_color": {
3271
+ "name": "primary_color",
3272
+ "type": "text",
3273
+ "primaryKey": false,
3274
+ "notNull": true,
3275
+ "default": "'#5046e5'"
3276
+ },
3277
+ "secondary_color": {
3278
+ "name": "secondary_color",
3279
+ "type": "text",
3280
+ "primaryKey": false,
3281
+ "notNull": true,
3282
+ "default": "'#6366f1'"
3283
+ },
3284
+ "background_color": {
3285
+ "name": "background_color",
3286
+ "type": "text",
3287
+ "primaryKey": false,
3288
+ "notNull": true,
3289
+ "default": "'#ffffff'"
3290
+ },
3291
+ "text_color": {
3292
+ "name": "text_color",
3293
+ "type": "text",
3294
+ "primaryKey": false,
3295
+ "notNull": true,
3296
+ "default": "'#1f2937'"
3297
+ },
3298
+ "font_family": {
3299
+ "name": "font_family",
3300
+ "type": "text",
3301
+ "primaryKey": false,
3302
+ "notNull": true,
3303
+ "default": "'system-ui, sans-serif'"
3304
+ },
3305
+ "heading_font_family": {
3306
+ "name": "heading_font_family",
3307
+ "type": "text",
3308
+ "primaryKey": false,
3309
+ "notNull": false
3310
+ },
3311
+ "button_style": {
3312
+ "name": "button_style",
3313
+ "type": "text",
3314
+ "primaryKey": false,
3315
+ "notNull": true,
3316
+ "default": "'rounded'"
3317
+ },
3318
+ "button_radius": {
3319
+ "name": "button_radius",
3320
+ "type": "text",
3321
+ "primaryKey": false,
3322
+ "notNull": true,
3323
+ "default": "'4px'"
3324
+ },
3325
+ "company_name": {
3326
+ "name": "company_name",
3327
+ "type": "text",
3328
+ "primaryKey": false,
3329
+ "notNull": false
3330
+ },
3331
+ "company_address": {
3332
+ "name": "company_address",
3333
+ "type": "text",
3334
+ "primaryKey": false,
3335
+ "notNull": false
3336
+ },
3337
+ "social_links": {
3338
+ "name": "social_links",
3339
+ "type": "jsonb",
3340
+ "primaryKey": false,
3341
+ "notNull": false,
3342
+ "default": "'[]'::jsonb"
3343
+ },
3344
+ "source_domain": {
3345
+ "name": "source_domain",
3346
+ "type": "text",
3347
+ "primaryKey": false,
3348
+ "notNull": false
3349
+ },
3350
+ "auto_extracted": {
3351
+ "name": "auto_extracted",
3352
+ "type": "boolean",
3353
+ "primaryKey": false,
3354
+ "notNull": true,
3355
+ "default": false
3356
+ },
3357
+ "is_default": {
3358
+ "name": "is_default",
3359
+ "type": "boolean",
3360
+ "primaryKey": false,
3361
+ "notNull": true,
3362
+ "default": false
3363
+ },
3364
+ "created_at": {
3365
+ "name": "created_at",
3366
+ "type": "timestamp",
3367
+ "primaryKey": false,
3368
+ "notNull": true,
3369
+ "default": "now()"
3370
+ },
3371
+ "updated_at": {
3372
+ "name": "updated_at",
3373
+ "type": "timestamp",
3374
+ "primaryKey": false,
3375
+ "notNull": true,
3376
+ "default": "now()"
3377
+ }
3378
+ },
3379
+ "indexes": {
3380
+ "brand_kit_org_idx": {
3381
+ "name": "brand_kit_org_idx",
3382
+ "columns": [
3383
+ {
3384
+ "expression": "organization_id",
3385
+ "isExpression": false,
3386
+ "asc": true,
3387
+ "nulls": "last"
3388
+ }
3389
+ ],
3390
+ "isUnique": false,
3391
+ "concurrently": false,
3392
+ "method": "btree",
3393
+ "with": {}
3394
+ },
3395
+ "brand_kit_default_idx": {
3396
+ "name": "brand_kit_default_idx",
3397
+ "columns": [
3398
+ {
3399
+ "expression": "organization_id",
3400
+ "isExpression": false,
3401
+ "asc": true,
3402
+ "nulls": "last"
3403
+ },
3404
+ {
3405
+ "expression": "is_default",
3406
+ "isExpression": false,
3407
+ "asc": true,
3408
+ "nulls": "last"
3409
+ }
3410
+ ],
3411
+ "isUnique": false,
3412
+ "concurrently": false,
3413
+ "method": "btree",
3414
+ "with": {}
3415
+ }
3416
+ },
3417
+ "foreignKeys": {
3418
+ "brand_kit_organization_id_organization_id_fk": {
3419
+ "name": "brand_kit_organization_id_organization_id_fk",
3420
+ "tableFrom": "brand_kit",
3421
+ "tableTo": "organization",
3422
+ "columnsFrom": ["organization_id"],
3423
+ "columnsTo": ["id"],
3424
+ "onDelete": "cascade",
3425
+ "onUpdate": "no action"
3426
+ }
3427
+ },
3428
+ "compositePrimaryKeys": {},
3429
+ "uniqueConstraints": {},
3430
+ "policies": {},
3431
+ "checkConstraints": {},
3432
+ "isRLSEnabled": false
3433
+ },
3434
+ "public.reusable_block": {
3435
+ "name": "reusable_block",
3436
+ "schema": "",
3437
+ "columns": {
3438
+ "id": {
3439
+ "name": "id",
3440
+ "type": "text",
3441
+ "primaryKey": true,
3442
+ "notNull": true
3443
+ },
3444
+ "organization_id": {
3445
+ "name": "organization_id",
3446
+ "type": "text",
3447
+ "primaryKey": false,
3448
+ "notNull": true
3449
+ },
3450
+ "name": {
3451
+ "name": "name",
3452
+ "type": "text",
3453
+ "primaryKey": false,
3454
+ "notNull": true
3455
+ },
3456
+ "description": {
3457
+ "name": "description",
3458
+ "type": "text",
3459
+ "primaryKey": false,
3460
+ "notNull": false
3461
+ },
3462
+ "category": {
3463
+ "name": "category",
3464
+ "type": "text",
3465
+ "primaryKey": false,
3466
+ "notNull": true,
3467
+ "default": "'custom'"
3468
+ },
3469
+ "content": {
3470
+ "name": "content",
3471
+ "type": "jsonb",
3472
+ "primaryKey": false,
3473
+ "notNull": true
3474
+ },
3475
+ "thumbnail": {
3476
+ "name": "thumbnail",
3477
+ "type": "text",
3478
+ "primaryKey": false,
3479
+ "notNull": false
3480
+ },
3481
+ "is_public": {
3482
+ "name": "is_public",
3483
+ "type": "boolean",
3484
+ "primaryKey": false,
3485
+ "notNull": true,
3486
+ "default": false
3487
+ },
3488
+ "usage_count": {
3489
+ "name": "usage_count",
3490
+ "type": "integer",
3491
+ "primaryKey": false,
3492
+ "notNull": true,
3493
+ "default": 0
3494
+ },
3495
+ "created_at": {
3496
+ "name": "created_at",
3497
+ "type": "timestamp",
3498
+ "primaryKey": false,
3499
+ "notNull": true,
3500
+ "default": "now()"
3501
+ },
3502
+ "updated_at": {
3503
+ "name": "updated_at",
3504
+ "type": "timestamp",
3505
+ "primaryKey": false,
3506
+ "notNull": true,
3507
+ "default": "now()"
3508
+ },
3509
+ "created_by": {
3510
+ "name": "created_by",
3511
+ "type": "text",
3512
+ "primaryKey": false,
3513
+ "notNull": true
3514
+ }
3515
+ },
3516
+ "indexes": {
3517
+ "reusable_block_org_idx": {
3518
+ "name": "reusable_block_org_idx",
3519
+ "columns": [
3520
+ {
3521
+ "expression": "organization_id",
3522
+ "isExpression": false,
3523
+ "asc": true,
3524
+ "nulls": "last"
3525
+ }
3526
+ ],
3527
+ "isUnique": false,
3528
+ "concurrently": false,
3529
+ "method": "btree",
3530
+ "with": {}
3531
+ },
3532
+ "reusable_block_created_by_category_idx": {
3533
+ "name": "reusable_block_created_by_category_idx",
3534
+ "columns": [
3535
+ {
3536
+ "expression": "created_by",
3537
+ "isExpression": false,
3538
+ "asc": true,
3539
+ "nulls": "last"
3540
+ },
3541
+ {
3542
+ "expression": "category",
3543
+ "isExpression": false,
3544
+ "asc": true,
3545
+ "nulls": "last"
3546
+ }
3547
+ ],
3548
+ "isUnique": false,
3549
+ "concurrently": false,
3550
+ "method": "btree",
3551
+ "with": {}
3552
+ },
3553
+ "reusable_block_public_category_idx": {
3554
+ "name": "reusable_block_public_category_idx",
3555
+ "columns": [
3556
+ {
3557
+ "expression": "is_public",
3558
+ "isExpression": false,
3559
+ "asc": true,
3560
+ "nulls": "last"
3561
+ },
3562
+ {
3563
+ "expression": "category",
3564
+ "isExpression": false,
3565
+ "asc": true,
3566
+ "nulls": "last"
3567
+ }
3568
+ ],
3569
+ "isUnique": false,
3570
+ "concurrently": false,
3571
+ "method": "btree",
3572
+ "with": {}
3573
+ }
3574
+ },
3575
+ "foreignKeys": {
3576
+ "reusable_block_organization_id_organization_id_fk": {
3577
+ "name": "reusable_block_organization_id_organization_id_fk",
3578
+ "tableFrom": "reusable_block",
3579
+ "tableTo": "organization",
3580
+ "columnsFrom": ["organization_id"],
3581
+ "columnsTo": ["id"],
3582
+ "onDelete": "cascade",
3583
+ "onUpdate": "no action"
3584
+ },
3585
+ "reusable_block_created_by_user_id_fk": {
3586
+ "name": "reusable_block_created_by_user_id_fk",
3587
+ "tableFrom": "reusable_block",
3588
+ "tableTo": "user",
3589
+ "columnsFrom": ["created_by"],
3590
+ "columnsTo": ["id"],
3591
+ "onDelete": "set null",
3592
+ "onUpdate": "no action"
3593
+ }
3594
+ },
3595
+ "compositePrimaryKeys": {},
3596
+ "uniqueConstraints": {},
3597
+ "policies": {},
3598
+ "checkConstraints": {},
3599
+ "isRLSEnabled": false
3600
+ },
3601
+ "public.template": {
3602
+ "name": "template",
3603
+ "schema": "",
3604
+ "columns": {
3605
+ "id": {
3606
+ "name": "id",
3607
+ "type": "text",
3608
+ "primaryKey": true,
3609
+ "notNull": true
3610
+ },
3611
+ "organization_id": {
3612
+ "name": "organization_id",
3613
+ "type": "text",
3614
+ "primaryKey": false,
3615
+ "notNull": true
3616
+ },
3617
+ "name": {
3618
+ "name": "name",
3619
+ "type": "text",
3620
+ "primaryKey": false,
3621
+ "notNull": true
3622
+ },
3623
+ "description": {
3624
+ "name": "description",
3625
+ "type": "text",
3626
+ "primaryKey": false,
3627
+ "notNull": false
3628
+ },
3629
+ "subject": {
3630
+ "name": "subject",
3631
+ "type": "text",
3632
+ "primaryKey": false,
3633
+ "notNull": false
3634
+ },
3635
+ "content": {
3636
+ "name": "content",
3637
+ "type": "jsonb",
3638
+ "primaryKey": false,
3639
+ "notNull": true
3640
+ },
3641
+ "compiled_html": {
3642
+ "name": "compiled_html",
3643
+ "type": "text",
3644
+ "primaryKey": false,
3645
+ "notNull": false
3646
+ },
3647
+ "compiled_text": {
3648
+ "name": "compiled_text",
3649
+ "type": "text",
3650
+ "primaryKey": false,
3651
+ "notNull": false
3652
+ },
3653
+ "variables": {
3654
+ "name": "variables",
3655
+ "type": "jsonb",
3656
+ "primaryKey": false,
3657
+ "notNull": false,
3658
+ "default": "'[]'::jsonb"
3659
+ },
3660
+ "test_data": {
3661
+ "name": "test_data",
3662
+ "type": "jsonb",
3663
+ "primaryKey": false,
3664
+ "notNull": false,
3665
+ "default": "'{}'::jsonb"
3666
+ },
3667
+ "room_id": {
3668
+ "name": "room_id",
3669
+ "type": "text",
3670
+ "primaryKey": false,
3671
+ "notNull": false
3672
+ },
3673
+ "is_collaborative": {
3674
+ "name": "is_collaborative",
3675
+ "type": "boolean",
3676
+ "primaryKey": false,
3677
+ "notNull": true,
3678
+ "default": false
3679
+ },
3680
+ "ai_generated": {
3681
+ "name": "ai_generated",
3682
+ "type": "boolean",
3683
+ "primaryKey": false,
3684
+ "notNull": true,
3685
+ "default": false
3686
+ },
3687
+ "ai_conversation_id": {
3688
+ "name": "ai_conversation_id",
3689
+ "type": "text",
3690
+ "primaryKey": false,
3691
+ "notNull": false
3692
+ },
3693
+ "ses_template_name": {
3694
+ "name": "ses_template_name",
3695
+ "type": "text",
3696
+ "primaryKey": false,
3697
+ "notNull": false
3698
+ },
3699
+ "published_at": {
3700
+ "name": "published_at",
3701
+ "type": "timestamp",
3702
+ "primaryKey": false,
3703
+ "notNull": false
3704
+ },
3705
+ "status": {
3706
+ "name": "status",
3707
+ "type": "template_status",
3708
+ "typeSchema": "public",
3709
+ "primaryKey": false,
3710
+ "notNull": true,
3711
+ "default": "'DRAFT'"
3712
+ },
3713
+ "created_at": {
3714
+ "name": "created_at",
3715
+ "type": "timestamp",
3716
+ "primaryKey": false,
3717
+ "notNull": true,
3718
+ "default": "now()"
3719
+ },
3720
+ "updated_at": {
3721
+ "name": "updated_at",
3722
+ "type": "timestamp",
3723
+ "primaryKey": false,
3724
+ "notNull": true,
3725
+ "default": "now()"
3726
+ },
3727
+ "created_by": {
3728
+ "name": "created_by",
3729
+ "type": "text",
3730
+ "primaryKey": false,
3731
+ "notNull": true
3732
+ },
3733
+ "last_edited_by": {
3734
+ "name": "last_edited_by",
3735
+ "type": "text",
3736
+ "primaryKey": false,
3737
+ "notNull": false
3738
+ }
3739
+ },
3740
+ "indexes": {
3741
+ "template_org_idx": {
3742
+ "name": "template_org_idx",
3743
+ "columns": [
3744
+ {
3745
+ "expression": "organization_id",
3746
+ "isExpression": false,
3747
+ "asc": true,
3748
+ "nulls": "last"
3749
+ }
3750
+ ],
3751
+ "isUnique": false,
3752
+ "concurrently": false,
3753
+ "method": "btree",
3754
+ "with": {}
3755
+ },
3756
+ "template_status_updated_at_idx": {
3757
+ "name": "template_status_updated_at_idx",
3758
+ "columns": [
3759
+ {
3760
+ "expression": "status",
3761
+ "isExpression": false,
3762
+ "asc": true,
3763
+ "nulls": "last"
3764
+ },
3765
+ {
3766
+ "expression": "updated_at",
3767
+ "isExpression": false,
3768
+ "asc": true,
3769
+ "nulls": "last"
3770
+ }
3771
+ ],
3772
+ "isUnique": false,
3773
+ "concurrently": false,
3774
+ "method": "btree",
3775
+ "with": {}
3776
+ },
3777
+ "template_created_by_idx": {
3778
+ "name": "template_created_by_idx",
3779
+ "columns": [
3780
+ {
3781
+ "expression": "created_by",
3782
+ "isExpression": false,
3783
+ "asc": true,
3784
+ "nulls": "last"
3785
+ }
3786
+ ],
3787
+ "isUnique": false,
3788
+ "concurrently": false,
3789
+ "method": "btree",
3790
+ "with": {}
3791
+ },
3792
+ "template_room_id_idx": {
3793
+ "name": "template_room_id_idx",
3794
+ "columns": [
3795
+ {
3796
+ "expression": "room_id",
3797
+ "isExpression": false,
3798
+ "asc": true,
3799
+ "nulls": "last"
3800
+ }
3801
+ ],
3802
+ "isUnique": true,
3803
+ "concurrently": false,
3804
+ "method": "btree",
3805
+ "with": {}
3806
+ }
3807
+ },
3808
+ "foreignKeys": {
3809
+ "template_organization_id_organization_id_fk": {
3810
+ "name": "template_organization_id_organization_id_fk",
3811
+ "tableFrom": "template",
3812
+ "tableTo": "organization",
3813
+ "columnsFrom": ["organization_id"],
3814
+ "columnsTo": ["id"],
3815
+ "onDelete": "cascade",
3816
+ "onUpdate": "no action"
3817
+ },
3818
+ "template_created_by_user_id_fk": {
3819
+ "name": "template_created_by_user_id_fk",
3820
+ "tableFrom": "template",
3821
+ "tableTo": "user",
3822
+ "columnsFrom": ["created_by"],
3823
+ "columnsTo": ["id"],
3824
+ "onDelete": "set null",
3825
+ "onUpdate": "no action"
3826
+ },
3827
+ "template_last_edited_by_user_id_fk": {
3828
+ "name": "template_last_edited_by_user_id_fk",
3829
+ "tableFrom": "template",
3830
+ "tableTo": "user",
3831
+ "columnsFrom": ["last_edited_by"],
3832
+ "columnsTo": ["id"],
3833
+ "onDelete": "set null",
3834
+ "onUpdate": "no action"
3835
+ }
3836
+ },
3837
+ "compositePrimaryKeys": {},
3838
+ "uniqueConstraints": {},
3839
+ "policies": {},
3840
+ "checkConstraints": {},
3841
+ "isRLSEnabled": false
3842
+ },
3843
+ "public.template_variable": {
3844
+ "name": "template_variable",
3845
+ "schema": "",
3846
+ "columns": {
3847
+ "id": {
3848
+ "name": "id",
3849
+ "type": "text",
3850
+ "primaryKey": true,
3851
+ "notNull": true
3852
+ },
3853
+ "organization_id": {
3854
+ "name": "organization_id",
3855
+ "type": "text",
3856
+ "primaryKey": false,
3857
+ "notNull": true
3858
+ },
3859
+ "name": {
3860
+ "name": "name",
3861
+ "type": "text",
3862
+ "primaryKey": false,
3863
+ "notNull": true
3864
+ },
3865
+ "label": {
3866
+ "name": "label",
3867
+ "type": "text",
3868
+ "primaryKey": false,
3869
+ "notNull": true
3870
+ },
3871
+ "type": {
3872
+ "name": "type",
3873
+ "type": "variable_type",
3874
+ "typeSchema": "public",
3875
+ "primaryKey": false,
3876
+ "notNull": true
3877
+ },
3878
+ "required": {
3879
+ "name": "required",
3880
+ "type": "boolean",
3881
+ "primaryKey": false,
3882
+ "notNull": true,
3883
+ "default": false
3884
+ },
3885
+ "fallback": {
3886
+ "name": "fallback",
3887
+ "type": "text",
3888
+ "primaryKey": false,
3889
+ "notNull": false
3890
+ },
3891
+ "validation": {
3892
+ "name": "validation",
3893
+ "type": "jsonb",
3894
+ "primaryKey": false,
3895
+ "notNull": false
3896
+ },
3897
+ "created_at": {
3898
+ "name": "created_at",
3899
+ "type": "timestamp",
3900
+ "primaryKey": false,
3901
+ "notNull": true,
3902
+ "default": "now()"
3903
+ },
3904
+ "updated_at": {
3905
+ "name": "updated_at",
3906
+ "type": "timestamp",
3907
+ "primaryKey": false,
3908
+ "notNull": true,
3909
+ "default": "now()"
3910
+ }
3911
+ },
3912
+ "indexes": {
3913
+ "template_variable_org_name_idx": {
3914
+ "name": "template_variable_org_name_idx",
3915
+ "columns": [
3916
+ {
3917
+ "expression": "organization_id",
3918
+ "isExpression": false,
3919
+ "asc": true,
3920
+ "nulls": "last"
3921
+ },
3922
+ {
3923
+ "expression": "name",
3924
+ "isExpression": false,
3925
+ "asc": true,
3926
+ "nulls": "last"
3927
+ }
3928
+ ],
3929
+ "isUnique": true,
3930
+ "concurrently": false,
3931
+ "method": "btree",
3932
+ "with": {}
3933
+ }
3934
+ },
3935
+ "foreignKeys": {
3936
+ "template_variable_organization_id_organization_id_fk": {
3937
+ "name": "template_variable_organization_id_organization_id_fk",
3938
+ "tableFrom": "template_variable",
3939
+ "tableTo": "organization",
3940
+ "columnsFrom": ["organization_id"],
3941
+ "columnsTo": ["id"],
3942
+ "onDelete": "cascade",
3943
+ "onUpdate": "no action"
3944
+ }
3945
+ },
3946
+ "compositePrimaryKeys": {},
3947
+ "uniqueConstraints": {},
3948
+ "policies": {},
3949
+ "checkConstraints": {},
3950
+ "isRLSEnabled": false
3951
+ },
3952
+ "public.template_version": {
3953
+ "name": "template_version",
3954
+ "schema": "",
3955
+ "columns": {
3956
+ "id": {
3957
+ "name": "id",
3958
+ "type": "text",
3959
+ "primaryKey": true,
3960
+ "notNull": true
3961
+ },
3962
+ "template_id": {
3963
+ "name": "template_id",
3964
+ "type": "text",
3965
+ "primaryKey": false,
3966
+ "notNull": true
3967
+ },
3968
+ "content": {
3969
+ "name": "content",
3970
+ "type": "jsonb",
3971
+ "primaryKey": false,
3972
+ "notNull": true
3973
+ },
3974
+ "version": {
3975
+ "name": "version",
3976
+ "type": "integer",
3977
+ "primaryKey": false,
3978
+ "notNull": true
3979
+ },
3980
+ "created_at": {
3981
+ "name": "created_at",
3982
+ "type": "timestamp",
3983
+ "primaryKey": false,
3984
+ "notNull": true,
3985
+ "default": "now()"
3986
+ },
3987
+ "created_by": {
3988
+ "name": "created_by",
3989
+ "type": "text",
3990
+ "primaryKey": false,
3991
+ "notNull": true
3992
+ },
3993
+ "change_note": {
3994
+ "name": "change_note",
3995
+ "type": "text",
3996
+ "primaryKey": false,
3997
+ "notNull": false
3998
+ }
3999
+ },
4000
+ "indexes": {
4001
+ "template_version_template_version_idx": {
4002
+ "name": "template_version_template_version_idx",
4003
+ "columns": [
4004
+ {
4005
+ "expression": "template_id",
4006
+ "isExpression": false,
4007
+ "asc": true,
4008
+ "nulls": "last"
4009
+ },
4010
+ {
4011
+ "expression": "version",
4012
+ "isExpression": false,
4013
+ "asc": true,
4014
+ "nulls": "last"
4015
+ }
4016
+ ],
4017
+ "isUnique": true,
4018
+ "concurrently": false,
4019
+ "method": "btree",
4020
+ "with": {}
4021
+ },
4022
+ "template_version_template_created_at_idx": {
4023
+ "name": "template_version_template_created_at_idx",
4024
+ "columns": [
4025
+ {
4026
+ "expression": "template_id",
4027
+ "isExpression": false,
4028
+ "asc": true,
4029
+ "nulls": "last"
4030
+ },
4031
+ {
4032
+ "expression": "created_at",
4033
+ "isExpression": false,
4034
+ "asc": true,
4035
+ "nulls": "last"
4036
+ }
4037
+ ],
4038
+ "isUnique": false,
4039
+ "concurrently": false,
4040
+ "method": "btree",
4041
+ "with": {}
4042
+ }
4043
+ },
4044
+ "foreignKeys": {
4045
+ "template_version_template_id_template_id_fk": {
4046
+ "name": "template_version_template_id_template_id_fk",
4047
+ "tableFrom": "template_version",
4048
+ "tableTo": "template",
4049
+ "columnsFrom": ["template_id"],
4050
+ "columnsTo": ["id"],
4051
+ "onDelete": "cascade",
4052
+ "onUpdate": "no action"
4053
+ },
4054
+ "template_version_created_by_user_id_fk": {
4055
+ "name": "template_version_created_by_user_id_fk",
4056
+ "tableFrom": "template_version",
4057
+ "tableTo": "user",
4058
+ "columnsFrom": ["created_by"],
4059
+ "columnsTo": ["id"],
4060
+ "onDelete": "set null",
4061
+ "onUpdate": "no action"
4062
+ }
4063
+ },
4064
+ "compositePrimaryKeys": {},
4065
+ "uniqueConstraints": {},
4066
+ "policies": {},
4067
+ "checkConstraints": {},
4068
+ "isRLSEnabled": false
4069
+ },
4070
+ "public.ai_usage_log": {
4071
+ "name": "ai_usage_log",
4072
+ "schema": "",
4073
+ "columns": {
4074
+ "id": {
4075
+ "name": "id",
4076
+ "type": "text",
4077
+ "primaryKey": true,
4078
+ "notNull": true
4079
+ },
4080
+ "organization_id": {
4081
+ "name": "organization_id",
4082
+ "type": "text",
4083
+ "primaryKey": false,
4084
+ "notNull": true
4085
+ },
4086
+ "user_id": {
4087
+ "name": "user_id",
4088
+ "type": "text",
4089
+ "primaryKey": false,
4090
+ "notNull": false
4091
+ },
4092
+ "period_key": {
4093
+ "name": "period_key",
4094
+ "type": "text",
4095
+ "primaryKey": false,
4096
+ "notNull": true
4097
+ },
4098
+ "feature_type": {
4099
+ "name": "feature_type",
4100
+ "type": "text",
4101
+ "primaryKey": false,
4102
+ "notNull": true,
4103
+ "default": "'ai_chat'"
4104
+ },
4105
+ "template_id": {
4106
+ "name": "template_id",
4107
+ "type": "text",
4108
+ "primaryKey": false,
4109
+ "notNull": false
4110
+ },
4111
+ "input_tokens": {
4112
+ "name": "input_tokens",
4113
+ "type": "integer",
4114
+ "primaryKey": false,
4115
+ "notNull": false
4116
+ },
4117
+ "output_tokens": {
4118
+ "name": "output_tokens",
4119
+ "type": "integer",
4120
+ "primaryKey": false,
4121
+ "notNull": false
4122
+ },
4123
+ "total_tokens": {
4124
+ "name": "total_tokens",
4125
+ "type": "integer",
4126
+ "primaryKey": false,
4127
+ "notNull": false
4128
+ },
4129
+ "model": {
4130
+ "name": "model",
4131
+ "type": "text",
4132
+ "primaryKey": false,
4133
+ "notNull": false
4134
+ },
4135
+ "duration_ms": {
4136
+ "name": "duration_ms",
4137
+ "type": "integer",
4138
+ "primaryKey": false,
4139
+ "notNull": false
4140
+ },
4141
+ "created_at": {
4142
+ "name": "created_at",
4143
+ "type": "timestamp",
4144
+ "primaryKey": false,
4145
+ "notNull": true,
4146
+ "default": "now()"
4147
+ }
4148
+ },
4149
+ "indexes": {
4150
+ "ai_usage_log_org_idx": {
4151
+ "name": "ai_usage_log_org_idx",
4152
+ "columns": [
4153
+ {
4154
+ "expression": "organization_id",
4155
+ "isExpression": false,
4156
+ "asc": true,
4157
+ "nulls": "last"
4158
+ }
4159
+ ],
4160
+ "isUnique": false,
4161
+ "concurrently": false,
4162
+ "method": "btree",
4163
+ "with": {}
4164
+ },
4165
+ "ai_usage_log_period_idx": {
4166
+ "name": "ai_usage_log_period_idx",
4167
+ "columns": [
4168
+ {
4169
+ "expression": "period_key",
4170
+ "isExpression": false,
4171
+ "asc": true,
4172
+ "nulls": "last"
4173
+ }
4174
+ ],
4175
+ "isUnique": false,
4176
+ "concurrently": false,
4177
+ "method": "btree",
4178
+ "with": {}
4179
+ },
4180
+ "ai_usage_log_org_period_idx": {
4181
+ "name": "ai_usage_log_org_period_idx",
4182
+ "columns": [
4183
+ {
4184
+ "expression": "organization_id",
4185
+ "isExpression": false,
4186
+ "asc": true,
4187
+ "nulls": "last"
4188
+ },
4189
+ {
4190
+ "expression": "period_key",
4191
+ "isExpression": false,
4192
+ "asc": true,
4193
+ "nulls": "last"
4194
+ }
4195
+ ],
4196
+ "isUnique": false,
4197
+ "concurrently": false,
4198
+ "method": "btree",
4199
+ "with": {}
4200
+ },
4201
+ "ai_usage_log_user_idx": {
4202
+ "name": "ai_usage_log_user_idx",
4203
+ "columns": [
4204
+ {
4205
+ "expression": "user_id",
4206
+ "isExpression": false,
4207
+ "asc": true,
4208
+ "nulls": "last"
4209
+ }
4210
+ ],
4211
+ "isUnique": false,
4212
+ "concurrently": false,
4213
+ "method": "btree",
4214
+ "with": {}
4215
+ },
4216
+ "ai_usage_log_created_idx": {
4217
+ "name": "ai_usage_log_created_idx",
4218
+ "columns": [
4219
+ {
4220
+ "expression": "created_at",
4221
+ "isExpression": false,
4222
+ "asc": true,
4223
+ "nulls": "last"
4224
+ }
4225
+ ],
4226
+ "isUnique": false,
4227
+ "concurrently": false,
4228
+ "method": "btree",
4229
+ "with": {}
4230
+ }
4231
+ },
4232
+ "foreignKeys": {
4233
+ "ai_usage_log_organization_id_organization_id_fk": {
4234
+ "name": "ai_usage_log_organization_id_organization_id_fk",
4235
+ "tableFrom": "ai_usage_log",
4236
+ "tableTo": "organization",
4237
+ "columnsFrom": ["organization_id"],
4238
+ "columnsTo": ["id"],
4239
+ "onDelete": "cascade",
4240
+ "onUpdate": "no action"
4241
+ },
4242
+ "ai_usage_log_user_id_user_id_fk": {
4243
+ "name": "ai_usage_log_user_id_user_id_fk",
4244
+ "tableFrom": "ai_usage_log",
4245
+ "tableTo": "user",
4246
+ "columnsFrom": ["user_id"],
4247
+ "columnsTo": ["id"],
4248
+ "onDelete": "set null",
4249
+ "onUpdate": "no action"
4250
+ }
4251
+ },
4252
+ "compositePrimaryKeys": {},
4253
+ "uniqueConstraints": {},
4254
+ "policies": {},
4255
+ "checkConstraints": {},
4256
+ "isRLSEnabled": false
4257
+ },
4258
+ "public.ai_usage_monthly": {
4259
+ "name": "ai_usage_monthly",
4260
+ "schema": "",
4261
+ "columns": {
4262
+ "id": {
4263
+ "name": "id",
4264
+ "type": "text",
4265
+ "primaryKey": true,
4266
+ "notNull": true
4267
+ },
4268
+ "organization_id": {
4269
+ "name": "organization_id",
4270
+ "type": "text",
4271
+ "primaryKey": false,
4272
+ "notNull": true
4273
+ },
4274
+ "period_key": {
4275
+ "name": "period_key",
4276
+ "type": "text",
4277
+ "primaryKey": false,
4278
+ "notNull": true
4279
+ },
4280
+ "message_count": {
4281
+ "name": "message_count",
4282
+ "type": "integer",
4283
+ "primaryKey": false,
4284
+ "notNull": true,
4285
+ "default": 0
4286
+ },
4287
+ "updated_at": {
4288
+ "name": "updated_at",
4289
+ "type": "timestamp",
4290
+ "primaryKey": false,
4291
+ "notNull": true,
4292
+ "default": "now()"
4293
+ }
4294
+ },
4295
+ "indexes": {
4296
+ "ai_usage_monthly_org_period_idx": {
4297
+ "name": "ai_usage_monthly_org_period_idx",
4298
+ "columns": [
4299
+ {
4300
+ "expression": "organization_id",
4301
+ "isExpression": false,
4302
+ "asc": true,
4303
+ "nulls": "last"
4304
+ },
4305
+ {
4306
+ "expression": "period_key",
4307
+ "isExpression": false,
4308
+ "asc": true,
4309
+ "nulls": "last"
4310
+ }
4311
+ ],
4312
+ "isUnique": true,
4313
+ "concurrently": false,
4314
+ "method": "btree",
4315
+ "with": {}
4316
+ },
4317
+ "ai_usage_monthly_period_idx": {
4318
+ "name": "ai_usage_monthly_period_idx",
4319
+ "columns": [
4320
+ {
4321
+ "expression": "period_key",
4322
+ "isExpression": false,
4323
+ "asc": true,
4324
+ "nulls": "last"
4325
+ }
4326
+ ],
4327
+ "isUnique": false,
4328
+ "concurrently": false,
4329
+ "method": "btree",
4330
+ "with": {}
4331
+ }
4332
+ },
4333
+ "foreignKeys": {
4334
+ "ai_usage_monthly_organization_id_organization_id_fk": {
4335
+ "name": "ai_usage_monthly_organization_id_organization_id_fk",
4336
+ "tableFrom": "ai_usage_monthly",
4337
+ "tableTo": "organization",
4338
+ "columnsFrom": ["organization_id"],
4339
+ "columnsTo": ["id"],
4340
+ "onDelete": "cascade",
4341
+ "onUpdate": "no action"
4342
+ }
4343
+ },
4344
+ "compositePrimaryKeys": {},
4345
+ "uniqueConstraints": {},
4346
+ "policies": {},
4347
+ "checkConstraints": {},
4348
+ "isRLSEnabled": false
4349
+ },
4350
+ "public.api_rate_limit_window": {
4351
+ "name": "api_rate_limit_window",
4352
+ "schema": "",
4353
+ "columns": {
4354
+ "id": {
4355
+ "name": "id",
4356
+ "type": "text",
4357
+ "primaryKey": true,
4358
+ "notNull": true
4359
+ },
4360
+ "organization_id": {
4361
+ "name": "organization_id",
4362
+ "type": "text",
4363
+ "primaryKey": false,
4364
+ "notNull": true
4365
+ },
4366
+ "minute_key": {
4367
+ "name": "minute_key",
4368
+ "type": "text",
4369
+ "primaryKey": false,
4370
+ "notNull": true
4371
+ },
4372
+ "request_count": {
4373
+ "name": "request_count",
4374
+ "type": "integer",
4375
+ "primaryKey": false,
4376
+ "notNull": true,
4377
+ "default": 0
4378
+ },
4379
+ "expires_at": {
4380
+ "name": "expires_at",
4381
+ "type": "timestamp",
4382
+ "primaryKey": false,
4383
+ "notNull": true
4384
+ }
4385
+ },
4386
+ "indexes": {
4387
+ "api_rate_limit_org_minute_idx": {
4388
+ "name": "api_rate_limit_org_minute_idx",
4389
+ "columns": [
4390
+ {
4391
+ "expression": "organization_id",
4392
+ "isExpression": false,
4393
+ "asc": true,
4394
+ "nulls": "last"
4395
+ },
4396
+ {
4397
+ "expression": "minute_key",
4398
+ "isExpression": false,
4399
+ "asc": true,
4400
+ "nulls": "last"
4401
+ }
4402
+ ],
4403
+ "isUnique": true,
4404
+ "concurrently": false,
4405
+ "method": "btree",
4406
+ "with": {}
4407
+ },
4408
+ "api_rate_limit_expires_idx": {
4409
+ "name": "api_rate_limit_expires_idx",
4410
+ "columns": [
4411
+ {
4412
+ "expression": "expires_at",
4413
+ "isExpression": false,
4414
+ "asc": true,
4415
+ "nulls": "last"
4416
+ }
4417
+ ],
4418
+ "isUnique": false,
4419
+ "concurrently": false,
4420
+ "method": "btree",
4421
+ "with": {}
4422
+ }
4423
+ },
4424
+ "foreignKeys": {
4425
+ "api_rate_limit_window_organization_id_organization_id_fk": {
4426
+ "name": "api_rate_limit_window_organization_id_organization_id_fk",
4427
+ "tableFrom": "api_rate_limit_window",
4428
+ "tableTo": "organization",
4429
+ "columnsFrom": ["organization_id"],
4430
+ "columnsTo": ["id"],
4431
+ "onDelete": "cascade",
4432
+ "onUpdate": "no action"
4433
+ }
4434
+ },
4435
+ "compositePrimaryKeys": {},
4436
+ "uniqueConstraints": {},
4437
+ "policies": {},
4438
+ "checkConstraints": {},
4439
+ "isRLSEnabled": false
4440
+ },
4441
+ "public.api_usage_daily": {
4442
+ "name": "api_usage_daily",
4443
+ "schema": "",
4444
+ "columns": {
4445
+ "id": {
4446
+ "name": "id",
4447
+ "type": "text",
4448
+ "primaryKey": true,
4449
+ "notNull": true
4450
+ },
4451
+ "organization_id": {
4452
+ "name": "organization_id",
4453
+ "type": "text",
4454
+ "primaryKey": false,
4455
+ "notNull": true
4456
+ },
4457
+ "date_key": {
4458
+ "name": "date_key",
4459
+ "type": "text",
4460
+ "primaryKey": false,
4461
+ "notNull": true
4462
+ },
4463
+ "request_count": {
4464
+ "name": "request_count",
4465
+ "type": "integer",
4466
+ "primaryKey": false,
4467
+ "notNull": true,
4468
+ "default": 0
4469
+ },
4470
+ "updated_at": {
4471
+ "name": "updated_at",
4472
+ "type": "timestamp",
4473
+ "primaryKey": false,
4474
+ "notNull": true,
4475
+ "default": "now()"
4476
+ }
4477
+ },
4478
+ "indexes": {
4479
+ "api_usage_daily_org_date_idx": {
4480
+ "name": "api_usage_daily_org_date_idx",
4481
+ "columns": [
4482
+ {
4483
+ "expression": "organization_id",
4484
+ "isExpression": false,
4485
+ "asc": true,
4486
+ "nulls": "last"
4487
+ },
4488
+ {
4489
+ "expression": "date_key",
4490
+ "isExpression": false,
4491
+ "asc": true,
4492
+ "nulls": "last"
4493
+ }
4494
+ ],
4495
+ "isUnique": true,
4496
+ "concurrently": false,
4497
+ "method": "btree",
4498
+ "with": {}
4499
+ },
4500
+ "api_usage_daily_date_idx": {
4501
+ "name": "api_usage_daily_date_idx",
4502
+ "columns": [
4503
+ {
4504
+ "expression": "date_key",
4505
+ "isExpression": false,
4506
+ "asc": true,
4507
+ "nulls": "last"
4508
+ }
4509
+ ],
4510
+ "isUnique": false,
4511
+ "concurrently": false,
4512
+ "method": "btree",
4513
+ "with": {}
4514
+ }
4515
+ },
4516
+ "foreignKeys": {
4517
+ "api_usage_daily_organization_id_organization_id_fk": {
4518
+ "name": "api_usage_daily_organization_id_organization_id_fk",
4519
+ "tableFrom": "api_usage_daily",
4520
+ "tableTo": "organization",
4521
+ "columnsFrom": ["organization_id"],
4522
+ "columnsTo": ["id"],
4523
+ "onDelete": "cascade",
4524
+ "onUpdate": "no action"
4525
+ }
4526
+ },
4527
+ "compositePrimaryKeys": {},
4528
+ "uniqueConstraints": {},
4529
+ "policies": {},
4530
+ "checkConstraints": {},
4531
+ "isRLSEnabled": false
4532
+ },
4533
+ "public.waitlist": {
4534
+ "name": "waitlist",
4535
+ "schema": "",
4536
+ "columns": {
4537
+ "id": {
4538
+ "name": "id",
4539
+ "type": "text",
4540
+ "primaryKey": true,
4541
+ "notNull": true
4542
+ },
4543
+ "email": {
4544
+ "name": "email",
4545
+ "type": "text",
4546
+ "primaryKey": false,
4547
+ "notNull": true
4548
+ },
4549
+ "email_hash": {
4550
+ "name": "email_hash",
4551
+ "type": "text",
4552
+ "primaryKey": false,
4553
+ "notNull": true
4554
+ },
4555
+ "product": {
4556
+ "name": "product",
4557
+ "type": "text",
4558
+ "primaryKey": false,
4559
+ "notNull": true
4560
+ },
4561
+ "source": {
4562
+ "name": "source",
4563
+ "type": "text",
4564
+ "primaryKey": false,
4565
+ "notNull": false
4566
+ },
4567
+ "referrer": {
4568
+ "name": "referrer",
4569
+ "type": "text",
4570
+ "primaryKey": false,
4571
+ "notNull": false
4572
+ },
4573
+ "created_at": {
4574
+ "name": "created_at",
4575
+ "type": "timestamp",
4576
+ "primaryKey": false,
4577
+ "notNull": true,
4578
+ "default": "now()"
4579
+ }
4580
+ },
4581
+ "indexes": {
4582
+ "waitlist_email_product_idx": {
4583
+ "name": "waitlist_email_product_idx",
4584
+ "columns": [
4585
+ {
4586
+ "expression": "email_hash",
4587
+ "isExpression": false,
4588
+ "asc": true,
4589
+ "nulls": "last"
4590
+ },
4591
+ {
4592
+ "expression": "product",
4593
+ "isExpression": false,
4594
+ "asc": true,
4595
+ "nulls": "last"
4596
+ }
4597
+ ],
4598
+ "isUnique": true,
4599
+ "concurrently": false,
4600
+ "method": "btree",
4601
+ "with": {}
4602
+ },
4603
+ "waitlist_product_idx": {
4604
+ "name": "waitlist_product_idx",
4605
+ "columns": [
4606
+ {
4607
+ "expression": "product",
4608
+ "isExpression": false,
4609
+ "asc": true,
4610
+ "nulls": "last"
4611
+ }
4612
+ ],
4613
+ "isUnique": false,
4614
+ "concurrently": false,
4615
+ "method": "btree",
4616
+ "with": {}
4617
+ },
4618
+ "waitlist_created_at_idx": {
4619
+ "name": "waitlist_created_at_idx",
4620
+ "columns": [
4621
+ {
4622
+ "expression": "created_at",
4623
+ "isExpression": false,
4624
+ "asc": true,
4625
+ "nulls": "last"
4626
+ }
4627
+ ],
4628
+ "isUnique": false,
4629
+ "concurrently": false,
4630
+ "method": "btree",
4631
+ "with": {}
4632
+ }
4633
+ },
4634
+ "foreignKeys": {},
4635
+ "compositePrimaryKeys": {},
4636
+ "uniqueConstraints": {},
4637
+ "policies": {},
4638
+ "checkConstraints": {},
4639
+ "isRLSEnabled": false
4640
+ }
4641
+ },
4642
+ "enums": {
4643
+ "public.batch_send_status": {
4644
+ "name": "batch_send_status",
4645
+ "schema": "public",
4646
+ "values": [
4647
+ "draft",
4648
+ "queued",
4649
+ "processing",
4650
+ "completed",
4651
+ "failed",
4652
+ "cancelled"
4653
+ ]
4654
+ },
4655
+ "public.message_send_status": {
4656
+ "name": "message_send_status",
4657
+ "schema": "public",
4658
+ "values": [
4659
+ "pending",
4660
+ "queued",
4661
+ "sent",
4662
+ "delivered",
4663
+ "opened",
4664
+ "clicked",
4665
+ "bounced",
4666
+ "complained",
4667
+ "failed",
4668
+ "opted_out"
4669
+ ]
4670
+ },
4671
+ "public.message_source_type": {
4672
+ "name": "message_source_type",
4673
+ "schema": "public",
4674
+ "values": ["transactional", "batch", "campaign", "workflow"]
4675
+ },
4676
+ "public.template_status": {
4677
+ "name": "template_status",
4678
+ "schema": "public",
4679
+ "values": ["DRAFT", "PUBLISHED", "ARCHIVED"]
4680
+ },
4681
+ "public.variable_type": {
4682
+ "name": "variable_type",
4683
+ "schema": "public",
4684
+ "values": ["TEXT", "NUMBER", "BOOLEAN", "DATE", "URL", "EMAIL"]
4685
+ }
4686
+ },
4687
+ "schemas": {},
4688
+ "sequences": {},
4689
+ "roles": {},
4690
+ "policies": {},
4691
+ "views": {},
4692
+ "_meta": {
4693
+ "columns": {},
4694
+ "schemas": {},
4695
+ "tables": {}
4696
+ }
4697
+ }