@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,4840 @@
1
+ {
2
+ "id": "c63d841e-866d-430d-bc3a-1e448bbbca07",
3
+ "prevId": "1a1e4b8e-01ac-4bae-ab59-c6e7f6f18112",
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
+ "brand_color": {
1043
+ "name": "brand_color",
1044
+ "type": "text",
1045
+ "primaryKey": false,
1046
+ "notNull": false
1047
+ },
1048
+ "metadata": {
1049
+ "name": "metadata",
1050
+ "type": "text",
1051
+ "primaryKey": false,
1052
+ "notNull": false
1053
+ },
1054
+ "created_at": {
1055
+ "name": "created_at",
1056
+ "type": "timestamp",
1057
+ "primaryKey": false,
1058
+ "notNull": true
1059
+ }
1060
+ },
1061
+ "indexes": {},
1062
+ "foreignKeys": {},
1063
+ "compositePrimaryKeys": {},
1064
+ "uniqueConstraints": {
1065
+ "organization_slug_unique": {
1066
+ "name": "organization_slug_unique",
1067
+ "nullsNotDistinct": false,
1068
+ "columns": ["slug"]
1069
+ }
1070
+ },
1071
+ "policies": {},
1072
+ "checkConstraints": {},
1073
+ "isRLSEnabled": false
1074
+ },
1075
+ "public.passkey": {
1076
+ "name": "passkey",
1077
+ "schema": "",
1078
+ "columns": {
1079
+ "id": {
1080
+ "name": "id",
1081
+ "type": "text",
1082
+ "primaryKey": true,
1083
+ "notNull": true
1084
+ },
1085
+ "name": {
1086
+ "name": "name",
1087
+ "type": "text",
1088
+ "primaryKey": false,
1089
+ "notNull": false
1090
+ },
1091
+ "public_key": {
1092
+ "name": "public_key",
1093
+ "type": "text",
1094
+ "primaryKey": false,
1095
+ "notNull": true
1096
+ },
1097
+ "user_id": {
1098
+ "name": "user_id",
1099
+ "type": "text",
1100
+ "primaryKey": false,
1101
+ "notNull": true
1102
+ },
1103
+ "credential_id": {
1104
+ "name": "credential_id",
1105
+ "type": "text",
1106
+ "primaryKey": false,
1107
+ "notNull": true
1108
+ },
1109
+ "counter": {
1110
+ "name": "counter",
1111
+ "type": "integer",
1112
+ "primaryKey": false,
1113
+ "notNull": true
1114
+ },
1115
+ "device_type": {
1116
+ "name": "device_type",
1117
+ "type": "text",
1118
+ "primaryKey": false,
1119
+ "notNull": true
1120
+ },
1121
+ "backed_up": {
1122
+ "name": "backed_up",
1123
+ "type": "boolean",
1124
+ "primaryKey": false,
1125
+ "notNull": true
1126
+ },
1127
+ "transports": {
1128
+ "name": "transports",
1129
+ "type": "text",
1130
+ "primaryKey": false,
1131
+ "notNull": false
1132
+ },
1133
+ "created_at": {
1134
+ "name": "created_at",
1135
+ "type": "timestamp",
1136
+ "primaryKey": false,
1137
+ "notNull": true
1138
+ },
1139
+ "aaguid": {
1140
+ "name": "aaguid",
1141
+ "type": "text",
1142
+ "primaryKey": false,
1143
+ "notNull": false
1144
+ }
1145
+ },
1146
+ "indexes": {},
1147
+ "foreignKeys": {
1148
+ "passkey_user_id_user_id_fk": {
1149
+ "name": "passkey_user_id_user_id_fk",
1150
+ "tableFrom": "passkey",
1151
+ "tableTo": "user",
1152
+ "columnsFrom": ["user_id"],
1153
+ "columnsTo": ["id"],
1154
+ "onDelete": "cascade",
1155
+ "onUpdate": "no action"
1156
+ }
1157
+ },
1158
+ "compositePrimaryKeys": {},
1159
+ "uniqueConstraints": {},
1160
+ "policies": {},
1161
+ "checkConstraints": {},
1162
+ "isRLSEnabled": false
1163
+ },
1164
+ "public.session": {
1165
+ "name": "session",
1166
+ "schema": "",
1167
+ "columns": {
1168
+ "id": {
1169
+ "name": "id",
1170
+ "type": "text",
1171
+ "primaryKey": true,
1172
+ "notNull": true
1173
+ },
1174
+ "expires_at": {
1175
+ "name": "expires_at",
1176
+ "type": "timestamp",
1177
+ "primaryKey": false,
1178
+ "notNull": true
1179
+ },
1180
+ "token": {
1181
+ "name": "token",
1182
+ "type": "text",
1183
+ "primaryKey": false,
1184
+ "notNull": true
1185
+ },
1186
+ "created_at": {
1187
+ "name": "created_at",
1188
+ "type": "timestamp",
1189
+ "primaryKey": false,
1190
+ "notNull": true
1191
+ },
1192
+ "updated_at": {
1193
+ "name": "updated_at",
1194
+ "type": "timestamp",
1195
+ "primaryKey": false,
1196
+ "notNull": true
1197
+ },
1198
+ "ip_address": {
1199
+ "name": "ip_address",
1200
+ "type": "text",
1201
+ "primaryKey": false,
1202
+ "notNull": false
1203
+ },
1204
+ "user_agent": {
1205
+ "name": "user_agent",
1206
+ "type": "text",
1207
+ "primaryKey": false,
1208
+ "notNull": false
1209
+ },
1210
+ "user_id": {
1211
+ "name": "user_id",
1212
+ "type": "text",
1213
+ "primaryKey": false,
1214
+ "notNull": true
1215
+ },
1216
+ "active_organization_id": {
1217
+ "name": "active_organization_id",
1218
+ "type": "text",
1219
+ "primaryKey": false,
1220
+ "notNull": false
1221
+ }
1222
+ },
1223
+ "indexes": {},
1224
+ "foreignKeys": {
1225
+ "session_user_id_user_id_fk": {
1226
+ "name": "session_user_id_user_id_fk",
1227
+ "tableFrom": "session",
1228
+ "tableTo": "user",
1229
+ "columnsFrom": ["user_id"],
1230
+ "columnsTo": ["id"],
1231
+ "onDelete": "cascade",
1232
+ "onUpdate": "no action"
1233
+ }
1234
+ },
1235
+ "compositePrimaryKeys": {},
1236
+ "uniqueConstraints": {
1237
+ "session_token_unique": {
1238
+ "name": "session_token_unique",
1239
+ "nullsNotDistinct": false,
1240
+ "columns": ["token"]
1241
+ }
1242
+ },
1243
+ "policies": {},
1244
+ "checkConstraints": {},
1245
+ "isRLSEnabled": false
1246
+ },
1247
+ "public.statement": {
1248
+ "name": "statement",
1249
+ "schema": "",
1250
+ "columns": {
1251
+ "id": {
1252
+ "name": "id",
1253
+ "type": "text",
1254
+ "primaryKey": true,
1255
+ "notNull": true
1256
+ },
1257
+ "user_id": {
1258
+ "name": "user_id",
1259
+ "type": "text",
1260
+ "primaryKey": false,
1261
+ "notNull": false
1262
+ },
1263
+ "organization_id": {
1264
+ "name": "organization_id",
1265
+ "type": "text",
1266
+ "primaryKey": false,
1267
+ "notNull": false
1268
+ },
1269
+ "role_id": {
1270
+ "name": "role_id",
1271
+ "type": "text",
1272
+ "primaryKey": false,
1273
+ "notNull": false
1274
+ },
1275
+ "effect": {
1276
+ "name": "effect",
1277
+ "type": "text",
1278
+ "primaryKey": false,
1279
+ "notNull": true
1280
+ },
1281
+ "action": {
1282
+ "name": "action",
1283
+ "type": "text",
1284
+ "primaryKey": false,
1285
+ "notNull": true
1286
+ },
1287
+ "resource": {
1288
+ "name": "resource",
1289
+ "type": "text",
1290
+ "primaryKey": false,
1291
+ "notNull": true
1292
+ },
1293
+ "condition": {
1294
+ "name": "condition",
1295
+ "type": "text",
1296
+ "primaryKey": false,
1297
+ "notNull": false
1298
+ },
1299
+ "expires_at": {
1300
+ "name": "expires_at",
1301
+ "type": "timestamp",
1302
+ "primaryKey": false,
1303
+ "notNull": false
1304
+ },
1305
+ "created_at": {
1306
+ "name": "created_at",
1307
+ "type": "timestamp",
1308
+ "primaryKey": false,
1309
+ "notNull": true
1310
+ },
1311
+ "updated_at": {
1312
+ "name": "updated_at",
1313
+ "type": "timestamp",
1314
+ "primaryKey": false,
1315
+ "notNull": true
1316
+ }
1317
+ },
1318
+ "indexes": {},
1319
+ "foreignKeys": {
1320
+ "statement_user_id_user_id_fk": {
1321
+ "name": "statement_user_id_user_id_fk",
1322
+ "tableFrom": "statement",
1323
+ "tableTo": "user",
1324
+ "columnsFrom": ["user_id"],
1325
+ "columnsTo": ["id"],
1326
+ "onDelete": "cascade",
1327
+ "onUpdate": "no action"
1328
+ },
1329
+ "statement_organization_id_organization_id_fk": {
1330
+ "name": "statement_organization_id_organization_id_fk",
1331
+ "tableFrom": "statement",
1332
+ "tableTo": "organization",
1333
+ "columnsFrom": ["organization_id"],
1334
+ "columnsTo": ["id"],
1335
+ "onDelete": "cascade",
1336
+ "onUpdate": "no action"
1337
+ }
1338
+ },
1339
+ "compositePrimaryKeys": {},
1340
+ "uniqueConstraints": {},
1341
+ "policies": {},
1342
+ "checkConstraints": {},
1343
+ "isRLSEnabled": false
1344
+ },
1345
+ "public.subscription": {
1346
+ "name": "subscription",
1347
+ "schema": "",
1348
+ "columns": {
1349
+ "id": {
1350
+ "name": "id",
1351
+ "type": "text",
1352
+ "primaryKey": true,
1353
+ "notNull": true
1354
+ },
1355
+ "plan": {
1356
+ "name": "plan",
1357
+ "type": "text",
1358
+ "primaryKey": false,
1359
+ "notNull": true
1360
+ },
1361
+ "reference_id": {
1362
+ "name": "reference_id",
1363
+ "type": "text",
1364
+ "primaryKey": false,
1365
+ "notNull": true
1366
+ },
1367
+ "stripe_customer_id": {
1368
+ "name": "stripe_customer_id",
1369
+ "type": "text",
1370
+ "primaryKey": false,
1371
+ "notNull": false
1372
+ },
1373
+ "stripe_subscription_id": {
1374
+ "name": "stripe_subscription_id",
1375
+ "type": "text",
1376
+ "primaryKey": false,
1377
+ "notNull": false
1378
+ },
1379
+ "status": {
1380
+ "name": "status",
1381
+ "type": "text",
1382
+ "primaryKey": false,
1383
+ "notNull": true
1384
+ },
1385
+ "period_start": {
1386
+ "name": "period_start",
1387
+ "type": "timestamp",
1388
+ "primaryKey": false,
1389
+ "notNull": false
1390
+ },
1391
+ "period_end": {
1392
+ "name": "period_end",
1393
+ "type": "timestamp",
1394
+ "primaryKey": false,
1395
+ "notNull": false
1396
+ },
1397
+ "cancel_at_period_end": {
1398
+ "name": "cancel_at_period_end",
1399
+ "type": "boolean",
1400
+ "primaryKey": false,
1401
+ "notNull": false
1402
+ },
1403
+ "seats": {
1404
+ "name": "seats",
1405
+ "type": "integer",
1406
+ "primaryKey": false,
1407
+ "notNull": false
1408
+ },
1409
+ "trial_start": {
1410
+ "name": "trial_start",
1411
+ "type": "timestamp",
1412
+ "primaryKey": false,
1413
+ "notNull": false
1414
+ },
1415
+ "trial_end": {
1416
+ "name": "trial_end",
1417
+ "type": "timestamp",
1418
+ "primaryKey": false,
1419
+ "notNull": false
1420
+ },
1421
+ "created_at": {
1422
+ "name": "created_at",
1423
+ "type": "timestamp",
1424
+ "primaryKey": false,
1425
+ "notNull": true,
1426
+ "default": "now()"
1427
+ },
1428
+ "updated_at": {
1429
+ "name": "updated_at",
1430
+ "type": "timestamp",
1431
+ "primaryKey": false,
1432
+ "notNull": true,
1433
+ "default": "now()"
1434
+ }
1435
+ },
1436
+ "indexes": {},
1437
+ "foreignKeys": {},
1438
+ "compositePrimaryKeys": {},
1439
+ "uniqueConstraints": {},
1440
+ "policies": {},
1441
+ "checkConstraints": {},
1442
+ "isRLSEnabled": false
1443
+ },
1444
+ "public.two_factor": {
1445
+ "name": "two_factor",
1446
+ "schema": "",
1447
+ "columns": {
1448
+ "id": {
1449
+ "name": "id",
1450
+ "type": "text",
1451
+ "primaryKey": true,
1452
+ "notNull": true
1453
+ },
1454
+ "secret": {
1455
+ "name": "secret",
1456
+ "type": "text",
1457
+ "primaryKey": false,
1458
+ "notNull": true
1459
+ },
1460
+ "backup_codes": {
1461
+ "name": "backup_codes",
1462
+ "type": "text",
1463
+ "primaryKey": false,
1464
+ "notNull": true
1465
+ },
1466
+ "user_id": {
1467
+ "name": "user_id",
1468
+ "type": "text",
1469
+ "primaryKey": false,
1470
+ "notNull": true
1471
+ }
1472
+ },
1473
+ "indexes": {},
1474
+ "foreignKeys": {
1475
+ "two_factor_user_id_user_id_fk": {
1476
+ "name": "two_factor_user_id_user_id_fk",
1477
+ "tableFrom": "two_factor",
1478
+ "tableTo": "user",
1479
+ "columnsFrom": ["user_id"],
1480
+ "columnsTo": ["id"],
1481
+ "onDelete": "cascade",
1482
+ "onUpdate": "no action"
1483
+ }
1484
+ },
1485
+ "compositePrimaryKeys": {},
1486
+ "uniqueConstraints": {},
1487
+ "policies": {},
1488
+ "checkConstraints": {},
1489
+ "isRLSEnabled": false
1490
+ },
1491
+ "public.user": {
1492
+ "name": "user",
1493
+ "schema": "",
1494
+ "columns": {
1495
+ "id": {
1496
+ "name": "id",
1497
+ "type": "text",
1498
+ "primaryKey": true,
1499
+ "notNull": true
1500
+ },
1501
+ "name": {
1502
+ "name": "name",
1503
+ "type": "text",
1504
+ "primaryKey": false,
1505
+ "notNull": true
1506
+ },
1507
+ "email": {
1508
+ "name": "email",
1509
+ "type": "text",
1510
+ "primaryKey": false,
1511
+ "notNull": true
1512
+ },
1513
+ "email_verified": {
1514
+ "name": "email_verified",
1515
+ "type": "boolean",
1516
+ "primaryKey": false,
1517
+ "notNull": true
1518
+ },
1519
+ "image": {
1520
+ "name": "image",
1521
+ "type": "text",
1522
+ "primaryKey": false,
1523
+ "notNull": false
1524
+ },
1525
+ "created_at": {
1526
+ "name": "created_at",
1527
+ "type": "timestamp",
1528
+ "primaryKey": false,
1529
+ "notNull": true
1530
+ },
1531
+ "updated_at": {
1532
+ "name": "updated_at",
1533
+ "type": "timestamp",
1534
+ "primaryKey": false,
1535
+ "notNull": true
1536
+ },
1537
+ "two_factor_enabled": {
1538
+ "name": "two_factor_enabled",
1539
+ "type": "boolean",
1540
+ "primaryKey": false,
1541
+ "notNull": false
1542
+ },
1543
+ "last_login_method": {
1544
+ "name": "last_login_method",
1545
+ "type": "text",
1546
+ "primaryKey": false,
1547
+ "notNull": false
1548
+ },
1549
+ "stripe_customer_id": {
1550
+ "name": "stripe_customer_id",
1551
+ "type": "text",
1552
+ "primaryKey": false,
1553
+ "notNull": false
1554
+ }
1555
+ },
1556
+ "indexes": {},
1557
+ "foreignKeys": {},
1558
+ "compositePrimaryKeys": {},
1559
+ "uniqueConstraints": {
1560
+ "user_email_unique": {
1561
+ "name": "user_email_unique",
1562
+ "nullsNotDistinct": false,
1563
+ "columns": ["email"]
1564
+ }
1565
+ },
1566
+ "policies": {},
1567
+ "checkConstraints": {},
1568
+ "isRLSEnabled": false
1569
+ },
1570
+ "public.verification": {
1571
+ "name": "verification",
1572
+ "schema": "",
1573
+ "columns": {
1574
+ "id": {
1575
+ "name": "id",
1576
+ "type": "text",
1577
+ "primaryKey": true,
1578
+ "notNull": true
1579
+ },
1580
+ "identifier": {
1581
+ "name": "identifier",
1582
+ "type": "text",
1583
+ "primaryKey": false,
1584
+ "notNull": true
1585
+ },
1586
+ "value": {
1587
+ "name": "value",
1588
+ "type": "text",
1589
+ "primaryKey": false,
1590
+ "notNull": true
1591
+ },
1592
+ "expires_at": {
1593
+ "name": "expires_at",
1594
+ "type": "timestamp",
1595
+ "primaryKey": false,
1596
+ "notNull": true
1597
+ },
1598
+ "created_at": {
1599
+ "name": "created_at",
1600
+ "type": "timestamp",
1601
+ "primaryKey": false,
1602
+ "notNull": false
1603
+ },
1604
+ "updated_at": {
1605
+ "name": "updated_at",
1606
+ "type": "timestamp",
1607
+ "primaryKey": false,
1608
+ "notNull": false
1609
+ }
1610
+ },
1611
+ "indexes": {},
1612
+ "foreignKeys": {},
1613
+ "compositePrimaryKeys": {},
1614
+ "uniqueConstraints": {},
1615
+ "policies": {},
1616
+ "checkConstraints": {},
1617
+ "isRLSEnabled": false
1618
+ },
1619
+ "public.batch_send": {
1620
+ "name": "batch_send",
1621
+ "schema": "",
1622
+ "columns": {
1623
+ "id": {
1624
+ "name": "id",
1625
+ "type": "text",
1626
+ "primaryKey": true,
1627
+ "notNull": true
1628
+ },
1629
+ "organization_id": {
1630
+ "name": "organization_id",
1631
+ "type": "text",
1632
+ "primaryKey": false,
1633
+ "notNull": true
1634
+ },
1635
+ "aws_account_id": {
1636
+ "name": "aws_account_id",
1637
+ "type": "text",
1638
+ "primaryKey": false,
1639
+ "notNull": false
1640
+ },
1641
+ "name": {
1642
+ "name": "name",
1643
+ "type": "text",
1644
+ "primaryKey": false,
1645
+ "notNull": false
1646
+ },
1647
+ "channel": {
1648
+ "name": "channel",
1649
+ "type": "text",
1650
+ "primaryKey": false,
1651
+ "notNull": true,
1652
+ "default": "'email'"
1653
+ },
1654
+ "subject": {
1655
+ "name": "subject",
1656
+ "type": "text",
1657
+ "primaryKey": false,
1658
+ "notNull": false
1659
+ },
1660
+ "preview_text": {
1661
+ "name": "preview_text",
1662
+ "type": "text",
1663
+ "primaryKey": false,
1664
+ "notNull": false
1665
+ },
1666
+ "from": {
1667
+ "name": "from",
1668
+ "type": "text",
1669
+ "primaryKey": false,
1670
+ "notNull": false
1671
+ },
1672
+ "from_name": {
1673
+ "name": "from_name",
1674
+ "type": "text",
1675
+ "primaryKey": false,
1676
+ "notNull": false
1677
+ },
1678
+ "reply_to": {
1679
+ "name": "reply_to",
1680
+ "type": "text",
1681
+ "primaryKey": false,
1682
+ "notNull": false
1683
+ },
1684
+ "email_template_id": {
1685
+ "name": "email_template_id",
1686
+ "type": "text",
1687
+ "primaryKey": false,
1688
+ "notNull": false
1689
+ },
1690
+ "html_content": {
1691
+ "name": "html_content",
1692
+ "type": "text",
1693
+ "primaryKey": false,
1694
+ "notNull": false
1695
+ },
1696
+ "text_content": {
1697
+ "name": "text_content",
1698
+ "type": "text",
1699
+ "primaryKey": false,
1700
+ "notNull": false
1701
+ },
1702
+ "body": {
1703
+ "name": "body",
1704
+ "type": "text",
1705
+ "primaryKey": false,
1706
+ "notNull": false
1707
+ },
1708
+ "sender_id": {
1709
+ "name": "sender_id",
1710
+ "type": "text",
1711
+ "primaryKey": false,
1712
+ "notNull": false
1713
+ },
1714
+ "audience_type": {
1715
+ "name": "audience_type",
1716
+ "type": "text",
1717
+ "primaryKey": false,
1718
+ "notNull": false,
1719
+ "default": "'all'"
1720
+ },
1721
+ "topic_id": {
1722
+ "name": "topic_id",
1723
+ "type": "text",
1724
+ "primaryKey": false,
1725
+ "notNull": false
1726
+ },
1727
+ "segment_id": {
1728
+ "name": "segment_id",
1729
+ "type": "text",
1730
+ "primaryKey": false,
1731
+ "notNull": false
1732
+ },
1733
+ "status": {
1734
+ "name": "status",
1735
+ "type": "batch_send_status",
1736
+ "typeSchema": "public",
1737
+ "primaryKey": false,
1738
+ "notNull": true,
1739
+ "default": "'draft'"
1740
+ },
1741
+ "total_recipients": {
1742
+ "name": "total_recipients",
1743
+ "type": "integer",
1744
+ "primaryKey": false,
1745
+ "notNull": true,
1746
+ "default": 0
1747
+ },
1748
+ "processed_recipients": {
1749
+ "name": "processed_recipients",
1750
+ "type": "integer",
1751
+ "primaryKey": false,
1752
+ "notNull": true,
1753
+ "default": 0
1754
+ },
1755
+ "sent": {
1756
+ "name": "sent",
1757
+ "type": "integer",
1758
+ "primaryKey": false,
1759
+ "notNull": true,
1760
+ "default": 0
1761
+ },
1762
+ "delivered": {
1763
+ "name": "delivered",
1764
+ "type": "integer",
1765
+ "primaryKey": false,
1766
+ "notNull": true,
1767
+ "default": 0
1768
+ },
1769
+ "failed": {
1770
+ "name": "failed",
1771
+ "type": "integer",
1772
+ "primaryKey": false,
1773
+ "notNull": true,
1774
+ "default": 0
1775
+ },
1776
+ "opened": {
1777
+ "name": "opened",
1778
+ "type": "integer",
1779
+ "primaryKey": false,
1780
+ "notNull": true,
1781
+ "default": 0
1782
+ },
1783
+ "clicked": {
1784
+ "name": "clicked",
1785
+ "type": "integer",
1786
+ "primaryKey": false,
1787
+ "notNull": true,
1788
+ "default": 0
1789
+ },
1790
+ "bounced": {
1791
+ "name": "bounced",
1792
+ "type": "integer",
1793
+ "primaryKey": false,
1794
+ "notNull": true,
1795
+ "default": 0
1796
+ },
1797
+ "complained": {
1798
+ "name": "complained",
1799
+ "type": "integer",
1800
+ "primaryKey": false,
1801
+ "notNull": true,
1802
+ "default": 0
1803
+ },
1804
+ "sms_segments": {
1805
+ "name": "sms_segments",
1806
+ "type": "integer",
1807
+ "primaryKey": false,
1808
+ "notNull": true,
1809
+ "default": 0
1810
+ },
1811
+ "sms_opted_out": {
1812
+ "name": "sms_opted_out",
1813
+ "type": "integer",
1814
+ "primaryKey": false,
1815
+ "notNull": true,
1816
+ "default": 0
1817
+ },
1818
+ "error_message": {
1819
+ "name": "error_message",
1820
+ "type": "text",
1821
+ "primaryKey": false,
1822
+ "notNull": false
1823
+ },
1824
+ "error_details": {
1825
+ "name": "error_details",
1826
+ "type": "json",
1827
+ "primaryKey": false,
1828
+ "notNull": false
1829
+ },
1830
+ "scheduled_for": {
1831
+ "name": "scheduled_for",
1832
+ "type": "timestamp",
1833
+ "primaryKey": false,
1834
+ "notNull": false
1835
+ },
1836
+ "started_at": {
1837
+ "name": "started_at",
1838
+ "type": "timestamp",
1839
+ "primaryKey": false,
1840
+ "notNull": false
1841
+ },
1842
+ "completed_at": {
1843
+ "name": "completed_at",
1844
+ "type": "timestamp",
1845
+ "primaryKey": false,
1846
+ "notNull": false
1847
+ },
1848
+ "created_by": {
1849
+ "name": "created_by",
1850
+ "type": "text",
1851
+ "primaryKey": false,
1852
+ "notNull": false
1853
+ },
1854
+ "created_at": {
1855
+ "name": "created_at",
1856
+ "type": "timestamp",
1857
+ "primaryKey": false,
1858
+ "notNull": true,
1859
+ "default": "now()"
1860
+ },
1861
+ "updated_at": {
1862
+ "name": "updated_at",
1863
+ "type": "timestamp",
1864
+ "primaryKey": false,
1865
+ "notNull": true,
1866
+ "default": "now()"
1867
+ }
1868
+ },
1869
+ "indexes": {
1870
+ "batch_send_org_idx": {
1871
+ "name": "batch_send_org_idx",
1872
+ "columns": [
1873
+ {
1874
+ "expression": "organization_id",
1875
+ "isExpression": false,
1876
+ "asc": true,
1877
+ "nulls": "last"
1878
+ }
1879
+ ],
1880
+ "isUnique": false,
1881
+ "concurrently": false,
1882
+ "method": "btree",
1883
+ "with": {}
1884
+ },
1885
+ "batch_send_channel_idx": {
1886
+ "name": "batch_send_channel_idx",
1887
+ "columns": [
1888
+ {
1889
+ "expression": "channel",
1890
+ "isExpression": false,
1891
+ "asc": true,
1892
+ "nulls": "last"
1893
+ }
1894
+ ],
1895
+ "isUnique": false,
1896
+ "concurrently": false,
1897
+ "method": "btree",
1898
+ "with": {}
1899
+ },
1900
+ "batch_send_status_idx": {
1901
+ "name": "batch_send_status_idx",
1902
+ "columns": [
1903
+ {
1904
+ "expression": "organization_id",
1905
+ "isExpression": false,
1906
+ "asc": true,
1907
+ "nulls": "last"
1908
+ },
1909
+ {
1910
+ "expression": "status",
1911
+ "isExpression": false,
1912
+ "asc": true,
1913
+ "nulls": "last"
1914
+ }
1915
+ ],
1916
+ "isUnique": false,
1917
+ "concurrently": false,
1918
+ "method": "btree",
1919
+ "with": {}
1920
+ },
1921
+ "batch_send_created_at_idx": {
1922
+ "name": "batch_send_created_at_idx",
1923
+ "columns": [
1924
+ {
1925
+ "expression": "organization_id",
1926
+ "isExpression": false,
1927
+ "asc": true,
1928
+ "nulls": "last"
1929
+ },
1930
+ {
1931
+ "expression": "created_at",
1932
+ "isExpression": false,
1933
+ "asc": true,
1934
+ "nulls": "last"
1935
+ }
1936
+ ],
1937
+ "isUnique": false,
1938
+ "concurrently": false,
1939
+ "method": "btree",
1940
+ "with": {}
1941
+ }
1942
+ },
1943
+ "foreignKeys": {
1944
+ "batch_send_organization_id_organization_id_fk": {
1945
+ "name": "batch_send_organization_id_organization_id_fk",
1946
+ "tableFrom": "batch_send",
1947
+ "tableTo": "organization",
1948
+ "columnsFrom": ["organization_id"],
1949
+ "columnsTo": ["id"],
1950
+ "onDelete": "cascade",
1951
+ "onUpdate": "no action"
1952
+ },
1953
+ "batch_send_aws_account_id_aws_account_id_fk": {
1954
+ "name": "batch_send_aws_account_id_aws_account_id_fk",
1955
+ "tableFrom": "batch_send",
1956
+ "tableTo": "aws_account",
1957
+ "columnsFrom": ["aws_account_id"],
1958
+ "columnsTo": ["id"],
1959
+ "onDelete": "set null",
1960
+ "onUpdate": "no action"
1961
+ },
1962
+ "batch_send_email_template_id_template_id_fk": {
1963
+ "name": "batch_send_email_template_id_template_id_fk",
1964
+ "tableFrom": "batch_send",
1965
+ "tableTo": "template",
1966
+ "columnsFrom": ["email_template_id"],
1967
+ "columnsTo": ["id"],
1968
+ "onDelete": "set null",
1969
+ "onUpdate": "no action"
1970
+ },
1971
+ "batch_send_created_by_user_id_fk": {
1972
+ "name": "batch_send_created_by_user_id_fk",
1973
+ "tableFrom": "batch_send",
1974
+ "tableTo": "user",
1975
+ "columnsFrom": ["created_by"],
1976
+ "columnsTo": ["id"],
1977
+ "onDelete": "set null",
1978
+ "onUpdate": "no action"
1979
+ }
1980
+ },
1981
+ "compositePrimaryKeys": {},
1982
+ "uniqueConstraints": {},
1983
+ "policies": {},
1984
+ "checkConstraints": {},
1985
+ "isRLSEnabled": false
1986
+ },
1987
+ "public.message_send": {
1988
+ "name": "message_send",
1989
+ "schema": "",
1990
+ "columns": {
1991
+ "id": {
1992
+ "name": "id",
1993
+ "type": "text",
1994
+ "primaryKey": true,
1995
+ "notNull": true
1996
+ },
1997
+ "organization_id": {
1998
+ "name": "organization_id",
1999
+ "type": "text",
2000
+ "primaryKey": false,
2001
+ "notNull": true
2002
+ },
2003
+ "contact_id": {
2004
+ "name": "contact_id",
2005
+ "type": "text",
2006
+ "primaryKey": false,
2007
+ "notNull": false
2008
+ },
2009
+ "aws_account_id": {
2010
+ "name": "aws_account_id",
2011
+ "type": "text",
2012
+ "primaryKey": false,
2013
+ "notNull": true
2014
+ },
2015
+ "channel": {
2016
+ "name": "channel",
2017
+ "type": "text",
2018
+ "primaryKey": false,
2019
+ "notNull": true,
2020
+ "default": "'email'"
2021
+ },
2022
+ "source_type": {
2023
+ "name": "source_type",
2024
+ "type": "message_source_type",
2025
+ "typeSchema": "public",
2026
+ "primaryKey": false,
2027
+ "notNull": true
2028
+ },
2029
+ "batch_send_id": {
2030
+ "name": "batch_send_id",
2031
+ "type": "text",
2032
+ "primaryKey": false,
2033
+ "notNull": false
2034
+ },
2035
+ "recipient": {
2036
+ "name": "recipient",
2037
+ "type": "text",
2038
+ "primaryKey": false,
2039
+ "notNull": true
2040
+ },
2041
+ "subject": {
2042
+ "name": "subject",
2043
+ "type": "text",
2044
+ "primaryKey": false,
2045
+ "notNull": false
2046
+ },
2047
+ "from": {
2048
+ "name": "from",
2049
+ "type": "text",
2050
+ "primaryKey": false,
2051
+ "notNull": false
2052
+ },
2053
+ "from_name": {
2054
+ "name": "from_name",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": false
2058
+ },
2059
+ "email_template_id": {
2060
+ "name": "email_template_id",
2061
+ "type": "text",
2062
+ "primaryKey": false,
2063
+ "notNull": false
2064
+ },
2065
+ "body": {
2066
+ "name": "body",
2067
+ "type": "text",
2068
+ "primaryKey": false,
2069
+ "notNull": false
2070
+ },
2071
+ "sender_id": {
2072
+ "name": "sender_id",
2073
+ "type": "text",
2074
+ "primaryKey": false,
2075
+ "notNull": false
2076
+ },
2077
+ "sms_segment_count": {
2078
+ "name": "sms_segment_count",
2079
+ "type": "integer",
2080
+ "primaryKey": false,
2081
+ "notNull": false
2082
+ },
2083
+ "variables": {
2084
+ "name": "variables",
2085
+ "type": "json",
2086
+ "primaryKey": false,
2087
+ "notNull": false,
2088
+ "default": "'{}'::json"
2089
+ },
2090
+ "message_id": {
2091
+ "name": "message_id",
2092
+ "type": "text",
2093
+ "primaryKey": false,
2094
+ "notNull": false
2095
+ },
2096
+ "status": {
2097
+ "name": "status",
2098
+ "type": "message_send_status",
2099
+ "typeSchema": "public",
2100
+ "primaryKey": false,
2101
+ "notNull": true,
2102
+ "default": "'pending'"
2103
+ },
2104
+ "sent_at": {
2105
+ "name": "sent_at",
2106
+ "type": "timestamp",
2107
+ "primaryKey": false,
2108
+ "notNull": false
2109
+ },
2110
+ "delivered_at": {
2111
+ "name": "delivered_at",
2112
+ "type": "timestamp",
2113
+ "primaryKey": false,
2114
+ "notNull": false
2115
+ },
2116
+ "opened_at": {
2117
+ "name": "opened_at",
2118
+ "type": "timestamp",
2119
+ "primaryKey": false,
2120
+ "notNull": false
2121
+ },
2122
+ "clicked_at": {
2123
+ "name": "clicked_at",
2124
+ "type": "timestamp",
2125
+ "primaryKey": false,
2126
+ "notNull": false
2127
+ },
2128
+ "bounced_at": {
2129
+ "name": "bounced_at",
2130
+ "type": "timestamp",
2131
+ "primaryKey": false,
2132
+ "notNull": false
2133
+ },
2134
+ "complained_at": {
2135
+ "name": "complained_at",
2136
+ "type": "timestamp",
2137
+ "primaryKey": false,
2138
+ "notNull": false
2139
+ },
2140
+ "opted_out_at": {
2141
+ "name": "opted_out_at",
2142
+ "type": "timestamp",
2143
+ "primaryKey": false,
2144
+ "notNull": false
2145
+ },
2146
+ "error": {
2147
+ "name": "error",
2148
+ "type": "text",
2149
+ "primaryKey": false,
2150
+ "notNull": false
2151
+ },
2152
+ "bounce_type": {
2153
+ "name": "bounce_type",
2154
+ "type": "text",
2155
+ "primaryKey": false,
2156
+ "notNull": false
2157
+ },
2158
+ "bounce_sub_type": {
2159
+ "name": "bounce_sub_type",
2160
+ "type": "text",
2161
+ "primaryKey": false,
2162
+ "notNull": false
2163
+ },
2164
+ "created_at": {
2165
+ "name": "created_at",
2166
+ "type": "timestamp",
2167
+ "primaryKey": false,
2168
+ "notNull": true,
2169
+ "default": "now()"
2170
+ }
2171
+ },
2172
+ "indexes": {
2173
+ "message_send_org_idx": {
2174
+ "name": "message_send_org_idx",
2175
+ "columns": [
2176
+ {
2177
+ "expression": "organization_id",
2178
+ "isExpression": false,
2179
+ "asc": true,
2180
+ "nulls": "last"
2181
+ }
2182
+ ],
2183
+ "isUnique": false,
2184
+ "concurrently": false,
2185
+ "method": "btree",
2186
+ "with": {}
2187
+ },
2188
+ "message_send_contact_idx": {
2189
+ "name": "message_send_contact_idx",
2190
+ "columns": [
2191
+ {
2192
+ "expression": "contact_id",
2193
+ "isExpression": false,
2194
+ "asc": true,
2195
+ "nulls": "last"
2196
+ }
2197
+ ],
2198
+ "isUnique": false,
2199
+ "concurrently": false,
2200
+ "method": "btree",
2201
+ "with": {}
2202
+ },
2203
+ "message_send_channel_idx": {
2204
+ "name": "message_send_channel_idx",
2205
+ "columns": [
2206
+ {
2207
+ "expression": "channel",
2208
+ "isExpression": false,
2209
+ "asc": true,
2210
+ "nulls": "last"
2211
+ }
2212
+ ],
2213
+ "isUnique": false,
2214
+ "concurrently": false,
2215
+ "method": "btree",
2216
+ "with": {}
2217
+ },
2218
+ "message_send_batch_idx": {
2219
+ "name": "message_send_batch_idx",
2220
+ "columns": [
2221
+ {
2222
+ "expression": "batch_send_id",
2223
+ "isExpression": false,
2224
+ "asc": true,
2225
+ "nulls": "last"
2226
+ }
2227
+ ],
2228
+ "isUnique": false,
2229
+ "concurrently": false,
2230
+ "method": "btree",
2231
+ "with": {}
2232
+ },
2233
+ "message_send_status_idx": {
2234
+ "name": "message_send_status_idx",
2235
+ "columns": [
2236
+ {
2237
+ "expression": "batch_send_id",
2238
+ "isExpression": false,
2239
+ "asc": true,
2240
+ "nulls": "last"
2241
+ },
2242
+ {
2243
+ "expression": "status",
2244
+ "isExpression": false,
2245
+ "asc": true,
2246
+ "nulls": "last"
2247
+ }
2248
+ ],
2249
+ "isUnique": false,
2250
+ "concurrently": false,
2251
+ "method": "btree",
2252
+ "with": {}
2253
+ },
2254
+ "message_send_message_id_idx": {
2255
+ "name": "message_send_message_id_idx",
2256
+ "columns": [
2257
+ {
2258
+ "expression": "message_id",
2259
+ "isExpression": false,
2260
+ "asc": true,
2261
+ "nulls": "last"
2262
+ }
2263
+ ],
2264
+ "isUnique": true,
2265
+ "concurrently": false,
2266
+ "method": "btree",
2267
+ "with": {}
2268
+ },
2269
+ "message_send_source_type_idx": {
2270
+ "name": "message_send_source_type_idx",
2271
+ "columns": [
2272
+ {
2273
+ "expression": "source_type",
2274
+ "isExpression": false,
2275
+ "asc": true,
2276
+ "nulls": "last"
2277
+ }
2278
+ ],
2279
+ "isUnique": false,
2280
+ "concurrently": false,
2281
+ "method": "btree",
2282
+ "with": {}
2283
+ },
2284
+ "message_send_created_at_idx": {
2285
+ "name": "message_send_created_at_idx",
2286
+ "columns": [
2287
+ {
2288
+ "expression": "created_at",
2289
+ "isExpression": false,
2290
+ "asc": true,
2291
+ "nulls": "last"
2292
+ }
2293
+ ],
2294
+ "isUnique": false,
2295
+ "concurrently": false,
2296
+ "method": "btree",
2297
+ "with": {}
2298
+ }
2299
+ },
2300
+ "foreignKeys": {
2301
+ "message_send_organization_id_organization_id_fk": {
2302
+ "name": "message_send_organization_id_organization_id_fk",
2303
+ "tableFrom": "message_send",
2304
+ "tableTo": "organization",
2305
+ "columnsFrom": ["organization_id"],
2306
+ "columnsTo": ["id"],
2307
+ "onDelete": "cascade",
2308
+ "onUpdate": "no action"
2309
+ },
2310
+ "message_send_contact_id_contact_id_fk": {
2311
+ "name": "message_send_contact_id_contact_id_fk",
2312
+ "tableFrom": "message_send",
2313
+ "tableTo": "contact",
2314
+ "columnsFrom": ["contact_id"],
2315
+ "columnsTo": ["id"],
2316
+ "onDelete": "set null",
2317
+ "onUpdate": "no action"
2318
+ },
2319
+ "message_send_aws_account_id_aws_account_id_fk": {
2320
+ "name": "message_send_aws_account_id_aws_account_id_fk",
2321
+ "tableFrom": "message_send",
2322
+ "tableTo": "aws_account",
2323
+ "columnsFrom": ["aws_account_id"],
2324
+ "columnsTo": ["id"],
2325
+ "onDelete": "set null",
2326
+ "onUpdate": "no action"
2327
+ },
2328
+ "message_send_batch_send_id_batch_send_id_fk": {
2329
+ "name": "message_send_batch_send_id_batch_send_id_fk",
2330
+ "tableFrom": "message_send",
2331
+ "tableTo": "batch_send",
2332
+ "columnsFrom": ["batch_send_id"],
2333
+ "columnsTo": ["id"],
2334
+ "onDelete": "set null",
2335
+ "onUpdate": "no action"
2336
+ },
2337
+ "message_send_email_template_id_template_id_fk": {
2338
+ "name": "message_send_email_template_id_template_id_fk",
2339
+ "tableFrom": "message_send",
2340
+ "tableTo": "template",
2341
+ "columnsFrom": ["email_template_id"],
2342
+ "columnsTo": ["id"],
2343
+ "onDelete": "set null",
2344
+ "onUpdate": "no action"
2345
+ }
2346
+ },
2347
+ "compositePrimaryKeys": {},
2348
+ "uniqueConstraints": {},
2349
+ "policies": {},
2350
+ "checkConstraints": {},
2351
+ "isRLSEnabled": false
2352
+ },
2353
+ "public.contact": {
2354
+ "name": "contact",
2355
+ "schema": "",
2356
+ "columns": {
2357
+ "id": {
2358
+ "name": "id",
2359
+ "type": "text",
2360
+ "primaryKey": true,
2361
+ "notNull": true
2362
+ },
2363
+ "organization_id": {
2364
+ "name": "organization_id",
2365
+ "type": "text",
2366
+ "primaryKey": false,
2367
+ "notNull": true
2368
+ },
2369
+ "email": {
2370
+ "name": "email",
2371
+ "type": "text",
2372
+ "primaryKey": false,
2373
+ "notNull": false
2374
+ },
2375
+ "email_hash": {
2376
+ "name": "email_hash",
2377
+ "type": "text",
2378
+ "primaryKey": false,
2379
+ "notNull": false
2380
+ },
2381
+ "email_status": {
2382
+ "name": "email_status",
2383
+ "type": "text",
2384
+ "primaryKey": false,
2385
+ "notNull": false
2386
+ },
2387
+ "email_verified_at": {
2388
+ "name": "email_verified_at",
2389
+ "type": "timestamp",
2390
+ "primaryKey": false,
2391
+ "notNull": false
2392
+ },
2393
+ "email_unsubscribed_at": {
2394
+ "name": "email_unsubscribed_at",
2395
+ "type": "timestamp",
2396
+ "primaryKey": false,
2397
+ "notNull": false
2398
+ },
2399
+ "email_bounced_at": {
2400
+ "name": "email_bounced_at",
2401
+ "type": "timestamp",
2402
+ "primaryKey": false,
2403
+ "notNull": false
2404
+ },
2405
+ "email_complained_at": {
2406
+ "name": "email_complained_at",
2407
+ "type": "timestamp",
2408
+ "primaryKey": false,
2409
+ "notNull": false
2410
+ },
2411
+ "last_email_sent_at": {
2412
+ "name": "last_email_sent_at",
2413
+ "type": "timestamp",
2414
+ "primaryKey": false,
2415
+ "notNull": false
2416
+ },
2417
+ "last_email_opened_at": {
2418
+ "name": "last_email_opened_at",
2419
+ "type": "timestamp",
2420
+ "primaryKey": false,
2421
+ "notNull": false
2422
+ },
2423
+ "last_email_clicked_at": {
2424
+ "name": "last_email_clicked_at",
2425
+ "type": "timestamp",
2426
+ "primaryKey": false,
2427
+ "notNull": false
2428
+ },
2429
+ "emails_sent": {
2430
+ "name": "emails_sent",
2431
+ "type": "integer",
2432
+ "primaryKey": false,
2433
+ "notNull": true,
2434
+ "default": 0
2435
+ },
2436
+ "emails_opened": {
2437
+ "name": "emails_opened",
2438
+ "type": "integer",
2439
+ "primaryKey": false,
2440
+ "notNull": true,
2441
+ "default": 0
2442
+ },
2443
+ "emails_clicked": {
2444
+ "name": "emails_clicked",
2445
+ "type": "integer",
2446
+ "primaryKey": false,
2447
+ "notNull": true,
2448
+ "default": 0
2449
+ },
2450
+ "phone": {
2451
+ "name": "phone",
2452
+ "type": "text",
2453
+ "primaryKey": false,
2454
+ "notNull": false
2455
+ },
2456
+ "phone_hash": {
2457
+ "name": "phone_hash",
2458
+ "type": "text",
2459
+ "primaryKey": false,
2460
+ "notNull": false
2461
+ },
2462
+ "sms_status": {
2463
+ "name": "sms_status",
2464
+ "type": "text",
2465
+ "primaryKey": false,
2466
+ "notNull": false
2467
+ },
2468
+ "sms_consented_at": {
2469
+ "name": "sms_consented_at",
2470
+ "type": "timestamp",
2471
+ "primaryKey": false,
2472
+ "notNull": false
2473
+ },
2474
+ "sms_opted_out_at": {
2475
+ "name": "sms_opted_out_at",
2476
+ "type": "timestamp",
2477
+ "primaryKey": false,
2478
+ "notNull": false
2479
+ },
2480
+ "sms_invalid_at": {
2481
+ "name": "sms_invalid_at",
2482
+ "type": "timestamp",
2483
+ "primaryKey": false,
2484
+ "notNull": false
2485
+ },
2486
+ "last_sms_sent_at": {
2487
+ "name": "last_sms_sent_at",
2488
+ "type": "timestamp",
2489
+ "primaryKey": false,
2490
+ "notNull": false
2491
+ },
2492
+ "last_sms_clicked_at": {
2493
+ "name": "last_sms_clicked_at",
2494
+ "type": "timestamp",
2495
+ "primaryKey": false,
2496
+ "notNull": false
2497
+ },
2498
+ "sms_sent": {
2499
+ "name": "sms_sent",
2500
+ "type": "integer",
2501
+ "primaryKey": false,
2502
+ "notNull": true,
2503
+ "default": 0
2504
+ },
2505
+ "sms_clicked": {
2506
+ "name": "sms_clicked",
2507
+ "type": "integer",
2508
+ "primaryKey": false,
2509
+ "notNull": true,
2510
+ "default": 0
2511
+ },
2512
+ "first_name": {
2513
+ "name": "first_name",
2514
+ "type": "text",
2515
+ "primaryKey": false,
2516
+ "notNull": false
2517
+ },
2518
+ "last_name": {
2519
+ "name": "last_name",
2520
+ "type": "text",
2521
+ "primaryKey": false,
2522
+ "notNull": false
2523
+ },
2524
+ "company": {
2525
+ "name": "company",
2526
+ "type": "text",
2527
+ "primaryKey": false,
2528
+ "notNull": false
2529
+ },
2530
+ "job_title": {
2531
+ "name": "job_title",
2532
+ "type": "text",
2533
+ "primaryKey": false,
2534
+ "notNull": false
2535
+ },
2536
+ "properties": {
2537
+ "name": "properties",
2538
+ "type": "json",
2539
+ "primaryKey": false,
2540
+ "notNull": true,
2541
+ "default": "'{}'::json"
2542
+ },
2543
+ "last_activity_at": {
2544
+ "name": "last_activity_at",
2545
+ "type": "timestamp",
2546
+ "primaryKey": false,
2547
+ "notNull": false
2548
+ },
2549
+ "created_at": {
2550
+ "name": "created_at",
2551
+ "type": "timestamp",
2552
+ "primaryKey": false,
2553
+ "notNull": true,
2554
+ "default": "now()"
2555
+ },
2556
+ "updated_at": {
2557
+ "name": "updated_at",
2558
+ "type": "timestamp",
2559
+ "primaryKey": false,
2560
+ "notNull": true,
2561
+ "default": "now()"
2562
+ },
2563
+ "created_by": {
2564
+ "name": "created_by",
2565
+ "type": "text",
2566
+ "primaryKey": false,
2567
+ "notNull": false
2568
+ },
2569
+ "status": {
2570
+ "name": "status",
2571
+ "type": "text",
2572
+ "primaryKey": false,
2573
+ "notNull": true,
2574
+ "default": "'active'"
2575
+ },
2576
+ "confirmed_at": {
2577
+ "name": "confirmed_at",
2578
+ "type": "timestamp",
2579
+ "primaryKey": false,
2580
+ "notNull": false
2581
+ },
2582
+ "unsubscribed_at": {
2583
+ "name": "unsubscribed_at",
2584
+ "type": "timestamp",
2585
+ "primaryKey": false,
2586
+ "notNull": false
2587
+ },
2588
+ "bounced_at": {
2589
+ "name": "bounced_at",
2590
+ "type": "timestamp",
2591
+ "primaryKey": false,
2592
+ "notNull": false
2593
+ },
2594
+ "complained_at": {
2595
+ "name": "complained_at",
2596
+ "type": "timestamp",
2597
+ "primaryKey": false,
2598
+ "notNull": false
2599
+ }
2600
+ },
2601
+ "indexes": {
2602
+ "contact_org_idx": {
2603
+ "name": "contact_org_idx",
2604
+ "columns": [
2605
+ {
2606
+ "expression": "organization_id",
2607
+ "isExpression": false,
2608
+ "asc": true,
2609
+ "nulls": "last"
2610
+ }
2611
+ ],
2612
+ "isUnique": false,
2613
+ "concurrently": false,
2614
+ "method": "btree",
2615
+ "with": {}
2616
+ },
2617
+ "contact_email_idx": {
2618
+ "name": "contact_email_idx",
2619
+ "columns": [
2620
+ {
2621
+ "expression": "email",
2622
+ "isExpression": false,
2623
+ "asc": true,
2624
+ "nulls": "last"
2625
+ }
2626
+ ],
2627
+ "isUnique": false,
2628
+ "concurrently": false,
2629
+ "method": "btree",
2630
+ "with": {}
2631
+ },
2632
+ "contact_unique_org_email_idx": {
2633
+ "name": "contact_unique_org_email_idx",
2634
+ "columns": [
2635
+ {
2636
+ "expression": "organization_id",
2637
+ "isExpression": false,
2638
+ "asc": true,
2639
+ "nulls": "last"
2640
+ },
2641
+ {
2642
+ "expression": "email_hash",
2643
+ "isExpression": false,
2644
+ "asc": true,
2645
+ "nulls": "last"
2646
+ }
2647
+ ],
2648
+ "isUnique": true,
2649
+ "where": "email_hash IS NOT NULL",
2650
+ "concurrently": false,
2651
+ "method": "btree",
2652
+ "with": {}
2653
+ },
2654
+ "contact_email_status_idx": {
2655
+ "name": "contact_email_status_idx",
2656
+ "columns": [
2657
+ {
2658
+ "expression": "organization_id",
2659
+ "isExpression": false,
2660
+ "asc": true,
2661
+ "nulls": "last"
2662
+ },
2663
+ {
2664
+ "expression": "email_status",
2665
+ "isExpression": false,
2666
+ "asc": true,
2667
+ "nulls": "last"
2668
+ }
2669
+ ],
2670
+ "isUnique": false,
2671
+ "concurrently": false,
2672
+ "method": "btree",
2673
+ "with": {}
2674
+ },
2675
+ "contact_phone_idx": {
2676
+ "name": "contact_phone_idx",
2677
+ "columns": [
2678
+ {
2679
+ "expression": "phone",
2680
+ "isExpression": false,
2681
+ "asc": true,
2682
+ "nulls": "last"
2683
+ }
2684
+ ],
2685
+ "isUnique": false,
2686
+ "concurrently": false,
2687
+ "method": "btree",
2688
+ "with": {}
2689
+ },
2690
+ "contact_unique_org_phone_idx": {
2691
+ "name": "contact_unique_org_phone_idx",
2692
+ "columns": [
2693
+ {
2694
+ "expression": "organization_id",
2695
+ "isExpression": false,
2696
+ "asc": true,
2697
+ "nulls": "last"
2698
+ },
2699
+ {
2700
+ "expression": "phone_hash",
2701
+ "isExpression": false,
2702
+ "asc": true,
2703
+ "nulls": "last"
2704
+ }
2705
+ ],
2706
+ "isUnique": true,
2707
+ "where": "phone_hash IS NOT NULL",
2708
+ "concurrently": false,
2709
+ "method": "btree",
2710
+ "with": {}
2711
+ },
2712
+ "contact_sms_status_idx": {
2713
+ "name": "contact_sms_status_idx",
2714
+ "columns": [
2715
+ {
2716
+ "expression": "organization_id",
2717
+ "isExpression": false,
2718
+ "asc": true,
2719
+ "nulls": "last"
2720
+ },
2721
+ {
2722
+ "expression": "sms_status",
2723
+ "isExpression": false,
2724
+ "asc": true,
2725
+ "nulls": "last"
2726
+ }
2727
+ ],
2728
+ "isUnique": false,
2729
+ "concurrently": false,
2730
+ "method": "btree",
2731
+ "with": {}
2732
+ },
2733
+ "contact_status_idx": {
2734
+ "name": "contact_status_idx",
2735
+ "columns": [
2736
+ {
2737
+ "expression": "organization_id",
2738
+ "isExpression": false,
2739
+ "asc": true,
2740
+ "nulls": "last"
2741
+ },
2742
+ {
2743
+ "expression": "status",
2744
+ "isExpression": false,
2745
+ "asc": true,
2746
+ "nulls": "last"
2747
+ }
2748
+ ],
2749
+ "isUnique": false,
2750
+ "concurrently": false,
2751
+ "method": "btree",
2752
+ "with": {}
2753
+ }
2754
+ },
2755
+ "foreignKeys": {
2756
+ "contact_organization_id_organization_id_fk": {
2757
+ "name": "contact_organization_id_organization_id_fk",
2758
+ "tableFrom": "contact",
2759
+ "tableTo": "organization",
2760
+ "columnsFrom": ["organization_id"],
2761
+ "columnsTo": ["id"],
2762
+ "onDelete": "cascade",
2763
+ "onUpdate": "no action"
2764
+ },
2765
+ "contact_created_by_user_id_fk": {
2766
+ "name": "contact_created_by_user_id_fk",
2767
+ "tableFrom": "contact",
2768
+ "tableTo": "user",
2769
+ "columnsFrom": ["created_by"],
2770
+ "columnsTo": ["id"],
2771
+ "onDelete": "no action",
2772
+ "onUpdate": "no action"
2773
+ }
2774
+ },
2775
+ "compositePrimaryKeys": {},
2776
+ "uniqueConstraints": {},
2777
+ "policies": {},
2778
+ "checkConstraints": {},
2779
+ "isRLSEnabled": false
2780
+ },
2781
+ "public.contact_topic": {
2782
+ "name": "contact_topic",
2783
+ "schema": "",
2784
+ "columns": {
2785
+ "contact_id": {
2786
+ "name": "contact_id",
2787
+ "type": "text",
2788
+ "primaryKey": false,
2789
+ "notNull": true
2790
+ },
2791
+ "topic_id": {
2792
+ "name": "topic_id",
2793
+ "type": "text",
2794
+ "primaryKey": false,
2795
+ "notNull": true
2796
+ },
2797
+ "status": {
2798
+ "name": "status",
2799
+ "type": "text",
2800
+ "primaryKey": false,
2801
+ "notNull": true,
2802
+ "default": "'subscribed'"
2803
+ },
2804
+ "subscribed_at": {
2805
+ "name": "subscribed_at",
2806
+ "type": "timestamp",
2807
+ "primaryKey": false,
2808
+ "notNull": false,
2809
+ "default": "now()"
2810
+ },
2811
+ "unsubscribed_at": {
2812
+ "name": "unsubscribed_at",
2813
+ "type": "timestamp",
2814
+ "primaryKey": false,
2815
+ "notNull": false
2816
+ },
2817
+ "confirmed_at": {
2818
+ "name": "confirmed_at",
2819
+ "type": "timestamp",
2820
+ "primaryKey": false,
2821
+ "notNull": false
2822
+ }
2823
+ },
2824
+ "indexes": {
2825
+ "contact_topic_topic_idx": {
2826
+ "name": "contact_topic_topic_idx",
2827
+ "columns": [
2828
+ {
2829
+ "expression": "topic_id",
2830
+ "isExpression": false,
2831
+ "asc": true,
2832
+ "nulls": "last"
2833
+ }
2834
+ ],
2835
+ "isUnique": false,
2836
+ "concurrently": false,
2837
+ "method": "btree",
2838
+ "with": {}
2839
+ },
2840
+ "contact_topic_status_idx": {
2841
+ "name": "contact_topic_status_idx",
2842
+ "columns": [
2843
+ {
2844
+ "expression": "topic_id",
2845
+ "isExpression": false,
2846
+ "asc": true,
2847
+ "nulls": "last"
2848
+ },
2849
+ {
2850
+ "expression": "status",
2851
+ "isExpression": false,
2852
+ "asc": true,
2853
+ "nulls": "last"
2854
+ }
2855
+ ],
2856
+ "isUnique": false,
2857
+ "concurrently": false,
2858
+ "method": "btree",
2859
+ "with": {}
2860
+ }
2861
+ },
2862
+ "foreignKeys": {
2863
+ "contact_topic_contact_id_contact_id_fk": {
2864
+ "name": "contact_topic_contact_id_contact_id_fk",
2865
+ "tableFrom": "contact_topic",
2866
+ "tableTo": "contact",
2867
+ "columnsFrom": ["contact_id"],
2868
+ "columnsTo": ["id"],
2869
+ "onDelete": "cascade",
2870
+ "onUpdate": "no action"
2871
+ },
2872
+ "contact_topic_topic_id_topic_id_fk": {
2873
+ "name": "contact_topic_topic_id_topic_id_fk",
2874
+ "tableFrom": "contact_topic",
2875
+ "tableTo": "topic",
2876
+ "columnsFrom": ["topic_id"],
2877
+ "columnsTo": ["id"],
2878
+ "onDelete": "cascade",
2879
+ "onUpdate": "no action"
2880
+ }
2881
+ },
2882
+ "compositePrimaryKeys": {
2883
+ "contact_topic_contact_id_topic_id_pk": {
2884
+ "name": "contact_topic_contact_id_topic_id_pk",
2885
+ "columns": ["contact_id", "topic_id"]
2886
+ }
2887
+ },
2888
+ "uniqueConstraints": {},
2889
+ "policies": {},
2890
+ "checkConstraints": {},
2891
+ "isRLSEnabled": false
2892
+ },
2893
+ "public.topic": {
2894
+ "name": "topic",
2895
+ "schema": "",
2896
+ "columns": {
2897
+ "id": {
2898
+ "name": "id",
2899
+ "type": "text",
2900
+ "primaryKey": true,
2901
+ "notNull": true
2902
+ },
2903
+ "organization_id": {
2904
+ "name": "organization_id",
2905
+ "type": "text",
2906
+ "primaryKey": false,
2907
+ "notNull": true
2908
+ },
2909
+ "name": {
2910
+ "name": "name",
2911
+ "type": "text",
2912
+ "primaryKey": false,
2913
+ "notNull": true
2914
+ },
2915
+ "slug": {
2916
+ "name": "slug",
2917
+ "type": "text",
2918
+ "primaryKey": false,
2919
+ "notNull": true
2920
+ },
2921
+ "description": {
2922
+ "name": "description",
2923
+ "type": "text",
2924
+ "primaryKey": false,
2925
+ "notNull": false
2926
+ },
2927
+ "public": {
2928
+ "name": "public",
2929
+ "type": "boolean",
2930
+ "primaryKey": false,
2931
+ "notNull": true,
2932
+ "default": true
2933
+ },
2934
+ "double_opt_in": {
2935
+ "name": "double_opt_in",
2936
+ "type": "boolean",
2937
+ "primaryKey": false,
2938
+ "notNull": true,
2939
+ "default": false
2940
+ },
2941
+ "created_at": {
2942
+ "name": "created_at",
2943
+ "type": "timestamp",
2944
+ "primaryKey": false,
2945
+ "notNull": true,
2946
+ "default": "now()"
2947
+ },
2948
+ "updated_at": {
2949
+ "name": "updated_at",
2950
+ "type": "timestamp",
2951
+ "primaryKey": false,
2952
+ "notNull": true,
2953
+ "default": "now()"
2954
+ },
2955
+ "created_by": {
2956
+ "name": "created_by",
2957
+ "type": "text",
2958
+ "primaryKey": false,
2959
+ "notNull": false
2960
+ }
2961
+ },
2962
+ "indexes": {
2963
+ "topic_org_idx": {
2964
+ "name": "topic_org_idx",
2965
+ "columns": [
2966
+ {
2967
+ "expression": "organization_id",
2968
+ "isExpression": false,
2969
+ "asc": true,
2970
+ "nulls": "last"
2971
+ }
2972
+ ],
2973
+ "isUnique": false,
2974
+ "concurrently": false,
2975
+ "method": "btree",
2976
+ "with": {}
2977
+ },
2978
+ "topic_unique_org_slug_idx": {
2979
+ "name": "topic_unique_org_slug_idx",
2980
+ "columns": [
2981
+ {
2982
+ "expression": "organization_id",
2983
+ "isExpression": false,
2984
+ "asc": true,
2985
+ "nulls": "last"
2986
+ },
2987
+ {
2988
+ "expression": "slug",
2989
+ "isExpression": false,
2990
+ "asc": true,
2991
+ "nulls": "last"
2992
+ }
2993
+ ],
2994
+ "isUnique": true,
2995
+ "concurrently": false,
2996
+ "method": "btree",
2997
+ "with": {}
2998
+ }
2999
+ },
3000
+ "foreignKeys": {
3001
+ "topic_organization_id_organization_id_fk": {
3002
+ "name": "topic_organization_id_organization_id_fk",
3003
+ "tableFrom": "topic",
3004
+ "tableTo": "organization",
3005
+ "columnsFrom": ["organization_id"],
3006
+ "columnsTo": ["id"],
3007
+ "onDelete": "cascade",
3008
+ "onUpdate": "no action"
3009
+ },
3010
+ "topic_created_by_user_id_fk": {
3011
+ "name": "topic_created_by_user_id_fk",
3012
+ "tableFrom": "topic",
3013
+ "tableTo": "user",
3014
+ "columnsFrom": ["created_by"],
3015
+ "columnsTo": ["id"],
3016
+ "onDelete": "no action",
3017
+ "onUpdate": "no action"
3018
+ }
3019
+ },
3020
+ "compositePrimaryKeys": {},
3021
+ "uniqueConstraints": {},
3022
+ "policies": {},
3023
+ "checkConstraints": {},
3024
+ "isRLSEnabled": false
3025
+ },
3026
+ "public.topic_settings": {
3027
+ "name": "topic_settings",
3028
+ "schema": "",
3029
+ "columns": {
3030
+ "organization_id": {
3031
+ "name": "organization_id",
3032
+ "type": "text",
3033
+ "primaryKey": true,
3034
+ "notNull": true
3035
+ },
3036
+ "confirmation_from_name": {
3037
+ "name": "confirmation_from_name",
3038
+ "type": "text",
3039
+ "primaryKey": false,
3040
+ "notNull": false
3041
+ },
3042
+ "confirmation_from_email": {
3043
+ "name": "confirmation_from_email",
3044
+ "type": "text",
3045
+ "primaryKey": false,
3046
+ "notNull": false
3047
+ },
3048
+ "confirmation_reply_to_email": {
3049
+ "name": "confirmation_reply_to_email",
3050
+ "type": "text",
3051
+ "primaryKey": false,
3052
+ "notNull": false
3053
+ },
3054
+ "confirmation_template_id": {
3055
+ "name": "confirmation_template_id",
3056
+ "type": "text",
3057
+ "primaryKey": false,
3058
+ "notNull": false
3059
+ },
3060
+ "preference_center_title": {
3061
+ "name": "preference_center_title",
3062
+ "type": "text",
3063
+ "primaryKey": false,
3064
+ "notNull": false
3065
+ },
3066
+ "preference_center_description": {
3067
+ "name": "preference_center_description",
3068
+ "type": "text",
3069
+ "primaryKey": false,
3070
+ "notNull": false
3071
+ },
3072
+ "updated_at": {
3073
+ "name": "updated_at",
3074
+ "type": "timestamp",
3075
+ "primaryKey": false,
3076
+ "notNull": true,
3077
+ "default": "now()"
3078
+ }
3079
+ },
3080
+ "indexes": {},
3081
+ "foreignKeys": {
3082
+ "topic_settings_organization_id_organization_id_fk": {
3083
+ "name": "topic_settings_organization_id_organization_id_fk",
3084
+ "tableFrom": "topic_settings",
3085
+ "tableTo": "organization",
3086
+ "columnsFrom": ["organization_id"],
3087
+ "columnsTo": ["id"],
3088
+ "onDelete": "cascade",
3089
+ "onUpdate": "no action"
3090
+ },
3091
+ "topic_settings_confirmation_template_id_template_id_fk": {
3092
+ "name": "topic_settings_confirmation_template_id_template_id_fk",
3093
+ "tableFrom": "topic_settings",
3094
+ "tableTo": "template",
3095
+ "columnsFrom": ["confirmation_template_id"],
3096
+ "columnsTo": ["id"],
3097
+ "onDelete": "set null",
3098
+ "onUpdate": "no action"
3099
+ }
3100
+ },
3101
+ "compositePrimaryKeys": {},
3102
+ "uniqueConstraints": {},
3103
+ "policies": {},
3104
+ "checkConstraints": {},
3105
+ "isRLSEnabled": false
3106
+ },
3107
+ "public.segment": {
3108
+ "name": "segment",
3109
+ "schema": "",
3110
+ "columns": {
3111
+ "id": {
3112
+ "name": "id",
3113
+ "type": "text",
3114
+ "primaryKey": true,
3115
+ "notNull": true
3116
+ },
3117
+ "organization_id": {
3118
+ "name": "organization_id",
3119
+ "type": "text",
3120
+ "primaryKey": false,
3121
+ "notNull": true
3122
+ },
3123
+ "name": {
3124
+ "name": "name",
3125
+ "type": "text",
3126
+ "primaryKey": false,
3127
+ "notNull": true
3128
+ },
3129
+ "description": {
3130
+ "name": "description",
3131
+ "type": "text",
3132
+ "primaryKey": false,
3133
+ "notNull": false
3134
+ },
3135
+ "condition": {
3136
+ "name": "condition",
3137
+ "type": "json",
3138
+ "primaryKey": false,
3139
+ "notNull": true
3140
+ },
3141
+ "track_membership": {
3142
+ "name": "track_membership",
3143
+ "type": "boolean",
3144
+ "primaryKey": false,
3145
+ "notNull": true,
3146
+ "default": false
3147
+ },
3148
+ "member_count": {
3149
+ "name": "member_count",
3150
+ "type": "integer",
3151
+ "primaryKey": false,
3152
+ "notNull": true,
3153
+ "default": 0
3154
+ },
3155
+ "last_computed_at": {
3156
+ "name": "last_computed_at",
3157
+ "type": "timestamp",
3158
+ "primaryKey": false,
3159
+ "notNull": false
3160
+ },
3161
+ "created_by": {
3162
+ "name": "created_by",
3163
+ "type": "text",
3164
+ "primaryKey": false,
3165
+ "notNull": false
3166
+ },
3167
+ "created_at": {
3168
+ "name": "created_at",
3169
+ "type": "timestamp",
3170
+ "primaryKey": false,
3171
+ "notNull": true,
3172
+ "default": "now()"
3173
+ },
3174
+ "updated_at": {
3175
+ "name": "updated_at",
3176
+ "type": "timestamp",
3177
+ "primaryKey": false,
3178
+ "notNull": true,
3179
+ "default": "now()"
3180
+ }
3181
+ },
3182
+ "indexes": {
3183
+ "segment_org_idx": {
3184
+ "name": "segment_org_idx",
3185
+ "columns": [
3186
+ {
3187
+ "expression": "organization_id",
3188
+ "isExpression": false,
3189
+ "asc": true,
3190
+ "nulls": "last"
3191
+ }
3192
+ ],
3193
+ "isUnique": false,
3194
+ "concurrently": false,
3195
+ "method": "btree",
3196
+ "with": {}
3197
+ },
3198
+ "segment_name_idx": {
3199
+ "name": "segment_name_idx",
3200
+ "columns": [
3201
+ {
3202
+ "expression": "organization_id",
3203
+ "isExpression": false,
3204
+ "asc": true,
3205
+ "nulls": "last"
3206
+ },
3207
+ {
3208
+ "expression": "name",
3209
+ "isExpression": false,
3210
+ "asc": true,
3211
+ "nulls": "last"
3212
+ }
3213
+ ],
3214
+ "isUnique": false,
3215
+ "concurrently": false,
3216
+ "method": "btree",
3217
+ "with": {}
3218
+ }
3219
+ },
3220
+ "foreignKeys": {
3221
+ "segment_organization_id_organization_id_fk": {
3222
+ "name": "segment_organization_id_organization_id_fk",
3223
+ "tableFrom": "segment",
3224
+ "tableTo": "organization",
3225
+ "columnsFrom": ["organization_id"],
3226
+ "columnsTo": ["id"],
3227
+ "onDelete": "cascade",
3228
+ "onUpdate": "no action"
3229
+ },
3230
+ "segment_created_by_user_id_fk": {
3231
+ "name": "segment_created_by_user_id_fk",
3232
+ "tableFrom": "segment",
3233
+ "tableTo": "user",
3234
+ "columnsFrom": ["created_by"],
3235
+ "columnsTo": ["id"],
3236
+ "onDelete": "no action",
3237
+ "onUpdate": "no action"
3238
+ }
3239
+ },
3240
+ "compositePrimaryKeys": {},
3241
+ "uniqueConstraints": {},
3242
+ "policies": {},
3243
+ "checkConstraints": {},
3244
+ "isRLSEnabled": false
3245
+ },
3246
+ "public.ai_conversation": {
3247
+ "name": "ai_conversation",
3248
+ "schema": "",
3249
+ "columns": {
3250
+ "id": {
3251
+ "name": "id",
3252
+ "type": "text",
3253
+ "primaryKey": true,
3254
+ "notNull": true
3255
+ },
3256
+ "organization_id": {
3257
+ "name": "organization_id",
3258
+ "type": "text",
3259
+ "primaryKey": false,
3260
+ "notNull": true
3261
+ },
3262
+ "template_id": {
3263
+ "name": "template_id",
3264
+ "type": "text",
3265
+ "primaryKey": false,
3266
+ "notNull": false
3267
+ },
3268
+ "messages": {
3269
+ "name": "messages",
3270
+ "type": "jsonb",
3271
+ "primaryKey": false,
3272
+ "notNull": false,
3273
+ "default": "'[]'::jsonb"
3274
+ },
3275
+ "total_tokens": {
3276
+ "name": "total_tokens",
3277
+ "type": "integer",
3278
+ "primaryKey": false,
3279
+ "notNull": true,
3280
+ "default": 0
3281
+ },
3282
+ "created_at": {
3283
+ "name": "created_at",
3284
+ "type": "timestamp",
3285
+ "primaryKey": false,
3286
+ "notNull": true,
3287
+ "default": "now()"
3288
+ },
3289
+ "updated_at": {
3290
+ "name": "updated_at",
3291
+ "type": "timestamp",
3292
+ "primaryKey": false,
3293
+ "notNull": true,
3294
+ "default": "now()"
3295
+ },
3296
+ "created_by": {
3297
+ "name": "created_by",
3298
+ "type": "text",
3299
+ "primaryKey": false,
3300
+ "notNull": true
3301
+ }
3302
+ },
3303
+ "indexes": {
3304
+ "ai_conversation_org_idx": {
3305
+ "name": "ai_conversation_org_idx",
3306
+ "columns": [
3307
+ {
3308
+ "expression": "organization_id",
3309
+ "isExpression": false,
3310
+ "asc": true,
3311
+ "nulls": "last"
3312
+ }
3313
+ ],
3314
+ "isUnique": false,
3315
+ "concurrently": false,
3316
+ "method": "btree",
3317
+ "with": {}
3318
+ },
3319
+ "ai_conversation_template_idx": {
3320
+ "name": "ai_conversation_template_idx",
3321
+ "columns": [
3322
+ {
3323
+ "expression": "template_id",
3324
+ "isExpression": false,
3325
+ "asc": true,
3326
+ "nulls": "last"
3327
+ }
3328
+ ],
3329
+ "isUnique": false,
3330
+ "concurrently": false,
3331
+ "method": "btree",
3332
+ "with": {}
3333
+ }
3334
+ },
3335
+ "foreignKeys": {
3336
+ "ai_conversation_organization_id_organization_id_fk": {
3337
+ "name": "ai_conversation_organization_id_organization_id_fk",
3338
+ "tableFrom": "ai_conversation",
3339
+ "tableTo": "organization",
3340
+ "columnsFrom": ["organization_id"],
3341
+ "columnsTo": ["id"],
3342
+ "onDelete": "cascade",
3343
+ "onUpdate": "no action"
3344
+ },
3345
+ "ai_conversation_template_id_template_id_fk": {
3346
+ "name": "ai_conversation_template_id_template_id_fk",
3347
+ "tableFrom": "ai_conversation",
3348
+ "tableTo": "template",
3349
+ "columnsFrom": ["template_id"],
3350
+ "columnsTo": ["id"],
3351
+ "onDelete": "cascade",
3352
+ "onUpdate": "no action"
3353
+ },
3354
+ "ai_conversation_created_by_user_id_fk": {
3355
+ "name": "ai_conversation_created_by_user_id_fk",
3356
+ "tableFrom": "ai_conversation",
3357
+ "tableTo": "user",
3358
+ "columnsFrom": ["created_by"],
3359
+ "columnsTo": ["id"],
3360
+ "onDelete": "set null",
3361
+ "onUpdate": "no action"
3362
+ }
3363
+ },
3364
+ "compositePrimaryKeys": {},
3365
+ "uniqueConstraints": {},
3366
+ "policies": {},
3367
+ "checkConstraints": {},
3368
+ "isRLSEnabled": false
3369
+ },
3370
+ "public.brand_kit": {
3371
+ "name": "brand_kit",
3372
+ "schema": "",
3373
+ "columns": {
3374
+ "id": {
3375
+ "name": "id",
3376
+ "type": "text",
3377
+ "primaryKey": true,
3378
+ "notNull": true
3379
+ },
3380
+ "organization_id": {
3381
+ "name": "organization_id",
3382
+ "type": "text",
3383
+ "primaryKey": false,
3384
+ "notNull": true
3385
+ },
3386
+ "name": {
3387
+ "name": "name",
3388
+ "type": "text",
3389
+ "primaryKey": false,
3390
+ "notNull": true,
3391
+ "default": "'Default'"
3392
+ },
3393
+ "logo_url": {
3394
+ "name": "logo_url",
3395
+ "type": "text",
3396
+ "primaryKey": false,
3397
+ "notNull": false
3398
+ },
3399
+ "primary_color": {
3400
+ "name": "primary_color",
3401
+ "type": "text",
3402
+ "primaryKey": false,
3403
+ "notNull": true,
3404
+ "default": "'#5046e5'"
3405
+ },
3406
+ "secondary_color": {
3407
+ "name": "secondary_color",
3408
+ "type": "text",
3409
+ "primaryKey": false,
3410
+ "notNull": true,
3411
+ "default": "'#6366f1'"
3412
+ },
3413
+ "background_color": {
3414
+ "name": "background_color",
3415
+ "type": "text",
3416
+ "primaryKey": false,
3417
+ "notNull": true,
3418
+ "default": "'#ffffff'"
3419
+ },
3420
+ "text_color": {
3421
+ "name": "text_color",
3422
+ "type": "text",
3423
+ "primaryKey": false,
3424
+ "notNull": true,
3425
+ "default": "'#1f2937'"
3426
+ },
3427
+ "font_family": {
3428
+ "name": "font_family",
3429
+ "type": "text",
3430
+ "primaryKey": false,
3431
+ "notNull": true,
3432
+ "default": "'system-ui, sans-serif'"
3433
+ },
3434
+ "heading_font_family": {
3435
+ "name": "heading_font_family",
3436
+ "type": "text",
3437
+ "primaryKey": false,
3438
+ "notNull": false
3439
+ },
3440
+ "button_style": {
3441
+ "name": "button_style",
3442
+ "type": "text",
3443
+ "primaryKey": false,
3444
+ "notNull": true,
3445
+ "default": "'rounded'"
3446
+ },
3447
+ "button_radius": {
3448
+ "name": "button_radius",
3449
+ "type": "text",
3450
+ "primaryKey": false,
3451
+ "notNull": true,
3452
+ "default": "'4px'"
3453
+ },
3454
+ "company_name": {
3455
+ "name": "company_name",
3456
+ "type": "text",
3457
+ "primaryKey": false,
3458
+ "notNull": false
3459
+ },
3460
+ "company_address": {
3461
+ "name": "company_address",
3462
+ "type": "text",
3463
+ "primaryKey": false,
3464
+ "notNull": false
3465
+ },
3466
+ "social_links": {
3467
+ "name": "social_links",
3468
+ "type": "jsonb",
3469
+ "primaryKey": false,
3470
+ "notNull": false,
3471
+ "default": "'[]'::jsonb"
3472
+ },
3473
+ "source_domain": {
3474
+ "name": "source_domain",
3475
+ "type": "text",
3476
+ "primaryKey": false,
3477
+ "notNull": false
3478
+ },
3479
+ "auto_extracted": {
3480
+ "name": "auto_extracted",
3481
+ "type": "boolean",
3482
+ "primaryKey": false,
3483
+ "notNull": true,
3484
+ "default": false
3485
+ },
3486
+ "is_default": {
3487
+ "name": "is_default",
3488
+ "type": "boolean",
3489
+ "primaryKey": false,
3490
+ "notNull": true,
3491
+ "default": false
3492
+ },
3493
+ "created_at": {
3494
+ "name": "created_at",
3495
+ "type": "timestamp",
3496
+ "primaryKey": false,
3497
+ "notNull": true,
3498
+ "default": "now()"
3499
+ },
3500
+ "updated_at": {
3501
+ "name": "updated_at",
3502
+ "type": "timestamp",
3503
+ "primaryKey": false,
3504
+ "notNull": true,
3505
+ "default": "now()"
3506
+ }
3507
+ },
3508
+ "indexes": {
3509
+ "brand_kit_org_idx": {
3510
+ "name": "brand_kit_org_idx",
3511
+ "columns": [
3512
+ {
3513
+ "expression": "organization_id",
3514
+ "isExpression": false,
3515
+ "asc": true,
3516
+ "nulls": "last"
3517
+ }
3518
+ ],
3519
+ "isUnique": false,
3520
+ "concurrently": false,
3521
+ "method": "btree",
3522
+ "with": {}
3523
+ },
3524
+ "brand_kit_default_idx": {
3525
+ "name": "brand_kit_default_idx",
3526
+ "columns": [
3527
+ {
3528
+ "expression": "organization_id",
3529
+ "isExpression": false,
3530
+ "asc": true,
3531
+ "nulls": "last"
3532
+ },
3533
+ {
3534
+ "expression": "is_default",
3535
+ "isExpression": false,
3536
+ "asc": true,
3537
+ "nulls": "last"
3538
+ }
3539
+ ],
3540
+ "isUnique": false,
3541
+ "concurrently": false,
3542
+ "method": "btree",
3543
+ "with": {}
3544
+ }
3545
+ },
3546
+ "foreignKeys": {
3547
+ "brand_kit_organization_id_organization_id_fk": {
3548
+ "name": "brand_kit_organization_id_organization_id_fk",
3549
+ "tableFrom": "brand_kit",
3550
+ "tableTo": "organization",
3551
+ "columnsFrom": ["organization_id"],
3552
+ "columnsTo": ["id"],
3553
+ "onDelete": "cascade",
3554
+ "onUpdate": "no action"
3555
+ }
3556
+ },
3557
+ "compositePrimaryKeys": {},
3558
+ "uniqueConstraints": {},
3559
+ "policies": {},
3560
+ "checkConstraints": {},
3561
+ "isRLSEnabled": false
3562
+ },
3563
+ "public.reusable_block": {
3564
+ "name": "reusable_block",
3565
+ "schema": "",
3566
+ "columns": {
3567
+ "id": {
3568
+ "name": "id",
3569
+ "type": "text",
3570
+ "primaryKey": true,
3571
+ "notNull": true
3572
+ },
3573
+ "organization_id": {
3574
+ "name": "organization_id",
3575
+ "type": "text",
3576
+ "primaryKey": false,
3577
+ "notNull": true
3578
+ },
3579
+ "name": {
3580
+ "name": "name",
3581
+ "type": "text",
3582
+ "primaryKey": false,
3583
+ "notNull": true
3584
+ },
3585
+ "description": {
3586
+ "name": "description",
3587
+ "type": "text",
3588
+ "primaryKey": false,
3589
+ "notNull": false
3590
+ },
3591
+ "category": {
3592
+ "name": "category",
3593
+ "type": "text",
3594
+ "primaryKey": false,
3595
+ "notNull": true,
3596
+ "default": "'custom'"
3597
+ },
3598
+ "content": {
3599
+ "name": "content",
3600
+ "type": "jsonb",
3601
+ "primaryKey": false,
3602
+ "notNull": true
3603
+ },
3604
+ "thumbnail": {
3605
+ "name": "thumbnail",
3606
+ "type": "text",
3607
+ "primaryKey": false,
3608
+ "notNull": false
3609
+ },
3610
+ "is_public": {
3611
+ "name": "is_public",
3612
+ "type": "boolean",
3613
+ "primaryKey": false,
3614
+ "notNull": true,
3615
+ "default": false
3616
+ },
3617
+ "usage_count": {
3618
+ "name": "usage_count",
3619
+ "type": "integer",
3620
+ "primaryKey": false,
3621
+ "notNull": true,
3622
+ "default": 0
3623
+ },
3624
+ "created_at": {
3625
+ "name": "created_at",
3626
+ "type": "timestamp",
3627
+ "primaryKey": false,
3628
+ "notNull": true,
3629
+ "default": "now()"
3630
+ },
3631
+ "updated_at": {
3632
+ "name": "updated_at",
3633
+ "type": "timestamp",
3634
+ "primaryKey": false,
3635
+ "notNull": true,
3636
+ "default": "now()"
3637
+ },
3638
+ "created_by": {
3639
+ "name": "created_by",
3640
+ "type": "text",
3641
+ "primaryKey": false,
3642
+ "notNull": true
3643
+ }
3644
+ },
3645
+ "indexes": {
3646
+ "reusable_block_org_idx": {
3647
+ "name": "reusable_block_org_idx",
3648
+ "columns": [
3649
+ {
3650
+ "expression": "organization_id",
3651
+ "isExpression": false,
3652
+ "asc": true,
3653
+ "nulls": "last"
3654
+ }
3655
+ ],
3656
+ "isUnique": false,
3657
+ "concurrently": false,
3658
+ "method": "btree",
3659
+ "with": {}
3660
+ },
3661
+ "reusable_block_created_by_category_idx": {
3662
+ "name": "reusable_block_created_by_category_idx",
3663
+ "columns": [
3664
+ {
3665
+ "expression": "created_by",
3666
+ "isExpression": false,
3667
+ "asc": true,
3668
+ "nulls": "last"
3669
+ },
3670
+ {
3671
+ "expression": "category",
3672
+ "isExpression": false,
3673
+ "asc": true,
3674
+ "nulls": "last"
3675
+ }
3676
+ ],
3677
+ "isUnique": false,
3678
+ "concurrently": false,
3679
+ "method": "btree",
3680
+ "with": {}
3681
+ },
3682
+ "reusable_block_public_category_idx": {
3683
+ "name": "reusable_block_public_category_idx",
3684
+ "columns": [
3685
+ {
3686
+ "expression": "is_public",
3687
+ "isExpression": false,
3688
+ "asc": true,
3689
+ "nulls": "last"
3690
+ },
3691
+ {
3692
+ "expression": "category",
3693
+ "isExpression": false,
3694
+ "asc": true,
3695
+ "nulls": "last"
3696
+ }
3697
+ ],
3698
+ "isUnique": false,
3699
+ "concurrently": false,
3700
+ "method": "btree",
3701
+ "with": {}
3702
+ }
3703
+ },
3704
+ "foreignKeys": {
3705
+ "reusable_block_organization_id_organization_id_fk": {
3706
+ "name": "reusable_block_organization_id_organization_id_fk",
3707
+ "tableFrom": "reusable_block",
3708
+ "tableTo": "organization",
3709
+ "columnsFrom": ["organization_id"],
3710
+ "columnsTo": ["id"],
3711
+ "onDelete": "cascade",
3712
+ "onUpdate": "no action"
3713
+ },
3714
+ "reusable_block_created_by_user_id_fk": {
3715
+ "name": "reusable_block_created_by_user_id_fk",
3716
+ "tableFrom": "reusable_block",
3717
+ "tableTo": "user",
3718
+ "columnsFrom": ["created_by"],
3719
+ "columnsTo": ["id"],
3720
+ "onDelete": "set null",
3721
+ "onUpdate": "no action"
3722
+ }
3723
+ },
3724
+ "compositePrimaryKeys": {},
3725
+ "uniqueConstraints": {},
3726
+ "policies": {},
3727
+ "checkConstraints": {},
3728
+ "isRLSEnabled": false
3729
+ },
3730
+ "public.template": {
3731
+ "name": "template",
3732
+ "schema": "",
3733
+ "columns": {
3734
+ "id": {
3735
+ "name": "id",
3736
+ "type": "text",
3737
+ "primaryKey": true,
3738
+ "notNull": true
3739
+ },
3740
+ "organization_id": {
3741
+ "name": "organization_id",
3742
+ "type": "text",
3743
+ "primaryKey": false,
3744
+ "notNull": true
3745
+ },
3746
+ "name": {
3747
+ "name": "name",
3748
+ "type": "text",
3749
+ "primaryKey": false,
3750
+ "notNull": true
3751
+ },
3752
+ "description": {
3753
+ "name": "description",
3754
+ "type": "text",
3755
+ "primaryKey": false,
3756
+ "notNull": false
3757
+ },
3758
+ "subject": {
3759
+ "name": "subject",
3760
+ "type": "text",
3761
+ "primaryKey": false,
3762
+ "notNull": false
3763
+ },
3764
+ "email_type": {
3765
+ "name": "email_type",
3766
+ "type": "email_type",
3767
+ "typeSchema": "public",
3768
+ "primaryKey": false,
3769
+ "notNull": true,
3770
+ "default": "'marketing'"
3771
+ },
3772
+ "content": {
3773
+ "name": "content",
3774
+ "type": "jsonb",
3775
+ "primaryKey": false,
3776
+ "notNull": true
3777
+ },
3778
+ "compiled_html": {
3779
+ "name": "compiled_html",
3780
+ "type": "text",
3781
+ "primaryKey": false,
3782
+ "notNull": false
3783
+ },
3784
+ "compiled_text": {
3785
+ "name": "compiled_text",
3786
+ "type": "text",
3787
+ "primaryKey": false,
3788
+ "notNull": false
3789
+ },
3790
+ "variables": {
3791
+ "name": "variables",
3792
+ "type": "jsonb",
3793
+ "primaryKey": false,
3794
+ "notNull": false,
3795
+ "default": "'[]'::jsonb"
3796
+ },
3797
+ "test_data": {
3798
+ "name": "test_data",
3799
+ "type": "jsonb",
3800
+ "primaryKey": false,
3801
+ "notNull": false,
3802
+ "default": "'{}'::jsonb"
3803
+ },
3804
+ "room_id": {
3805
+ "name": "room_id",
3806
+ "type": "text",
3807
+ "primaryKey": false,
3808
+ "notNull": false
3809
+ },
3810
+ "is_collaborative": {
3811
+ "name": "is_collaborative",
3812
+ "type": "boolean",
3813
+ "primaryKey": false,
3814
+ "notNull": true,
3815
+ "default": false
3816
+ },
3817
+ "ai_generated": {
3818
+ "name": "ai_generated",
3819
+ "type": "boolean",
3820
+ "primaryKey": false,
3821
+ "notNull": true,
3822
+ "default": false
3823
+ },
3824
+ "ai_conversation_id": {
3825
+ "name": "ai_conversation_id",
3826
+ "type": "text",
3827
+ "primaryKey": false,
3828
+ "notNull": false
3829
+ },
3830
+ "ses_template_name": {
3831
+ "name": "ses_template_name",
3832
+ "type": "text",
3833
+ "primaryKey": false,
3834
+ "notNull": false
3835
+ },
3836
+ "published_at": {
3837
+ "name": "published_at",
3838
+ "type": "timestamp",
3839
+ "primaryKey": false,
3840
+ "notNull": false
3841
+ },
3842
+ "status": {
3843
+ "name": "status",
3844
+ "type": "template_status",
3845
+ "typeSchema": "public",
3846
+ "primaryKey": false,
3847
+ "notNull": true,
3848
+ "default": "'DRAFT'"
3849
+ },
3850
+ "created_at": {
3851
+ "name": "created_at",
3852
+ "type": "timestamp",
3853
+ "primaryKey": false,
3854
+ "notNull": true,
3855
+ "default": "now()"
3856
+ },
3857
+ "updated_at": {
3858
+ "name": "updated_at",
3859
+ "type": "timestamp",
3860
+ "primaryKey": false,
3861
+ "notNull": true,
3862
+ "default": "now()"
3863
+ },
3864
+ "created_by": {
3865
+ "name": "created_by",
3866
+ "type": "text",
3867
+ "primaryKey": false,
3868
+ "notNull": true
3869
+ },
3870
+ "last_edited_by": {
3871
+ "name": "last_edited_by",
3872
+ "type": "text",
3873
+ "primaryKey": false,
3874
+ "notNull": false
3875
+ }
3876
+ },
3877
+ "indexes": {
3878
+ "template_org_idx": {
3879
+ "name": "template_org_idx",
3880
+ "columns": [
3881
+ {
3882
+ "expression": "organization_id",
3883
+ "isExpression": false,
3884
+ "asc": true,
3885
+ "nulls": "last"
3886
+ }
3887
+ ],
3888
+ "isUnique": false,
3889
+ "concurrently": false,
3890
+ "method": "btree",
3891
+ "with": {}
3892
+ },
3893
+ "template_status_updated_at_idx": {
3894
+ "name": "template_status_updated_at_idx",
3895
+ "columns": [
3896
+ {
3897
+ "expression": "status",
3898
+ "isExpression": false,
3899
+ "asc": true,
3900
+ "nulls": "last"
3901
+ },
3902
+ {
3903
+ "expression": "updated_at",
3904
+ "isExpression": false,
3905
+ "asc": true,
3906
+ "nulls": "last"
3907
+ }
3908
+ ],
3909
+ "isUnique": false,
3910
+ "concurrently": false,
3911
+ "method": "btree",
3912
+ "with": {}
3913
+ },
3914
+ "template_created_by_idx": {
3915
+ "name": "template_created_by_idx",
3916
+ "columns": [
3917
+ {
3918
+ "expression": "created_by",
3919
+ "isExpression": false,
3920
+ "asc": true,
3921
+ "nulls": "last"
3922
+ }
3923
+ ],
3924
+ "isUnique": false,
3925
+ "concurrently": false,
3926
+ "method": "btree",
3927
+ "with": {}
3928
+ },
3929
+ "template_room_id_idx": {
3930
+ "name": "template_room_id_idx",
3931
+ "columns": [
3932
+ {
3933
+ "expression": "room_id",
3934
+ "isExpression": false,
3935
+ "asc": true,
3936
+ "nulls": "last"
3937
+ }
3938
+ ],
3939
+ "isUnique": true,
3940
+ "concurrently": false,
3941
+ "method": "btree",
3942
+ "with": {}
3943
+ }
3944
+ },
3945
+ "foreignKeys": {
3946
+ "template_organization_id_organization_id_fk": {
3947
+ "name": "template_organization_id_organization_id_fk",
3948
+ "tableFrom": "template",
3949
+ "tableTo": "organization",
3950
+ "columnsFrom": ["organization_id"],
3951
+ "columnsTo": ["id"],
3952
+ "onDelete": "cascade",
3953
+ "onUpdate": "no action"
3954
+ },
3955
+ "template_created_by_user_id_fk": {
3956
+ "name": "template_created_by_user_id_fk",
3957
+ "tableFrom": "template",
3958
+ "tableTo": "user",
3959
+ "columnsFrom": ["created_by"],
3960
+ "columnsTo": ["id"],
3961
+ "onDelete": "set null",
3962
+ "onUpdate": "no action"
3963
+ },
3964
+ "template_last_edited_by_user_id_fk": {
3965
+ "name": "template_last_edited_by_user_id_fk",
3966
+ "tableFrom": "template",
3967
+ "tableTo": "user",
3968
+ "columnsFrom": ["last_edited_by"],
3969
+ "columnsTo": ["id"],
3970
+ "onDelete": "set null",
3971
+ "onUpdate": "no action"
3972
+ }
3973
+ },
3974
+ "compositePrimaryKeys": {},
3975
+ "uniqueConstraints": {},
3976
+ "policies": {},
3977
+ "checkConstraints": {},
3978
+ "isRLSEnabled": false
3979
+ },
3980
+ "public.template_variable": {
3981
+ "name": "template_variable",
3982
+ "schema": "",
3983
+ "columns": {
3984
+ "id": {
3985
+ "name": "id",
3986
+ "type": "text",
3987
+ "primaryKey": true,
3988
+ "notNull": true
3989
+ },
3990
+ "organization_id": {
3991
+ "name": "organization_id",
3992
+ "type": "text",
3993
+ "primaryKey": false,
3994
+ "notNull": true
3995
+ },
3996
+ "name": {
3997
+ "name": "name",
3998
+ "type": "text",
3999
+ "primaryKey": false,
4000
+ "notNull": true
4001
+ },
4002
+ "label": {
4003
+ "name": "label",
4004
+ "type": "text",
4005
+ "primaryKey": false,
4006
+ "notNull": true
4007
+ },
4008
+ "type": {
4009
+ "name": "type",
4010
+ "type": "variable_type",
4011
+ "typeSchema": "public",
4012
+ "primaryKey": false,
4013
+ "notNull": true
4014
+ },
4015
+ "required": {
4016
+ "name": "required",
4017
+ "type": "boolean",
4018
+ "primaryKey": false,
4019
+ "notNull": true,
4020
+ "default": false
4021
+ },
4022
+ "fallback": {
4023
+ "name": "fallback",
4024
+ "type": "text",
4025
+ "primaryKey": false,
4026
+ "notNull": false
4027
+ },
4028
+ "validation": {
4029
+ "name": "validation",
4030
+ "type": "jsonb",
4031
+ "primaryKey": false,
4032
+ "notNull": false
4033
+ },
4034
+ "created_at": {
4035
+ "name": "created_at",
4036
+ "type": "timestamp",
4037
+ "primaryKey": false,
4038
+ "notNull": true,
4039
+ "default": "now()"
4040
+ },
4041
+ "updated_at": {
4042
+ "name": "updated_at",
4043
+ "type": "timestamp",
4044
+ "primaryKey": false,
4045
+ "notNull": true,
4046
+ "default": "now()"
4047
+ }
4048
+ },
4049
+ "indexes": {
4050
+ "template_variable_org_name_idx": {
4051
+ "name": "template_variable_org_name_idx",
4052
+ "columns": [
4053
+ {
4054
+ "expression": "organization_id",
4055
+ "isExpression": false,
4056
+ "asc": true,
4057
+ "nulls": "last"
4058
+ },
4059
+ {
4060
+ "expression": "name",
4061
+ "isExpression": false,
4062
+ "asc": true,
4063
+ "nulls": "last"
4064
+ }
4065
+ ],
4066
+ "isUnique": true,
4067
+ "concurrently": false,
4068
+ "method": "btree",
4069
+ "with": {}
4070
+ }
4071
+ },
4072
+ "foreignKeys": {
4073
+ "template_variable_organization_id_organization_id_fk": {
4074
+ "name": "template_variable_organization_id_organization_id_fk",
4075
+ "tableFrom": "template_variable",
4076
+ "tableTo": "organization",
4077
+ "columnsFrom": ["organization_id"],
4078
+ "columnsTo": ["id"],
4079
+ "onDelete": "cascade",
4080
+ "onUpdate": "no action"
4081
+ }
4082
+ },
4083
+ "compositePrimaryKeys": {},
4084
+ "uniqueConstraints": {},
4085
+ "policies": {},
4086
+ "checkConstraints": {},
4087
+ "isRLSEnabled": false
4088
+ },
4089
+ "public.template_version": {
4090
+ "name": "template_version",
4091
+ "schema": "",
4092
+ "columns": {
4093
+ "id": {
4094
+ "name": "id",
4095
+ "type": "text",
4096
+ "primaryKey": true,
4097
+ "notNull": true
4098
+ },
4099
+ "template_id": {
4100
+ "name": "template_id",
4101
+ "type": "text",
4102
+ "primaryKey": false,
4103
+ "notNull": true
4104
+ },
4105
+ "content": {
4106
+ "name": "content",
4107
+ "type": "jsonb",
4108
+ "primaryKey": false,
4109
+ "notNull": true
4110
+ },
4111
+ "version": {
4112
+ "name": "version",
4113
+ "type": "integer",
4114
+ "primaryKey": false,
4115
+ "notNull": true
4116
+ },
4117
+ "created_at": {
4118
+ "name": "created_at",
4119
+ "type": "timestamp",
4120
+ "primaryKey": false,
4121
+ "notNull": true,
4122
+ "default": "now()"
4123
+ },
4124
+ "created_by": {
4125
+ "name": "created_by",
4126
+ "type": "text",
4127
+ "primaryKey": false,
4128
+ "notNull": true
4129
+ },
4130
+ "change_note": {
4131
+ "name": "change_note",
4132
+ "type": "text",
4133
+ "primaryKey": false,
4134
+ "notNull": false
4135
+ }
4136
+ },
4137
+ "indexes": {
4138
+ "template_version_template_version_idx": {
4139
+ "name": "template_version_template_version_idx",
4140
+ "columns": [
4141
+ {
4142
+ "expression": "template_id",
4143
+ "isExpression": false,
4144
+ "asc": true,
4145
+ "nulls": "last"
4146
+ },
4147
+ {
4148
+ "expression": "version",
4149
+ "isExpression": false,
4150
+ "asc": true,
4151
+ "nulls": "last"
4152
+ }
4153
+ ],
4154
+ "isUnique": true,
4155
+ "concurrently": false,
4156
+ "method": "btree",
4157
+ "with": {}
4158
+ },
4159
+ "template_version_template_created_at_idx": {
4160
+ "name": "template_version_template_created_at_idx",
4161
+ "columns": [
4162
+ {
4163
+ "expression": "template_id",
4164
+ "isExpression": false,
4165
+ "asc": true,
4166
+ "nulls": "last"
4167
+ },
4168
+ {
4169
+ "expression": "created_at",
4170
+ "isExpression": false,
4171
+ "asc": true,
4172
+ "nulls": "last"
4173
+ }
4174
+ ],
4175
+ "isUnique": false,
4176
+ "concurrently": false,
4177
+ "method": "btree",
4178
+ "with": {}
4179
+ }
4180
+ },
4181
+ "foreignKeys": {
4182
+ "template_version_template_id_template_id_fk": {
4183
+ "name": "template_version_template_id_template_id_fk",
4184
+ "tableFrom": "template_version",
4185
+ "tableTo": "template",
4186
+ "columnsFrom": ["template_id"],
4187
+ "columnsTo": ["id"],
4188
+ "onDelete": "cascade",
4189
+ "onUpdate": "no action"
4190
+ },
4191
+ "template_version_created_by_user_id_fk": {
4192
+ "name": "template_version_created_by_user_id_fk",
4193
+ "tableFrom": "template_version",
4194
+ "tableTo": "user",
4195
+ "columnsFrom": ["created_by"],
4196
+ "columnsTo": ["id"],
4197
+ "onDelete": "set null",
4198
+ "onUpdate": "no action"
4199
+ }
4200
+ },
4201
+ "compositePrimaryKeys": {},
4202
+ "uniqueConstraints": {},
4203
+ "policies": {},
4204
+ "checkConstraints": {},
4205
+ "isRLSEnabled": false
4206
+ },
4207
+ "public.ai_usage_log": {
4208
+ "name": "ai_usage_log",
4209
+ "schema": "",
4210
+ "columns": {
4211
+ "id": {
4212
+ "name": "id",
4213
+ "type": "text",
4214
+ "primaryKey": true,
4215
+ "notNull": true
4216
+ },
4217
+ "organization_id": {
4218
+ "name": "organization_id",
4219
+ "type": "text",
4220
+ "primaryKey": false,
4221
+ "notNull": true
4222
+ },
4223
+ "user_id": {
4224
+ "name": "user_id",
4225
+ "type": "text",
4226
+ "primaryKey": false,
4227
+ "notNull": false
4228
+ },
4229
+ "period_key": {
4230
+ "name": "period_key",
4231
+ "type": "text",
4232
+ "primaryKey": false,
4233
+ "notNull": true
4234
+ },
4235
+ "feature_type": {
4236
+ "name": "feature_type",
4237
+ "type": "text",
4238
+ "primaryKey": false,
4239
+ "notNull": true,
4240
+ "default": "'ai_chat'"
4241
+ },
4242
+ "template_id": {
4243
+ "name": "template_id",
4244
+ "type": "text",
4245
+ "primaryKey": false,
4246
+ "notNull": false
4247
+ },
4248
+ "input_tokens": {
4249
+ "name": "input_tokens",
4250
+ "type": "integer",
4251
+ "primaryKey": false,
4252
+ "notNull": false
4253
+ },
4254
+ "output_tokens": {
4255
+ "name": "output_tokens",
4256
+ "type": "integer",
4257
+ "primaryKey": false,
4258
+ "notNull": false
4259
+ },
4260
+ "total_tokens": {
4261
+ "name": "total_tokens",
4262
+ "type": "integer",
4263
+ "primaryKey": false,
4264
+ "notNull": false
4265
+ },
4266
+ "model": {
4267
+ "name": "model",
4268
+ "type": "text",
4269
+ "primaryKey": false,
4270
+ "notNull": false
4271
+ },
4272
+ "duration_ms": {
4273
+ "name": "duration_ms",
4274
+ "type": "integer",
4275
+ "primaryKey": false,
4276
+ "notNull": false
4277
+ },
4278
+ "created_at": {
4279
+ "name": "created_at",
4280
+ "type": "timestamp",
4281
+ "primaryKey": false,
4282
+ "notNull": true,
4283
+ "default": "now()"
4284
+ }
4285
+ },
4286
+ "indexes": {
4287
+ "ai_usage_log_org_idx": {
4288
+ "name": "ai_usage_log_org_idx",
4289
+ "columns": [
4290
+ {
4291
+ "expression": "organization_id",
4292
+ "isExpression": false,
4293
+ "asc": true,
4294
+ "nulls": "last"
4295
+ }
4296
+ ],
4297
+ "isUnique": false,
4298
+ "concurrently": false,
4299
+ "method": "btree",
4300
+ "with": {}
4301
+ },
4302
+ "ai_usage_log_period_idx": {
4303
+ "name": "ai_usage_log_period_idx",
4304
+ "columns": [
4305
+ {
4306
+ "expression": "period_key",
4307
+ "isExpression": false,
4308
+ "asc": true,
4309
+ "nulls": "last"
4310
+ }
4311
+ ],
4312
+ "isUnique": false,
4313
+ "concurrently": false,
4314
+ "method": "btree",
4315
+ "with": {}
4316
+ },
4317
+ "ai_usage_log_org_period_idx": {
4318
+ "name": "ai_usage_log_org_period_idx",
4319
+ "columns": [
4320
+ {
4321
+ "expression": "organization_id",
4322
+ "isExpression": false,
4323
+ "asc": true,
4324
+ "nulls": "last"
4325
+ },
4326
+ {
4327
+ "expression": "period_key",
4328
+ "isExpression": false,
4329
+ "asc": true,
4330
+ "nulls": "last"
4331
+ }
4332
+ ],
4333
+ "isUnique": false,
4334
+ "concurrently": false,
4335
+ "method": "btree",
4336
+ "with": {}
4337
+ },
4338
+ "ai_usage_log_user_idx": {
4339
+ "name": "ai_usage_log_user_idx",
4340
+ "columns": [
4341
+ {
4342
+ "expression": "user_id",
4343
+ "isExpression": false,
4344
+ "asc": true,
4345
+ "nulls": "last"
4346
+ }
4347
+ ],
4348
+ "isUnique": false,
4349
+ "concurrently": false,
4350
+ "method": "btree",
4351
+ "with": {}
4352
+ },
4353
+ "ai_usage_log_created_idx": {
4354
+ "name": "ai_usage_log_created_idx",
4355
+ "columns": [
4356
+ {
4357
+ "expression": "created_at",
4358
+ "isExpression": false,
4359
+ "asc": true,
4360
+ "nulls": "last"
4361
+ }
4362
+ ],
4363
+ "isUnique": false,
4364
+ "concurrently": false,
4365
+ "method": "btree",
4366
+ "with": {}
4367
+ }
4368
+ },
4369
+ "foreignKeys": {
4370
+ "ai_usage_log_organization_id_organization_id_fk": {
4371
+ "name": "ai_usage_log_organization_id_organization_id_fk",
4372
+ "tableFrom": "ai_usage_log",
4373
+ "tableTo": "organization",
4374
+ "columnsFrom": ["organization_id"],
4375
+ "columnsTo": ["id"],
4376
+ "onDelete": "cascade",
4377
+ "onUpdate": "no action"
4378
+ },
4379
+ "ai_usage_log_user_id_user_id_fk": {
4380
+ "name": "ai_usage_log_user_id_user_id_fk",
4381
+ "tableFrom": "ai_usage_log",
4382
+ "tableTo": "user",
4383
+ "columnsFrom": ["user_id"],
4384
+ "columnsTo": ["id"],
4385
+ "onDelete": "set null",
4386
+ "onUpdate": "no action"
4387
+ }
4388
+ },
4389
+ "compositePrimaryKeys": {},
4390
+ "uniqueConstraints": {},
4391
+ "policies": {},
4392
+ "checkConstraints": {},
4393
+ "isRLSEnabled": false
4394
+ },
4395
+ "public.ai_usage_monthly": {
4396
+ "name": "ai_usage_monthly",
4397
+ "schema": "",
4398
+ "columns": {
4399
+ "id": {
4400
+ "name": "id",
4401
+ "type": "text",
4402
+ "primaryKey": true,
4403
+ "notNull": true
4404
+ },
4405
+ "organization_id": {
4406
+ "name": "organization_id",
4407
+ "type": "text",
4408
+ "primaryKey": false,
4409
+ "notNull": true
4410
+ },
4411
+ "period_key": {
4412
+ "name": "period_key",
4413
+ "type": "text",
4414
+ "primaryKey": false,
4415
+ "notNull": true
4416
+ },
4417
+ "message_count": {
4418
+ "name": "message_count",
4419
+ "type": "integer",
4420
+ "primaryKey": false,
4421
+ "notNull": true,
4422
+ "default": 0
4423
+ },
4424
+ "updated_at": {
4425
+ "name": "updated_at",
4426
+ "type": "timestamp",
4427
+ "primaryKey": false,
4428
+ "notNull": true,
4429
+ "default": "now()"
4430
+ }
4431
+ },
4432
+ "indexes": {
4433
+ "ai_usage_monthly_org_period_idx": {
4434
+ "name": "ai_usage_monthly_org_period_idx",
4435
+ "columns": [
4436
+ {
4437
+ "expression": "organization_id",
4438
+ "isExpression": false,
4439
+ "asc": true,
4440
+ "nulls": "last"
4441
+ },
4442
+ {
4443
+ "expression": "period_key",
4444
+ "isExpression": false,
4445
+ "asc": true,
4446
+ "nulls": "last"
4447
+ }
4448
+ ],
4449
+ "isUnique": true,
4450
+ "concurrently": false,
4451
+ "method": "btree",
4452
+ "with": {}
4453
+ },
4454
+ "ai_usage_monthly_period_idx": {
4455
+ "name": "ai_usage_monthly_period_idx",
4456
+ "columns": [
4457
+ {
4458
+ "expression": "period_key",
4459
+ "isExpression": false,
4460
+ "asc": true,
4461
+ "nulls": "last"
4462
+ }
4463
+ ],
4464
+ "isUnique": false,
4465
+ "concurrently": false,
4466
+ "method": "btree",
4467
+ "with": {}
4468
+ }
4469
+ },
4470
+ "foreignKeys": {
4471
+ "ai_usage_monthly_organization_id_organization_id_fk": {
4472
+ "name": "ai_usage_monthly_organization_id_organization_id_fk",
4473
+ "tableFrom": "ai_usage_monthly",
4474
+ "tableTo": "organization",
4475
+ "columnsFrom": ["organization_id"],
4476
+ "columnsTo": ["id"],
4477
+ "onDelete": "cascade",
4478
+ "onUpdate": "no action"
4479
+ }
4480
+ },
4481
+ "compositePrimaryKeys": {},
4482
+ "uniqueConstraints": {},
4483
+ "policies": {},
4484
+ "checkConstraints": {},
4485
+ "isRLSEnabled": false
4486
+ },
4487
+ "public.api_rate_limit_window": {
4488
+ "name": "api_rate_limit_window",
4489
+ "schema": "",
4490
+ "columns": {
4491
+ "id": {
4492
+ "name": "id",
4493
+ "type": "text",
4494
+ "primaryKey": true,
4495
+ "notNull": true
4496
+ },
4497
+ "organization_id": {
4498
+ "name": "organization_id",
4499
+ "type": "text",
4500
+ "primaryKey": false,
4501
+ "notNull": true
4502
+ },
4503
+ "minute_key": {
4504
+ "name": "minute_key",
4505
+ "type": "text",
4506
+ "primaryKey": false,
4507
+ "notNull": true
4508
+ },
4509
+ "request_count": {
4510
+ "name": "request_count",
4511
+ "type": "integer",
4512
+ "primaryKey": false,
4513
+ "notNull": true,
4514
+ "default": 0
4515
+ },
4516
+ "expires_at": {
4517
+ "name": "expires_at",
4518
+ "type": "timestamp",
4519
+ "primaryKey": false,
4520
+ "notNull": true
4521
+ }
4522
+ },
4523
+ "indexes": {
4524
+ "api_rate_limit_org_minute_idx": {
4525
+ "name": "api_rate_limit_org_minute_idx",
4526
+ "columns": [
4527
+ {
4528
+ "expression": "organization_id",
4529
+ "isExpression": false,
4530
+ "asc": true,
4531
+ "nulls": "last"
4532
+ },
4533
+ {
4534
+ "expression": "minute_key",
4535
+ "isExpression": false,
4536
+ "asc": true,
4537
+ "nulls": "last"
4538
+ }
4539
+ ],
4540
+ "isUnique": true,
4541
+ "concurrently": false,
4542
+ "method": "btree",
4543
+ "with": {}
4544
+ },
4545
+ "api_rate_limit_expires_idx": {
4546
+ "name": "api_rate_limit_expires_idx",
4547
+ "columns": [
4548
+ {
4549
+ "expression": "expires_at",
4550
+ "isExpression": false,
4551
+ "asc": true,
4552
+ "nulls": "last"
4553
+ }
4554
+ ],
4555
+ "isUnique": false,
4556
+ "concurrently": false,
4557
+ "method": "btree",
4558
+ "with": {}
4559
+ }
4560
+ },
4561
+ "foreignKeys": {
4562
+ "api_rate_limit_window_organization_id_organization_id_fk": {
4563
+ "name": "api_rate_limit_window_organization_id_organization_id_fk",
4564
+ "tableFrom": "api_rate_limit_window",
4565
+ "tableTo": "organization",
4566
+ "columnsFrom": ["organization_id"],
4567
+ "columnsTo": ["id"],
4568
+ "onDelete": "cascade",
4569
+ "onUpdate": "no action"
4570
+ }
4571
+ },
4572
+ "compositePrimaryKeys": {},
4573
+ "uniqueConstraints": {},
4574
+ "policies": {},
4575
+ "checkConstraints": {},
4576
+ "isRLSEnabled": false
4577
+ },
4578
+ "public.api_usage_daily": {
4579
+ "name": "api_usage_daily",
4580
+ "schema": "",
4581
+ "columns": {
4582
+ "id": {
4583
+ "name": "id",
4584
+ "type": "text",
4585
+ "primaryKey": true,
4586
+ "notNull": true
4587
+ },
4588
+ "organization_id": {
4589
+ "name": "organization_id",
4590
+ "type": "text",
4591
+ "primaryKey": false,
4592
+ "notNull": true
4593
+ },
4594
+ "date_key": {
4595
+ "name": "date_key",
4596
+ "type": "text",
4597
+ "primaryKey": false,
4598
+ "notNull": true
4599
+ },
4600
+ "request_count": {
4601
+ "name": "request_count",
4602
+ "type": "integer",
4603
+ "primaryKey": false,
4604
+ "notNull": true,
4605
+ "default": 0
4606
+ },
4607
+ "updated_at": {
4608
+ "name": "updated_at",
4609
+ "type": "timestamp",
4610
+ "primaryKey": false,
4611
+ "notNull": true,
4612
+ "default": "now()"
4613
+ }
4614
+ },
4615
+ "indexes": {
4616
+ "api_usage_daily_org_date_idx": {
4617
+ "name": "api_usage_daily_org_date_idx",
4618
+ "columns": [
4619
+ {
4620
+ "expression": "organization_id",
4621
+ "isExpression": false,
4622
+ "asc": true,
4623
+ "nulls": "last"
4624
+ },
4625
+ {
4626
+ "expression": "date_key",
4627
+ "isExpression": false,
4628
+ "asc": true,
4629
+ "nulls": "last"
4630
+ }
4631
+ ],
4632
+ "isUnique": true,
4633
+ "concurrently": false,
4634
+ "method": "btree",
4635
+ "with": {}
4636
+ },
4637
+ "api_usage_daily_date_idx": {
4638
+ "name": "api_usage_daily_date_idx",
4639
+ "columns": [
4640
+ {
4641
+ "expression": "date_key",
4642
+ "isExpression": false,
4643
+ "asc": true,
4644
+ "nulls": "last"
4645
+ }
4646
+ ],
4647
+ "isUnique": false,
4648
+ "concurrently": false,
4649
+ "method": "btree",
4650
+ "with": {}
4651
+ }
4652
+ },
4653
+ "foreignKeys": {
4654
+ "api_usage_daily_organization_id_organization_id_fk": {
4655
+ "name": "api_usage_daily_organization_id_organization_id_fk",
4656
+ "tableFrom": "api_usage_daily",
4657
+ "tableTo": "organization",
4658
+ "columnsFrom": ["organization_id"],
4659
+ "columnsTo": ["id"],
4660
+ "onDelete": "cascade",
4661
+ "onUpdate": "no action"
4662
+ }
4663
+ },
4664
+ "compositePrimaryKeys": {},
4665
+ "uniqueConstraints": {},
4666
+ "policies": {},
4667
+ "checkConstraints": {},
4668
+ "isRLSEnabled": false
4669
+ },
4670
+ "public.waitlist": {
4671
+ "name": "waitlist",
4672
+ "schema": "",
4673
+ "columns": {
4674
+ "id": {
4675
+ "name": "id",
4676
+ "type": "text",
4677
+ "primaryKey": true,
4678
+ "notNull": true
4679
+ },
4680
+ "email": {
4681
+ "name": "email",
4682
+ "type": "text",
4683
+ "primaryKey": false,
4684
+ "notNull": true
4685
+ },
4686
+ "email_hash": {
4687
+ "name": "email_hash",
4688
+ "type": "text",
4689
+ "primaryKey": false,
4690
+ "notNull": true
4691
+ },
4692
+ "product": {
4693
+ "name": "product",
4694
+ "type": "text",
4695
+ "primaryKey": false,
4696
+ "notNull": true
4697
+ },
4698
+ "source": {
4699
+ "name": "source",
4700
+ "type": "text",
4701
+ "primaryKey": false,
4702
+ "notNull": false
4703
+ },
4704
+ "referrer": {
4705
+ "name": "referrer",
4706
+ "type": "text",
4707
+ "primaryKey": false,
4708
+ "notNull": false
4709
+ },
4710
+ "created_at": {
4711
+ "name": "created_at",
4712
+ "type": "timestamp",
4713
+ "primaryKey": false,
4714
+ "notNull": true,
4715
+ "default": "now()"
4716
+ }
4717
+ },
4718
+ "indexes": {
4719
+ "waitlist_email_product_idx": {
4720
+ "name": "waitlist_email_product_idx",
4721
+ "columns": [
4722
+ {
4723
+ "expression": "email_hash",
4724
+ "isExpression": false,
4725
+ "asc": true,
4726
+ "nulls": "last"
4727
+ },
4728
+ {
4729
+ "expression": "product",
4730
+ "isExpression": false,
4731
+ "asc": true,
4732
+ "nulls": "last"
4733
+ }
4734
+ ],
4735
+ "isUnique": true,
4736
+ "concurrently": false,
4737
+ "method": "btree",
4738
+ "with": {}
4739
+ },
4740
+ "waitlist_product_idx": {
4741
+ "name": "waitlist_product_idx",
4742
+ "columns": [
4743
+ {
4744
+ "expression": "product",
4745
+ "isExpression": false,
4746
+ "asc": true,
4747
+ "nulls": "last"
4748
+ }
4749
+ ],
4750
+ "isUnique": false,
4751
+ "concurrently": false,
4752
+ "method": "btree",
4753
+ "with": {}
4754
+ },
4755
+ "waitlist_created_at_idx": {
4756
+ "name": "waitlist_created_at_idx",
4757
+ "columns": [
4758
+ {
4759
+ "expression": "created_at",
4760
+ "isExpression": false,
4761
+ "asc": true,
4762
+ "nulls": "last"
4763
+ }
4764
+ ],
4765
+ "isUnique": false,
4766
+ "concurrently": false,
4767
+ "method": "btree",
4768
+ "with": {}
4769
+ }
4770
+ },
4771
+ "foreignKeys": {},
4772
+ "compositePrimaryKeys": {},
4773
+ "uniqueConstraints": {},
4774
+ "policies": {},
4775
+ "checkConstraints": {},
4776
+ "isRLSEnabled": false
4777
+ }
4778
+ },
4779
+ "enums": {
4780
+ "public.batch_send_status": {
4781
+ "name": "batch_send_status",
4782
+ "schema": "public",
4783
+ "values": [
4784
+ "draft",
4785
+ "scheduled",
4786
+ "queued",
4787
+ "processing",
4788
+ "completed",
4789
+ "failed",
4790
+ "cancelled"
4791
+ ]
4792
+ },
4793
+ "public.message_send_status": {
4794
+ "name": "message_send_status",
4795
+ "schema": "public",
4796
+ "values": [
4797
+ "pending",
4798
+ "queued",
4799
+ "sent",
4800
+ "delivered",
4801
+ "opened",
4802
+ "clicked",
4803
+ "bounced",
4804
+ "complained",
4805
+ "failed",
4806
+ "opted_out"
4807
+ ]
4808
+ },
4809
+ "public.message_source_type": {
4810
+ "name": "message_source_type",
4811
+ "schema": "public",
4812
+ "values": ["transactional", "batch", "campaign", "workflow"]
4813
+ },
4814
+ "public.email_type": {
4815
+ "name": "email_type",
4816
+ "schema": "public",
4817
+ "values": ["marketing", "transactional"]
4818
+ },
4819
+ "public.template_status": {
4820
+ "name": "template_status",
4821
+ "schema": "public",
4822
+ "values": ["DRAFT", "PUBLISHED", "ARCHIVED"]
4823
+ },
4824
+ "public.variable_type": {
4825
+ "name": "variable_type",
4826
+ "schema": "public",
4827
+ "values": ["TEXT", "NUMBER", "BOOLEAN", "DATE", "URL", "EMAIL"]
4828
+ }
4829
+ },
4830
+ "schemas": {},
4831
+ "sequences": {},
4832
+ "roles": {},
4833
+ "policies": {},
4834
+ "views": {},
4835
+ "_meta": {
4836
+ "columns": {},
4837
+ "schemas": {},
4838
+ "tables": {}
4839
+ }
4840
+ }