@wraps.dev/cli 2.21.10 → 2.21.12

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 (65) hide show
  1. package/dist/api-lambda.zip +0 -0
  2. package/dist/cli.js +3 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/lambda/event-processor/.bundled +1 -1
  5. package/dist/lambda/inbound-processor/.bundled +1 -1
  6. package/dist/lambda/sms-event-processor/.bundled +1 -1
  7. package/dist/selfhost-migrations/meta/0000_snapshot.json +1311 -0
  8. package/dist/selfhost-migrations/meta/0001_snapshot.json +1454 -0
  9. package/dist/selfhost-migrations/meta/0002_snapshot.json +1460 -0
  10. package/dist/selfhost-migrations/meta/0003_snapshot.json +1467 -0
  11. package/dist/selfhost-migrations/meta/0004_snapshot.json +1473 -0
  12. package/dist/selfhost-migrations/meta/0005_snapshot.json +1499 -0
  13. package/dist/selfhost-migrations/meta/0006_snapshot.json +1617 -0
  14. package/dist/selfhost-migrations/meta/0007_snapshot.json +2581 -0
  15. package/dist/selfhost-migrations/meta/0008_snapshot.json +2861 -0
  16. package/dist/selfhost-migrations/meta/0009_snapshot.json +3447 -0
  17. package/dist/selfhost-migrations/meta/0010_snapshot.json +3586 -0
  18. package/dist/selfhost-migrations/meta/0011_snapshot.json +3600 -0
  19. package/dist/selfhost-migrations/meta/0012_snapshot.json +3607 -0
  20. package/dist/selfhost-migrations/meta/0013_snapshot.json +4697 -0
  21. package/dist/selfhost-migrations/meta/0014_snapshot.json +4704 -0
  22. package/dist/selfhost-migrations/meta/0015_snapshot.json +4697 -0
  23. package/dist/selfhost-migrations/meta/0016_snapshot.json +4703 -0
  24. package/dist/selfhost-migrations/meta/0017_snapshot.json +4769 -0
  25. package/dist/selfhost-migrations/meta/0018_snapshot.json +4821 -0
  26. package/dist/selfhost-migrations/meta/0019_snapshot.json +4840 -0
  27. package/dist/selfhost-migrations/meta/0020_snapshot.json +5602 -0
  28. package/dist/selfhost-migrations/meta/0021_snapshot.json +5729 -0
  29. package/dist/selfhost-migrations/meta/0022_snapshot.json +5792 -0
  30. package/dist/selfhost-migrations/meta/0023_snapshot.json +5799 -0
  31. package/dist/selfhost-migrations/meta/0024_snapshot.json +5821 -0
  32. package/dist/selfhost-migrations/meta/0025_snapshot.json +5831 -0
  33. package/dist/selfhost-migrations/meta/0026_snapshot.json +5844 -0
  34. package/dist/selfhost-migrations/meta/0027_snapshot.json +5864 -0
  35. package/dist/selfhost-migrations/meta/0028_snapshot.json +5871 -0
  36. package/dist/selfhost-migrations/meta/0029_snapshot.json +5984 -0
  37. package/dist/selfhost-migrations/meta/0030_snapshot.json +5990 -0
  38. package/dist/selfhost-migrations/meta/0031_snapshot.json +5950 -0
  39. package/dist/selfhost-migrations/meta/0032_snapshot.json +6042 -0
  40. package/dist/selfhost-migrations/meta/0033_snapshot.json +6057 -0
  41. package/dist/selfhost-migrations/meta/0034_snapshot.json +6130 -0
  42. package/dist/selfhost-migrations/meta/0035_snapshot.json +6195 -0
  43. package/dist/selfhost-migrations/meta/0036_snapshot.json +6201 -0
  44. package/dist/selfhost-migrations/meta/0037_snapshot.json +6265 -0
  45. package/dist/selfhost-migrations/meta/0038_snapshot.json +6271 -0
  46. package/dist/selfhost-migrations/meta/0039_snapshot.json +6278 -0
  47. package/dist/selfhost-migrations/meta/0041_snapshot.json +6284 -0
  48. package/dist/selfhost-migrations/meta/0042_snapshot.json +6297 -0
  49. package/dist/selfhost-migrations/meta/0043_snapshot.json +6297 -0
  50. package/dist/selfhost-migrations/meta/0044_snapshot.json +6297 -0
  51. package/dist/selfhost-migrations/meta/0045_snapshot.json +6303 -0
  52. package/dist/selfhost-migrations/meta/0046_snapshot.json +6315 -0
  53. package/dist/selfhost-migrations/meta/0047_snapshot.json +6330 -0
  54. package/dist/selfhost-migrations/meta/0048_snapshot.json +6336 -0
  55. package/dist/selfhost-migrations/meta/0049_snapshot.json +6366 -0
  56. package/dist/selfhost-migrations/meta/0050_snapshot.json +6390 -0
  57. package/dist/selfhost-migrations/meta/0051_snapshot.json +6403 -0
  58. package/dist/selfhost-migrations/meta/0052_snapshot.json +6470 -0
  59. package/dist/selfhost-migrations/meta/0053_snapshot.json +6470 -0
  60. package/dist/selfhost-migrations/meta/0054_snapshot.json +6646 -0
  61. package/dist/selfhost-migrations/meta/0055_snapshot.json +6677 -0
  62. package/dist/selfhost-migrations/meta/0056_snapshot.json +6677 -0
  63. package/dist/selfhost-migrations/meta/0057_snapshot.json +6674 -0
  64. package/dist/selfhost-migrations/meta/_journal.json +412 -0
  65. package/package.json +1 -1
@@ -0,0 +1,4697 @@
1
+ {
2
+ "id": "3a124ad9-f224-4939-bbaf-33920cb5e698",
3
+ "prevId": "6b65eaee-ca95-4516-a436-1992ec684875",
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
+ "status": {
1715
+ "name": "status",
1716
+ "type": "batch_send_status",
1717
+ "typeSchema": "public",
1718
+ "primaryKey": false,
1719
+ "notNull": true,
1720
+ "default": "'draft'"
1721
+ },
1722
+ "total_recipients": {
1723
+ "name": "total_recipients",
1724
+ "type": "integer",
1725
+ "primaryKey": false,
1726
+ "notNull": true,
1727
+ "default": 0
1728
+ },
1729
+ "processed_recipients": {
1730
+ "name": "processed_recipients",
1731
+ "type": "integer",
1732
+ "primaryKey": false,
1733
+ "notNull": true,
1734
+ "default": 0
1735
+ },
1736
+ "sent": {
1737
+ "name": "sent",
1738
+ "type": "integer",
1739
+ "primaryKey": false,
1740
+ "notNull": true,
1741
+ "default": 0
1742
+ },
1743
+ "delivered": {
1744
+ "name": "delivered",
1745
+ "type": "integer",
1746
+ "primaryKey": false,
1747
+ "notNull": true,
1748
+ "default": 0
1749
+ },
1750
+ "failed": {
1751
+ "name": "failed",
1752
+ "type": "integer",
1753
+ "primaryKey": false,
1754
+ "notNull": true,
1755
+ "default": 0
1756
+ },
1757
+ "opened": {
1758
+ "name": "opened",
1759
+ "type": "integer",
1760
+ "primaryKey": false,
1761
+ "notNull": true,
1762
+ "default": 0
1763
+ },
1764
+ "clicked": {
1765
+ "name": "clicked",
1766
+ "type": "integer",
1767
+ "primaryKey": false,
1768
+ "notNull": true,
1769
+ "default": 0
1770
+ },
1771
+ "bounced": {
1772
+ "name": "bounced",
1773
+ "type": "integer",
1774
+ "primaryKey": false,
1775
+ "notNull": true,
1776
+ "default": 0
1777
+ },
1778
+ "complained": {
1779
+ "name": "complained",
1780
+ "type": "integer",
1781
+ "primaryKey": false,
1782
+ "notNull": true,
1783
+ "default": 0
1784
+ },
1785
+ "sms_segments": {
1786
+ "name": "sms_segments",
1787
+ "type": "integer",
1788
+ "primaryKey": false,
1789
+ "notNull": true,
1790
+ "default": 0
1791
+ },
1792
+ "sms_opted_out": {
1793
+ "name": "sms_opted_out",
1794
+ "type": "integer",
1795
+ "primaryKey": false,
1796
+ "notNull": true,
1797
+ "default": 0
1798
+ },
1799
+ "error_message": {
1800
+ "name": "error_message",
1801
+ "type": "text",
1802
+ "primaryKey": false,
1803
+ "notNull": false
1804
+ },
1805
+ "error_details": {
1806
+ "name": "error_details",
1807
+ "type": "json",
1808
+ "primaryKey": false,
1809
+ "notNull": false
1810
+ },
1811
+ "scheduled_for": {
1812
+ "name": "scheduled_for",
1813
+ "type": "timestamp",
1814
+ "primaryKey": false,
1815
+ "notNull": false
1816
+ },
1817
+ "started_at": {
1818
+ "name": "started_at",
1819
+ "type": "timestamp",
1820
+ "primaryKey": false,
1821
+ "notNull": false
1822
+ },
1823
+ "completed_at": {
1824
+ "name": "completed_at",
1825
+ "type": "timestamp",
1826
+ "primaryKey": false,
1827
+ "notNull": false
1828
+ },
1829
+ "created_by": {
1830
+ "name": "created_by",
1831
+ "type": "text",
1832
+ "primaryKey": false,
1833
+ "notNull": false
1834
+ },
1835
+ "created_at": {
1836
+ "name": "created_at",
1837
+ "type": "timestamp",
1838
+ "primaryKey": false,
1839
+ "notNull": true,
1840
+ "default": "now()"
1841
+ },
1842
+ "updated_at": {
1843
+ "name": "updated_at",
1844
+ "type": "timestamp",
1845
+ "primaryKey": false,
1846
+ "notNull": true,
1847
+ "default": "now()"
1848
+ }
1849
+ },
1850
+ "indexes": {
1851
+ "batch_send_org_idx": {
1852
+ "name": "batch_send_org_idx",
1853
+ "columns": [
1854
+ {
1855
+ "expression": "organization_id",
1856
+ "isExpression": false,
1857
+ "asc": true,
1858
+ "nulls": "last"
1859
+ }
1860
+ ],
1861
+ "isUnique": false,
1862
+ "concurrently": false,
1863
+ "method": "btree",
1864
+ "with": {}
1865
+ },
1866
+ "batch_send_channel_idx": {
1867
+ "name": "batch_send_channel_idx",
1868
+ "columns": [
1869
+ {
1870
+ "expression": "channel",
1871
+ "isExpression": false,
1872
+ "asc": true,
1873
+ "nulls": "last"
1874
+ }
1875
+ ],
1876
+ "isUnique": false,
1877
+ "concurrently": false,
1878
+ "method": "btree",
1879
+ "with": {}
1880
+ },
1881
+ "batch_send_status_idx": {
1882
+ "name": "batch_send_status_idx",
1883
+ "columns": [
1884
+ {
1885
+ "expression": "organization_id",
1886
+ "isExpression": false,
1887
+ "asc": true,
1888
+ "nulls": "last"
1889
+ },
1890
+ {
1891
+ "expression": "status",
1892
+ "isExpression": false,
1893
+ "asc": true,
1894
+ "nulls": "last"
1895
+ }
1896
+ ],
1897
+ "isUnique": false,
1898
+ "concurrently": false,
1899
+ "method": "btree",
1900
+ "with": {}
1901
+ },
1902
+ "batch_send_created_at_idx": {
1903
+ "name": "batch_send_created_at_idx",
1904
+ "columns": [
1905
+ {
1906
+ "expression": "organization_id",
1907
+ "isExpression": false,
1908
+ "asc": true,
1909
+ "nulls": "last"
1910
+ },
1911
+ {
1912
+ "expression": "created_at",
1913
+ "isExpression": false,
1914
+ "asc": true,
1915
+ "nulls": "last"
1916
+ }
1917
+ ],
1918
+ "isUnique": false,
1919
+ "concurrently": false,
1920
+ "method": "btree",
1921
+ "with": {}
1922
+ }
1923
+ },
1924
+ "foreignKeys": {
1925
+ "batch_send_organization_id_organization_id_fk": {
1926
+ "name": "batch_send_organization_id_organization_id_fk",
1927
+ "tableFrom": "batch_send",
1928
+ "tableTo": "organization",
1929
+ "columnsFrom": ["organization_id"],
1930
+ "columnsTo": ["id"],
1931
+ "onDelete": "cascade",
1932
+ "onUpdate": "no action"
1933
+ },
1934
+ "batch_send_aws_account_id_aws_account_id_fk": {
1935
+ "name": "batch_send_aws_account_id_aws_account_id_fk",
1936
+ "tableFrom": "batch_send",
1937
+ "tableTo": "aws_account",
1938
+ "columnsFrom": ["aws_account_id"],
1939
+ "columnsTo": ["id"],
1940
+ "onDelete": "set null",
1941
+ "onUpdate": "no action"
1942
+ },
1943
+ "batch_send_email_template_id_template_id_fk": {
1944
+ "name": "batch_send_email_template_id_template_id_fk",
1945
+ "tableFrom": "batch_send",
1946
+ "tableTo": "template",
1947
+ "columnsFrom": ["email_template_id"],
1948
+ "columnsTo": ["id"],
1949
+ "onDelete": "set null",
1950
+ "onUpdate": "no action"
1951
+ },
1952
+ "batch_send_created_by_user_id_fk": {
1953
+ "name": "batch_send_created_by_user_id_fk",
1954
+ "tableFrom": "batch_send",
1955
+ "tableTo": "user",
1956
+ "columnsFrom": ["created_by"],
1957
+ "columnsTo": ["id"],
1958
+ "onDelete": "set null",
1959
+ "onUpdate": "no action"
1960
+ }
1961
+ },
1962
+ "compositePrimaryKeys": {},
1963
+ "uniqueConstraints": {},
1964
+ "policies": {},
1965
+ "checkConstraints": {},
1966
+ "isRLSEnabled": false
1967
+ },
1968
+ "public.message_send": {
1969
+ "name": "message_send",
1970
+ "schema": "",
1971
+ "columns": {
1972
+ "id": {
1973
+ "name": "id",
1974
+ "type": "text",
1975
+ "primaryKey": true,
1976
+ "notNull": true
1977
+ },
1978
+ "organization_id": {
1979
+ "name": "organization_id",
1980
+ "type": "text",
1981
+ "primaryKey": false,
1982
+ "notNull": true
1983
+ },
1984
+ "contact_id": {
1985
+ "name": "contact_id",
1986
+ "type": "text",
1987
+ "primaryKey": false,
1988
+ "notNull": false
1989
+ },
1990
+ "aws_account_id": {
1991
+ "name": "aws_account_id",
1992
+ "type": "text",
1993
+ "primaryKey": false,
1994
+ "notNull": true
1995
+ },
1996
+ "channel": {
1997
+ "name": "channel",
1998
+ "type": "text",
1999
+ "primaryKey": false,
2000
+ "notNull": true,
2001
+ "default": "'email'"
2002
+ },
2003
+ "source_type": {
2004
+ "name": "source_type",
2005
+ "type": "message_source_type",
2006
+ "typeSchema": "public",
2007
+ "primaryKey": false,
2008
+ "notNull": true
2009
+ },
2010
+ "batch_send_id": {
2011
+ "name": "batch_send_id",
2012
+ "type": "text",
2013
+ "primaryKey": false,
2014
+ "notNull": false
2015
+ },
2016
+ "recipient": {
2017
+ "name": "recipient",
2018
+ "type": "text",
2019
+ "primaryKey": false,
2020
+ "notNull": true
2021
+ },
2022
+ "subject": {
2023
+ "name": "subject",
2024
+ "type": "text",
2025
+ "primaryKey": false,
2026
+ "notNull": false
2027
+ },
2028
+ "from": {
2029
+ "name": "from",
2030
+ "type": "text",
2031
+ "primaryKey": false,
2032
+ "notNull": false
2033
+ },
2034
+ "from_name": {
2035
+ "name": "from_name",
2036
+ "type": "text",
2037
+ "primaryKey": false,
2038
+ "notNull": false
2039
+ },
2040
+ "email_template_id": {
2041
+ "name": "email_template_id",
2042
+ "type": "text",
2043
+ "primaryKey": false,
2044
+ "notNull": false
2045
+ },
2046
+ "body": {
2047
+ "name": "body",
2048
+ "type": "text",
2049
+ "primaryKey": false,
2050
+ "notNull": false
2051
+ },
2052
+ "sender_id": {
2053
+ "name": "sender_id",
2054
+ "type": "text",
2055
+ "primaryKey": false,
2056
+ "notNull": false
2057
+ },
2058
+ "sms_segment_count": {
2059
+ "name": "sms_segment_count",
2060
+ "type": "integer",
2061
+ "primaryKey": false,
2062
+ "notNull": false
2063
+ },
2064
+ "variables": {
2065
+ "name": "variables",
2066
+ "type": "json",
2067
+ "primaryKey": false,
2068
+ "notNull": false,
2069
+ "default": "'{}'::json"
2070
+ },
2071
+ "message_id": {
2072
+ "name": "message_id",
2073
+ "type": "text",
2074
+ "primaryKey": false,
2075
+ "notNull": false
2076
+ },
2077
+ "status": {
2078
+ "name": "status",
2079
+ "type": "message_send_status",
2080
+ "typeSchema": "public",
2081
+ "primaryKey": false,
2082
+ "notNull": true,
2083
+ "default": "'pending'"
2084
+ },
2085
+ "sent_at": {
2086
+ "name": "sent_at",
2087
+ "type": "timestamp",
2088
+ "primaryKey": false,
2089
+ "notNull": false
2090
+ },
2091
+ "delivered_at": {
2092
+ "name": "delivered_at",
2093
+ "type": "timestamp",
2094
+ "primaryKey": false,
2095
+ "notNull": false
2096
+ },
2097
+ "opened_at": {
2098
+ "name": "opened_at",
2099
+ "type": "timestamp",
2100
+ "primaryKey": false,
2101
+ "notNull": false
2102
+ },
2103
+ "clicked_at": {
2104
+ "name": "clicked_at",
2105
+ "type": "timestamp",
2106
+ "primaryKey": false,
2107
+ "notNull": false
2108
+ },
2109
+ "bounced_at": {
2110
+ "name": "bounced_at",
2111
+ "type": "timestamp",
2112
+ "primaryKey": false,
2113
+ "notNull": false
2114
+ },
2115
+ "complained_at": {
2116
+ "name": "complained_at",
2117
+ "type": "timestamp",
2118
+ "primaryKey": false,
2119
+ "notNull": false
2120
+ },
2121
+ "opted_out_at": {
2122
+ "name": "opted_out_at",
2123
+ "type": "timestamp",
2124
+ "primaryKey": false,
2125
+ "notNull": false
2126
+ },
2127
+ "error": {
2128
+ "name": "error",
2129
+ "type": "text",
2130
+ "primaryKey": false,
2131
+ "notNull": false
2132
+ },
2133
+ "bounce_type": {
2134
+ "name": "bounce_type",
2135
+ "type": "text",
2136
+ "primaryKey": false,
2137
+ "notNull": false
2138
+ },
2139
+ "bounce_sub_type": {
2140
+ "name": "bounce_sub_type",
2141
+ "type": "text",
2142
+ "primaryKey": false,
2143
+ "notNull": false
2144
+ },
2145
+ "created_at": {
2146
+ "name": "created_at",
2147
+ "type": "timestamp",
2148
+ "primaryKey": false,
2149
+ "notNull": true,
2150
+ "default": "now()"
2151
+ }
2152
+ },
2153
+ "indexes": {
2154
+ "message_send_org_idx": {
2155
+ "name": "message_send_org_idx",
2156
+ "columns": [
2157
+ {
2158
+ "expression": "organization_id",
2159
+ "isExpression": false,
2160
+ "asc": true,
2161
+ "nulls": "last"
2162
+ }
2163
+ ],
2164
+ "isUnique": false,
2165
+ "concurrently": false,
2166
+ "method": "btree",
2167
+ "with": {}
2168
+ },
2169
+ "message_send_contact_idx": {
2170
+ "name": "message_send_contact_idx",
2171
+ "columns": [
2172
+ {
2173
+ "expression": "contact_id",
2174
+ "isExpression": false,
2175
+ "asc": true,
2176
+ "nulls": "last"
2177
+ }
2178
+ ],
2179
+ "isUnique": false,
2180
+ "concurrently": false,
2181
+ "method": "btree",
2182
+ "with": {}
2183
+ },
2184
+ "message_send_channel_idx": {
2185
+ "name": "message_send_channel_idx",
2186
+ "columns": [
2187
+ {
2188
+ "expression": "channel",
2189
+ "isExpression": false,
2190
+ "asc": true,
2191
+ "nulls": "last"
2192
+ }
2193
+ ],
2194
+ "isUnique": false,
2195
+ "concurrently": false,
2196
+ "method": "btree",
2197
+ "with": {}
2198
+ },
2199
+ "message_send_batch_idx": {
2200
+ "name": "message_send_batch_idx",
2201
+ "columns": [
2202
+ {
2203
+ "expression": "batch_send_id",
2204
+ "isExpression": false,
2205
+ "asc": true,
2206
+ "nulls": "last"
2207
+ }
2208
+ ],
2209
+ "isUnique": false,
2210
+ "concurrently": false,
2211
+ "method": "btree",
2212
+ "with": {}
2213
+ },
2214
+ "message_send_status_idx": {
2215
+ "name": "message_send_status_idx",
2216
+ "columns": [
2217
+ {
2218
+ "expression": "batch_send_id",
2219
+ "isExpression": false,
2220
+ "asc": true,
2221
+ "nulls": "last"
2222
+ },
2223
+ {
2224
+ "expression": "status",
2225
+ "isExpression": false,
2226
+ "asc": true,
2227
+ "nulls": "last"
2228
+ }
2229
+ ],
2230
+ "isUnique": false,
2231
+ "concurrently": false,
2232
+ "method": "btree",
2233
+ "with": {}
2234
+ },
2235
+ "message_send_message_id_idx": {
2236
+ "name": "message_send_message_id_idx",
2237
+ "columns": [
2238
+ {
2239
+ "expression": "message_id",
2240
+ "isExpression": false,
2241
+ "asc": true,
2242
+ "nulls": "last"
2243
+ }
2244
+ ],
2245
+ "isUnique": true,
2246
+ "concurrently": false,
2247
+ "method": "btree",
2248
+ "with": {}
2249
+ },
2250
+ "message_send_source_type_idx": {
2251
+ "name": "message_send_source_type_idx",
2252
+ "columns": [
2253
+ {
2254
+ "expression": "source_type",
2255
+ "isExpression": false,
2256
+ "asc": true,
2257
+ "nulls": "last"
2258
+ }
2259
+ ],
2260
+ "isUnique": false,
2261
+ "concurrently": false,
2262
+ "method": "btree",
2263
+ "with": {}
2264
+ },
2265
+ "message_send_created_at_idx": {
2266
+ "name": "message_send_created_at_idx",
2267
+ "columns": [
2268
+ {
2269
+ "expression": "created_at",
2270
+ "isExpression": false,
2271
+ "asc": true,
2272
+ "nulls": "last"
2273
+ }
2274
+ ],
2275
+ "isUnique": false,
2276
+ "concurrently": false,
2277
+ "method": "btree",
2278
+ "with": {}
2279
+ }
2280
+ },
2281
+ "foreignKeys": {
2282
+ "message_send_organization_id_organization_id_fk": {
2283
+ "name": "message_send_organization_id_organization_id_fk",
2284
+ "tableFrom": "message_send",
2285
+ "tableTo": "organization",
2286
+ "columnsFrom": ["organization_id"],
2287
+ "columnsTo": ["id"],
2288
+ "onDelete": "cascade",
2289
+ "onUpdate": "no action"
2290
+ },
2291
+ "message_send_contact_id_contact_id_fk": {
2292
+ "name": "message_send_contact_id_contact_id_fk",
2293
+ "tableFrom": "message_send",
2294
+ "tableTo": "contact",
2295
+ "columnsFrom": ["contact_id"],
2296
+ "columnsTo": ["id"],
2297
+ "onDelete": "set null",
2298
+ "onUpdate": "no action"
2299
+ },
2300
+ "message_send_aws_account_id_aws_account_id_fk": {
2301
+ "name": "message_send_aws_account_id_aws_account_id_fk",
2302
+ "tableFrom": "message_send",
2303
+ "tableTo": "aws_account",
2304
+ "columnsFrom": ["aws_account_id"],
2305
+ "columnsTo": ["id"],
2306
+ "onDelete": "set null",
2307
+ "onUpdate": "no action"
2308
+ },
2309
+ "message_send_batch_send_id_batch_send_id_fk": {
2310
+ "name": "message_send_batch_send_id_batch_send_id_fk",
2311
+ "tableFrom": "message_send",
2312
+ "tableTo": "batch_send",
2313
+ "columnsFrom": ["batch_send_id"],
2314
+ "columnsTo": ["id"],
2315
+ "onDelete": "set null",
2316
+ "onUpdate": "no action"
2317
+ },
2318
+ "message_send_email_template_id_template_id_fk": {
2319
+ "name": "message_send_email_template_id_template_id_fk",
2320
+ "tableFrom": "message_send",
2321
+ "tableTo": "template",
2322
+ "columnsFrom": ["email_template_id"],
2323
+ "columnsTo": ["id"],
2324
+ "onDelete": "set null",
2325
+ "onUpdate": "no action"
2326
+ }
2327
+ },
2328
+ "compositePrimaryKeys": {},
2329
+ "uniqueConstraints": {},
2330
+ "policies": {},
2331
+ "checkConstraints": {},
2332
+ "isRLSEnabled": false
2333
+ },
2334
+ "public.contact": {
2335
+ "name": "contact",
2336
+ "schema": "",
2337
+ "columns": {
2338
+ "id": {
2339
+ "name": "id",
2340
+ "type": "text",
2341
+ "primaryKey": true,
2342
+ "notNull": true
2343
+ },
2344
+ "organization_id": {
2345
+ "name": "organization_id",
2346
+ "type": "text",
2347
+ "primaryKey": false,
2348
+ "notNull": true
2349
+ },
2350
+ "email": {
2351
+ "name": "email",
2352
+ "type": "text",
2353
+ "primaryKey": false,
2354
+ "notNull": false
2355
+ },
2356
+ "email_hash": {
2357
+ "name": "email_hash",
2358
+ "type": "text",
2359
+ "primaryKey": false,
2360
+ "notNull": false
2361
+ },
2362
+ "email_status": {
2363
+ "name": "email_status",
2364
+ "type": "text",
2365
+ "primaryKey": false,
2366
+ "notNull": false
2367
+ },
2368
+ "email_verified_at": {
2369
+ "name": "email_verified_at",
2370
+ "type": "timestamp",
2371
+ "primaryKey": false,
2372
+ "notNull": false
2373
+ },
2374
+ "email_unsubscribed_at": {
2375
+ "name": "email_unsubscribed_at",
2376
+ "type": "timestamp",
2377
+ "primaryKey": false,
2378
+ "notNull": false
2379
+ },
2380
+ "email_bounced_at": {
2381
+ "name": "email_bounced_at",
2382
+ "type": "timestamp",
2383
+ "primaryKey": false,
2384
+ "notNull": false
2385
+ },
2386
+ "email_complained_at": {
2387
+ "name": "email_complained_at",
2388
+ "type": "timestamp",
2389
+ "primaryKey": false,
2390
+ "notNull": false
2391
+ },
2392
+ "last_email_sent_at": {
2393
+ "name": "last_email_sent_at",
2394
+ "type": "timestamp",
2395
+ "primaryKey": false,
2396
+ "notNull": false
2397
+ },
2398
+ "last_email_opened_at": {
2399
+ "name": "last_email_opened_at",
2400
+ "type": "timestamp",
2401
+ "primaryKey": false,
2402
+ "notNull": false
2403
+ },
2404
+ "last_email_clicked_at": {
2405
+ "name": "last_email_clicked_at",
2406
+ "type": "timestamp",
2407
+ "primaryKey": false,
2408
+ "notNull": false
2409
+ },
2410
+ "emails_sent": {
2411
+ "name": "emails_sent",
2412
+ "type": "integer",
2413
+ "primaryKey": false,
2414
+ "notNull": true,
2415
+ "default": 0
2416
+ },
2417
+ "emails_opened": {
2418
+ "name": "emails_opened",
2419
+ "type": "integer",
2420
+ "primaryKey": false,
2421
+ "notNull": true,
2422
+ "default": 0
2423
+ },
2424
+ "emails_clicked": {
2425
+ "name": "emails_clicked",
2426
+ "type": "integer",
2427
+ "primaryKey": false,
2428
+ "notNull": true,
2429
+ "default": 0
2430
+ },
2431
+ "phone": {
2432
+ "name": "phone",
2433
+ "type": "text",
2434
+ "primaryKey": false,
2435
+ "notNull": false
2436
+ },
2437
+ "phone_hash": {
2438
+ "name": "phone_hash",
2439
+ "type": "text",
2440
+ "primaryKey": false,
2441
+ "notNull": false
2442
+ },
2443
+ "sms_status": {
2444
+ "name": "sms_status",
2445
+ "type": "text",
2446
+ "primaryKey": false,
2447
+ "notNull": false
2448
+ },
2449
+ "sms_consented_at": {
2450
+ "name": "sms_consented_at",
2451
+ "type": "timestamp",
2452
+ "primaryKey": false,
2453
+ "notNull": false
2454
+ },
2455
+ "sms_opted_out_at": {
2456
+ "name": "sms_opted_out_at",
2457
+ "type": "timestamp",
2458
+ "primaryKey": false,
2459
+ "notNull": false
2460
+ },
2461
+ "sms_invalid_at": {
2462
+ "name": "sms_invalid_at",
2463
+ "type": "timestamp",
2464
+ "primaryKey": false,
2465
+ "notNull": false
2466
+ },
2467
+ "last_sms_sent_at": {
2468
+ "name": "last_sms_sent_at",
2469
+ "type": "timestamp",
2470
+ "primaryKey": false,
2471
+ "notNull": false
2472
+ },
2473
+ "last_sms_clicked_at": {
2474
+ "name": "last_sms_clicked_at",
2475
+ "type": "timestamp",
2476
+ "primaryKey": false,
2477
+ "notNull": false
2478
+ },
2479
+ "sms_sent": {
2480
+ "name": "sms_sent",
2481
+ "type": "integer",
2482
+ "primaryKey": false,
2483
+ "notNull": true,
2484
+ "default": 0
2485
+ },
2486
+ "sms_clicked": {
2487
+ "name": "sms_clicked",
2488
+ "type": "integer",
2489
+ "primaryKey": false,
2490
+ "notNull": true,
2491
+ "default": 0
2492
+ },
2493
+ "properties": {
2494
+ "name": "properties",
2495
+ "type": "json",
2496
+ "primaryKey": false,
2497
+ "notNull": true,
2498
+ "default": "'{}'::json"
2499
+ },
2500
+ "last_activity_at": {
2501
+ "name": "last_activity_at",
2502
+ "type": "timestamp",
2503
+ "primaryKey": false,
2504
+ "notNull": false
2505
+ },
2506
+ "created_at": {
2507
+ "name": "created_at",
2508
+ "type": "timestamp",
2509
+ "primaryKey": false,
2510
+ "notNull": true,
2511
+ "default": "now()"
2512
+ },
2513
+ "updated_at": {
2514
+ "name": "updated_at",
2515
+ "type": "timestamp",
2516
+ "primaryKey": false,
2517
+ "notNull": true,
2518
+ "default": "now()"
2519
+ },
2520
+ "created_by": {
2521
+ "name": "created_by",
2522
+ "type": "text",
2523
+ "primaryKey": false,
2524
+ "notNull": false
2525
+ },
2526
+ "status": {
2527
+ "name": "status",
2528
+ "type": "text",
2529
+ "primaryKey": false,
2530
+ "notNull": true,
2531
+ "default": "'active'"
2532
+ },
2533
+ "confirmed_at": {
2534
+ "name": "confirmed_at",
2535
+ "type": "timestamp",
2536
+ "primaryKey": false,
2537
+ "notNull": false
2538
+ },
2539
+ "unsubscribed_at": {
2540
+ "name": "unsubscribed_at",
2541
+ "type": "timestamp",
2542
+ "primaryKey": false,
2543
+ "notNull": false
2544
+ },
2545
+ "bounced_at": {
2546
+ "name": "bounced_at",
2547
+ "type": "timestamp",
2548
+ "primaryKey": false,
2549
+ "notNull": false
2550
+ },
2551
+ "complained_at": {
2552
+ "name": "complained_at",
2553
+ "type": "timestamp",
2554
+ "primaryKey": false,
2555
+ "notNull": false
2556
+ }
2557
+ },
2558
+ "indexes": {
2559
+ "contact_org_idx": {
2560
+ "name": "contact_org_idx",
2561
+ "columns": [
2562
+ {
2563
+ "expression": "organization_id",
2564
+ "isExpression": false,
2565
+ "asc": true,
2566
+ "nulls": "last"
2567
+ }
2568
+ ],
2569
+ "isUnique": false,
2570
+ "concurrently": false,
2571
+ "method": "btree",
2572
+ "with": {}
2573
+ },
2574
+ "contact_email_idx": {
2575
+ "name": "contact_email_idx",
2576
+ "columns": [
2577
+ {
2578
+ "expression": "email",
2579
+ "isExpression": false,
2580
+ "asc": true,
2581
+ "nulls": "last"
2582
+ }
2583
+ ],
2584
+ "isUnique": false,
2585
+ "concurrently": false,
2586
+ "method": "btree",
2587
+ "with": {}
2588
+ },
2589
+ "contact_unique_org_email_idx": {
2590
+ "name": "contact_unique_org_email_idx",
2591
+ "columns": [
2592
+ {
2593
+ "expression": "organization_id",
2594
+ "isExpression": false,
2595
+ "asc": true,
2596
+ "nulls": "last"
2597
+ },
2598
+ {
2599
+ "expression": "email_hash",
2600
+ "isExpression": false,
2601
+ "asc": true,
2602
+ "nulls": "last"
2603
+ }
2604
+ ],
2605
+ "isUnique": true,
2606
+ "where": "email_hash IS NOT NULL",
2607
+ "concurrently": false,
2608
+ "method": "btree",
2609
+ "with": {}
2610
+ },
2611
+ "contact_email_status_idx": {
2612
+ "name": "contact_email_status_idx",
2613
+ "columns": [
2614
+ {
2615
+ "expression": "organization_id",
2616
+ "isExpression": false,
2617
+ "asc": true,
2618
+ "nulls": "last"
2619
+ },
2620
+ {
2621
+ "expression": "email_status",
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_phone_idx": {
2633
+ "name": "contact_phone_idx",
2634
+ "columns": [
2635
+ {
2636
+ "expression": "phone",
2637
+ "isExpression": false,
2638
+ "asc": true,
2639
+ "nulls": "last"
2640
+ }
2641
+ ],
2642
+ "isUnique": false,
2643
+ "concurrently": false,
2644
+ "method": "btree",
2645
+ "with": {}
2646
+ },
2647
+ "contact_unique_org_phone_idx": {
2648
+ "name": "contact_unique_org_phone_idx",
2649
+ "columns": [
2650
+ {
2651
+ "expression": "organization_id",
2652
+ "isExpression": false,
2653
+ "asc": true,
2654
+ "nulls": "last"
2655
+ },
2656
+ {
2657
+ "expression": "phone_hash",
2658
+ "isExpression": false,
2659
+ "asc": true,
2660
+ "nulls": "last"
2661
+ }
2662
+ ],
2663
+ "isUnique": true,
2664
+ "where": "phone_hash IS NOT NULL",
2665
+ "concurrently": false,
2666
+ "method": "btree",
2667
+ "with": {}
2668
+ },
2669
+ "contact_sms_status_idx": {
2670
+ "name": "contact_sms_status_idx",
2671
+ "columns": [
2672
+ {
2673
+ "expression": "organization_id",
2674
+ "isExpression": false,
2675
+ "asc": true,
2676
+ "nulls": "last"
2677
+ },
2678
+ {
2679
+ "expression": "sms_status",
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_status_idx": {
2691
+ "name": "contact_status_idx",
2692
+ "columns": [
2693
+ {
2694
+ "expression": "organization_id",
2695
+ "isExpression": false,
2696
+ "asc": true,
2697
+ "nulls": "last"
2698
+ },
2699
+ {
2700
+ "expression": "status",
2701
+ "isExpression": false,
2702
+ "asc": true,
2703
+ "nulls": "last"
2704
+ }
2705
+ ],
2706
+ "isUnique": false,
2707
+ "concurrently": false,
2708
+ "method": "btree",
2709
+ "with": {}
2710
+ }
2711
+ },
2712
+ "foreignKeys": {
2713
+ "contact_organization_id_organization_id_fk": {
2714
+ "name": "contact_organization_id_organization_id_fk",
2715
+ "tableFrom": "contact",
2716
+ "tableTo": "organization",
2717
+ "columnsFrom": ["organization_id"],
2718
+ "columnsTo": ["id"],
2719
+ "onDelete": "cascade",
2720
+ "onUpdate": "no action"
2721
+ },
2722
+ "contact_created_by_user_id_fk": {
2723
+ "name": "contact_created_by_user_id_fk",
2724
+ "tableFrom": "contact",
2725
+ "tableTo": "user",
2726
+ "columnsFrom": ["created_by"],
2727
+ "columnsTo": ["id"],
2728
+ "onDelete": "no action",
2729
+ "onUpdate": "no action"
2730
+ }
2731
+ },
2732
+ "compositePrimaryKeys": {},
2733
+ "uniqueConstraints": {},
2734
+ "policies": {},
2735
+ "checkConstraints": {},
2736
+ "isRLSEnabled": false
2737
+ },
2738
+ "public.contact_topic": {
2739
+ "name": "contact_topic",
2740
+ "schema": "",
2741
+ "columns": {
2742
+ "contact_id": {
2743
+ "name": "contact_id",
2744
+ "type": "text",
2745
+ "primaryKey": false,
2746
+ "notNull": true
2747
+ },
2748
+ "topic_id": {
2749
+ "name": "topic_id",
2750
+ "type": "text",
2751
+ "primaryKey": false,
2752
+ "notNull": true
2753
+ },
2754
+ "status": {
2755
+ "name": "status",
2756
+ "type": "text",
2757
+ "primaryKey": false,
2758
+ "notNull": true,
2759
+ "default": "'subscribed'"
2760
+ },
2761
+ "subscribed_at": {
2762
+ "name": "subscribed_at",
2763
+ "type": "timestamp",
2764
+ "primaryKey": false,
2765
+ "notNull": false,
2766
+ "default": "now()"
2767
+ },
2768
+ "unsubscribed_at": {
2769
+ "name": "unsubscribed_at",
2770
+ "type": "timestamp",
2771
+ "primaryKey": false,
2772
+ "notNull": false
2773
+ }
2774
+ },
2775
+ "indexes": {
2776
+ "contact_topic_topic_idx": {
2777
+ "name": "contact_topic_topic_idx",
2778
+ "columns": [
2779
+ {
2780
+ "expression": "topic_id",
2781
+ "isExpression": false,
2782
+ "asc": true,
2783
+ "nulls": "last"
2784
+ }
2785
+ ],
2786
+ "isUnique": false,
2787
+ "concurrently": false,
2788
+ "method": "btree",
2789
+ "with": {}
2790
+ },
2791
+ "contact_topic_status_idx": {
2792
+ "name": "contact_topic_status_idx",
2793
+ "columns": [
2794
+ {
2795
+ "expression": "topic_id",
2796
+ "isExpression": false,
2797
+ "asc": true,
2798
+ "nulls": "last"
2799
+ },
2800
+ {
2801
+ "expression": "status",
2802
+ "isExpression": false,
2803
+ "asc": true,
2804
+ "nulls": "last"
2805
+ }
2806
+ ],
2807
+ "isUnique": false,
2808
+ "concurrently": false,
2809
+ "method": "btree",
2810
+ "with": {}
2811
+ }
2812
+ },
2813
+ "foreignKeys": {
2814
+ "contact_topic_contact_id_contact_id_fk": {
2815
+ "name": "contact_topic_contact_id_contact_id_fk",
2816
+ "tableFrom": "contact_topic",
2817
+ "tableTo": "contact",
2818
+ "columnsFrom": ["contact_id"],
2819
+ "columnsTo": ["id"],
2820
+ "onDelete": "cascade",
2821
+ "onUpdate": "no action"
2822
+ },
2823
+ "contact_topic_topic_id_topic_id_fk": {
2824
+ "name": "contact_topic_topic_id_topic_id_fk",
2825
+ "tableFrom": "contact_topic",
2826
+ "tableTo": "topic",
2827
+ "columnsFrom": ["topic_id"],
2828
+ "columnsTo": ["id"],
2829
+ "onDelete": "cascade",
2830
+ "onUpdate": "no action"
2831
+ }
2832
+ },
2833
+ "compositePrimaryKeys": {
2834
+ "contact_topic_contact_id_topic_id_pk": {
2835
+ "name": "contact_topic_contact_id_topic_id_pk",
2836
+ "columns": ["contact_id", "topic_id"]
2837
+ }
2838
+ },
2839
+ "uniqueConstraints": {},
2840
+ "policies": {},
2841
+ "checkConstraints": {},
2842
+ "isRLSEnabled": false
2843
+ },
2844
+ "public.topic": {
2845
+ "name": "topic",
2846
+ "schema": "",
2847
+ "columns": {
2848
+ "id": {
2849
+ "name": "id",
2850
+ "type": "text",
2851
+ "primaryKey": true,
2852
+ "notNull": true
2853
+ },
2854
+ "organization_id": {
2855
+ "name": "organization_id",
2856
+ "type": "text",
2857
+ "primaryKey": false,
2858
+ "notNull": true
2859
+ },
2860
+ "name": {
2861
+ "name": "name",
2862
+ "type": "text",
2863
+ "primaryKey": false,
2864
+ "notNull": true
2865
+ },
2866
+ "slug": {
2867
+ "name": "slug",
2868
+ "type": "text",
2869
+ "primaryKey": false,
2870
+ "notNull": true
2871
+ },
2872
+ "description": {
2873
+ "name": "description",
2874
+ "type": "text",
2875
+ "primaryKey": false,
2876
+ "notNull": false
2877
+ },
2878
+ "public": {
2879
+ "name": "public",
2880
+ "type": "boolean",
2881
+ "primaryKey": false,
2882
+ "notNull": true,
2883
+ "default": true
2884
+ },
2885
+ "double_opt_in": {
2886
+ "name": "double_opt_in",
2887
+ "type": "boolean",
2888
+ "primaryKey": false,
2889
+ "notNull": true,
2890
+ "default": false
2891
+ },
2892
+ "created_at": {
2893
+ "name": "created_at",
2894
+ "type": "timestamp",
2895
+ "primaryKey": false,
2896
+ "notNull": true,
2897
+ "default": "now()"
2898
+ },
2899
+ "updated_at": {
2900
+ "name": "updated_at",
2901
+ "type": "timestamp",
2902
+ "primaryKey": false,
2903
+ "notNull": true,
2904
+ "default": "now()"
2905
+ },
2906
+ "created_by": {
2907
+ "name": "created_by",
2908
+ "type": "text",
2909
+ "primaryKey": false,
2910
+ "notNull": false
2911
+ }
2912
+ },
2913
+ "indexes": {
2914
+ "topic_org_idx": {
2915
+ "name": "topic_org_idx",
2916
+ "columns": [
2917
+ {
2918
+ "expression": "organization_id",
2919
+ "isExpression": false,
2920
+ "asc": true,
2921
+ "nulls": "last"
2922
+ }
2923
+ ],
2924
+ "isUnique": false,
2925
+ "concurrently": false,
2926
+ "method": "btree",
2927
+ "with": {}
2928
+ },
2929
+ "topic_unique_org_slug_idx": {
2930
+ "name": "topic_unique_org_slug_idx",
2931
+ "columns": [
2932
+ {
2933
+ "expression": "organization_id",
2934
+ "isExpression": false,
2935
+ "asc": true,
2936
+ "nulls": "last"
2937
+ },
2938
+ {
2939
+ "expression": "slug",
2940
+ "isExpression": false,
2941
+ "asc": true,
2942
+ "nulls": "last"
2943
+ }
2944
+ ],
2945
+ "isUnique": true,
2946
+ "concurrently": false,
2947
+ "method": "btree",
2948
+ "with": {}
2949
+ }
2950
+ },
2951
+ "foreignKeys": {
2952
+ "topic_organization_id_organization_id_fk": {
2953
+ "name": "topic_organization_id_organization_id_fk",
2954
+ "tableFrom": "topic",
2955
+ "tableTo": "organization",
2956
+ "columnsFrom": ["organization_id"],
2957
+ "columnsTo": ["id"],
2958
+ "onDelete": "cascade",
2959
+ "onUpdate": "no action"
2960
+ },
2961
+ "topic_created_by_user_id_fk": {
2962
+ "name": "topic_created_by_user_id_fk",
2963
+ "tableFrom": "topic",
2964
+ "tableTo": "user",
2965
+ "columnsFrom": ["created_by"],
2966
+ "columnsTo": ["id"],
2967
+ "onDelete": "no action",
2968
+ "onUpdate": "no action"
2969
+ }
2970
+ },
2971
+ "compositePrimaryKeys": {},
2972
+ "uniqueConstraints": {},
2973
+ "policies": {},
2974
+ "checkConstraints": {},
2975
+ "isRLSEnabled": false
2976
+ },
2977
+ "public.segment": {
2978
+ "name": "segment",
2979
+ "schema": "",
2980
+ "columns": {
2981
+ "id": {
2982
+ "name": "id",
2983
+ "type": "text",
2984
+ "primaryKey": true,
2985
+ "notNull": true
2986
+ },
2987
+ "organization_id": {
2988
+ "name": "organization_id",
2989
+ "type": "text",
2990
+ "primaryKey": false,
2991
+ "notNull": true
2992
+ },
2993
+ "name": {
2994
+ "name": "name",
2995
+ "type": "text",
2996
+ "primaryKey": false,
2997
+ "notNull": true
2998
+ },
2999
+ "description": {
3000
+ "name": "description",
3001
+ "type": "text",
3002
+ "primaryKey": false,
3003
+ "notNull": false
3004
+ },
3005
+ "condition": {
3006
+ "name": "condition",
3007
+ "type": "json",
3008
+ "primaryKey": false,
3009
+ "notNull": true
3010
+ },
3011
+ "track_membership": {
3012
+ "name": "track_membership",
3013
+ "type": "boolean",
3014
+ "primaryKey": false,
3015
+ "notNull": true,
3016
+ "default": false
3017
+ },
3018
+ "member_count": {
3019
+ "name": "member_count",
3020
+ "type": "integer",
3021
+ "primaryKey": false,
3022
+ "notNull": true,
3023
+ "default": 0
3024
+ },
3025
+ "last_computed_at": {
3026
+ "name": "last_computed_at",
3027
+ "type": "timestamp",
3028
+ "primaryKey": false,
3029
+ "notNull": false
3030
+ },
3031
+ "created_by": {
3032
+ "name": "created_by",
3033
+ "type": "text",
3034
+ "primaryKey": false,
3035
+ "notNull": false
3036
+ },
3037
+ "created_at": {
3038
+ "name": "created_at",
3039
+ "type": "timestamp",
3040
+ "primaryKey": false,
3041
+ "notNull": true,
3042
+ "default": "now()"
3043
+ },
3044
+ "updated_at": {
3045
+ "name": "updated_at",
3046
+ "type": "timestamp",
3047
+ "primaryKey": false,
3048
+ "notNull": true,
3049
+ "default": "now()"
3050
+ }
3051
+ },
3052
+ "indexes": {
3053
+ "segment_org_idx": {
3054
+ "name": "segment_org_idx",
3055
+ "columns": [
3056
+ {
3057
+ "expression": "organization_id",
3058
+ "isExpression": false,
3059
+ "asc": true,
3060
+ "nulls": "last"
3061
+ }
3062
+ ],
3063
+ "isUnique": false,
3064
+ "concurrently": false,
3065
+ "method": "btree",
3066
+ "with": {}
3067
+ },
3068
+ "segment_name_idx": {
3069
+ "name": "segment_name_idx",
3070
+ "columns": [
3071
+ {
3072
+ "expression": "organization_id",
3073
+ "isExpression": false,
3074
+ "asc": true,
3075
+ "nulls": "last"
3076
+ },
3077
+ {
3078
+ "expression": "name",
3079
+ "isExpression": false,
3080
+ "asc": true,
3081
+ "nulls": "last"
3082
+ }
3083
+ ],
3084
+ "isUnique": false,
3085
+ "concurrently": false,
3086
+ "method": "btree",
3087
+ "with": {}
3088
+ }
3089
+ },
3090
+ "foreignKeys": {
3091
+ "segment_organization_id_organization_id_fk": {
3092
+ "name": "segment_organization_id_organization_id_fk",
3093
+ "tableFrom": "segment",
3094
+ "tableTo": "organization",
3095
+ "columnsFrom": ["organization_id"],
3096
+ "columnsTo": ["id"],
3097
+ "onDelete": "cascade",
3098
+ "onUpdate": "no action"
3099
+ },
3100
+ "segment_created_by_user_id_fk": {
3101
+ "name": "segment_created_by_user_id_fk",
3102
+ "tableFrom": "segment",
3103
+ "tableTo": "user",
3104
+ "columnsFrom": ["created_by"],
3105
+ "columnsTo": ["id"],
3106
+ "onDelete": "no action",
3107
+ "onUpdate": "no action"
3108
+ }
3109
+ },
3110
+ "compositePrimaryKeys": {},
3111
+ "uniqueConstraints": {},
3112
+ "policies": {},
3113
+ "checkConstraints": {},
3114
+ "isRLSEnabled": false
3115
+ },
3116
+ "public.ai_conversation": {
3117
+ "name": "ai_conversation",
3118
+ "schema": "",
3119
+ "columns": {
3120
+ "id": {
3121
+ "name": "id",
3122
+ "type": "text",
3123
+ "primaryKey": true,
3124
+ "notNull": true
3125
+ },
3126
+ "organization_id": {
3127
+ "name": "organization_id",
3128
+ "type": "text",
3129
+ "primaryKey": false,
3130
+ "notNull": true
3131
+ },
3132
+ "template_id": {
3133
+ "name": "template_id",
3134
+ "type": "text",
3135
+ "primaryKey": false,
3136
+ "notNull": false
3137
+ },
3138
+ "messages": {
3139
+ "name": "messages",
3140
+ "type": "jsonb",
3141
+ "primaryKey": false,
3142
+ "notNull": false,
3143
+ "default": "'[]'::jsonb"
3144
+ },
3145
+ "total_tokens": {
3146
+ "name": "total_tokens",
3147
+ "type": "integer",
3148
+ "primaryKey": false,
3149
+ "notNull": true,
3150
+ "default": 0
3151
+ },
3152
+ "created_at": {
3153
+ "name": "created_at",
3154
+ "type": "timestamp",
3155
+ "primaryKey": false,
3156
+ "notNull": true,
3157
+ "default": "now()"
3158
+ },
3159
+ "updated_at": {
3160
+ "name": "updated_at",
3161
+ "type": "timestamp",
3162
+ "primaryKey": false,
3163
+ "notNull": true,
3164
+ "default": "now()"
3165
+ },
3166
+ "created_by": {
3167
+ "name": "created_by",
3168
+ "type": "text",
3169
+ "primaryKey": false,
3170
+ "notNull": true
3171
+ }
3172
+ },
3173
+ "indexes": {
3174
+ "ai_conversation_org_idx": {
3175
+ "name": "ai_conversation_org_idx",
3176
+ "columns": [
3177
+ {
3178
+ "expression": "organization_id",
3179
+ "isExpression": false,
3180
+ "asc": true,
3181
+ "nulls": "last"
3182
+ }
3183
+ ],
3184
+ "isUnique": false,
3185
+ "concurrently": false,
3186
+ "method": "btree",
3187
+ "with": {}
3188
+ },
3189
+ "ai_conversation_template_idx": {
3190
+ "name": "ai_conversation_template_idx",
3191
+ "columns": [
3192
+ {
3193
+ "expression": "template_id",
3194
+ "isExpression": false,
3195
+ "asc": true,
3196
+ "nulls": "last"
3197
+ }
3198
+ ],
3199
+ "isUnique": false,
3200
+ "concurrently": false,
3201
+ "method": "btree",
3202
+ "with": {}
3203
+ }
3204
+ },
3205
+ "foreignKeys": {
3206
+ "ai_conversation_organization_id_organization_id_fk": {
3207
+ "name": "ai_conversation_organization_id_organization_id_fk",
3208
+ "tableFrom": "ai_conversation",
3209
+ "tableTo": "organization",
3210
+ "columnsFrom": ["organization_id"],
3211
+ "columnsTo": ["id"],
3212
+ "onDelete": "cascade",
3213
+ "onUpdate": "no action"
3214
+ },
3215
+ "ai_conversation_template_id_template_id_fk": {
3216
+ "name": "ai_conversation_template_id_template_id_fk",
3217
+ "tableFrom": "ai_conversation",
3218
+ "tableTo": "template",
3219
+ "columnsFrom": ["template_id"],
3220
+ "columnsTo": ["id"],
3221
+ "onDelete": "cascade",
3222
+ "onUpdate": "no action"
3223
+ },
3224
+ "ai_conversation_created_by_user_id_fk": {
3225
+ "name": "ai_conversation_created_by_user_id_fk",
3226
+ "tableFrom": "ai_conversation",
3227
+ "tableTo": "user",
3228
+ "columnsFrom": ["created_by"],
3229
+ "columnsTo": ["id"],
3230
+ "onDelete": "set null",
3231
+ "onUpdate": "no action"
3232
+ }
3233
+ },
3234
+ "compositePrimaryKeys": {},
3235
+ "uniqueConstraints": {},
3236
+ "policies": {},
3237
+ "checkConstraints": {},
3238
+ "isRLSEnabled": false
3239
+ },
3240
+ "public.brand_kit": {
3241
+ "name": "brand_kit",
3242
+ "schema": "",
3243
+ "columns": {
3244
+ "id": {
3245
+ "name": "id",
3246
+ "type": "text",
3247
+ "primaryKey": true,
3248
+ "notNull": true
3249
+ },
3250
+ "organization_id": {
3251
+ "name": "organization_id",
3252
+ "type": "text",
3253
+ "primaryKey": false,
3254
+ "notNull": true
3255
+ },
3256
+ "name": {
3257
+ "name": "name",
3258
+ "type": "text",
3259
+ "primaryKey": false,
3260
+ "notNull": true,
3261
+ "default": "'Default'"
3262
+ },
3263
+ "logo_url": {
3264
+ "name": "logo_url",
3265
+ "type": "text",
3266
+ "primaryKey": false,
3267
+ "notNull": false
3268
+ },
3269
+ "primary_color": {
3270
+ "name": "primary_color",
3271
+ "type": "text",
3272
+ "primaryKey": false,
3273
+ "notNull": true,
3274
+ "default": "'#5046e5'"
3275
+ },
3276
+ "secondary_color": {
3277
+ "name": "secondary_color",
3278
+ "type": "text",
3279
+ "primaryKey": false,
3280
+ "notNull": true,
3281
+ "default": "'#6366f1'"
3282
+ },
3283
+ "background_color": {
3284
+ "name": "background_color",
3285
+ "type": "text",
3286
+ "primaryKey": false,
3287
+ "notNull": true,
3288
+ "default": "'#ffffff'"
3289
+ },
3290
+ "text_color": {
3291
+ "name": "text_color",
3292
+ "type": "text",
3293
+ "primaryKey": false,
3294
+ "notNull": true,
3295
+ "default": "'#1f2937'"
3296
+ },
3297
+ "font_family": {
3298
+ "name": "font_family",
3299
+ "type": "text",
3300
+ "primaryKey": false,
3301
+ "notNull": true,
3302
+ "default": "'system-ui, sans-serif'"
3303
+ },
3304
+ "heading_font_family": {
3305
+ "name": "heading_font_family",
3306
+ "type": "text",
3307
+ "primaryKey": false,
3308
+ "notNull": false
3309
+ },
3310
+ "button_style": {
3311
+ "name": "button_style",
3312
+ "type": "text",
3313
+ "primaryKey": false,
3314
+ "notNull": true,
3315
+ "default": "'rounded'"
3316
+ },
3317
+ "button_radius": {
3318
+ "name": "button_radius",
3319
+ "type": "text",
3320
+ "primaryKey": false,
3321
+ "notNull": true,
3322
+ "default": "'4px'"
3323
+ },
3324
+ "company_name": {
3325
+ "name": "company_name",
3326
+ "type": "text",
3327
+ "primaryKey": false,
3328
+ "notNull": false
3329
+ },
3330
+ "company_address": {
3331
+ "name": "company_address",
3332
+ "type": "text",
3333
+ "primaryKey": false,
3334
+ "notNull": false
3335
+ },
3336
+ "social_links": {
3337
+ "name": "social_links",
3338
+ "type": "jsonb",
3339
+ "primaryKey": false,
3340
+ "notNull": false,
3341
+ "default": "'[]'::jsonb"
3342
+ },
3343
+ "source_domain": {
3344
+ "name": "source_domain",
3345
+ "type": "text",
3346
+ "primaryKey": false,
3347
+ "notNull": false
3348
+ },
3349
+ "auto_extracted": {
3350
+ "name": "auto_extracted",
3351
+ "type": "boolean",
3352
+ "primaryKey": false,
3353
+ "notNull": true,
3354
+ "default": false
3355
+ },
3356
+ "is_default": {
3357
+ "name": "is_default",
3358
+ "type": "boolean",
3359
+ "primaryKey": false,
3360
+ "notNull": true,
3361
+ "default": false
3362
+ },
3363
+ "created_at": {
3364
+ "name": "created_at",
3365
+ "type": "timestamp",
3366
+ "primaryKey": false,
3367
+ "notNull": true,
3368
+ "default": "now()"
3369
+ },
3370
+ "updated_at": {
3371
+ "name": "updated_at",
3372
+ "type": "timestamp",
3373
+ "primaryKey": false,
3374
+ "notNull": true,
3375
+ "default": "now()"
3376
+ }
3377
+ },
3378
+ "indexes": {
3379
+ "brand_kit_org_idx": {
3380
+ "name": "brand_kit_org_idx",
3381
+ "columns": [
3382
+ {
3383
+ "expression": "organization_id",
3384
+ "isExpression": false,
3385
+ "asc": true,
3386
+ "nulls": "last"
3387
+ }
3388
+ ],
3389
+ "isUnique": false,
3390
+ "concurrently": false,
3391
+ "method": "btree",
3392
+ "with": {}
3393
+ },
3394
+ "brand_kit_default_idx": {
3395
+ "name": "brand_kit_default_idx",
3396
+ "columns": [
3397
+ {
3398
+ "expression": "organization_id",
3399
+ "isExpression": false,
3400
+ "asc": true,
3401
+ "nulls": "last"
3402
+ },
3403
+ {
3404
+ "expression": "is_default",
3405
+ "isExpression": false,
3406
+ "asc": true,
3407
+ "nulls": "last"
3408
+ }
3409
+ ],
3410
+ "isUnique": false,
3411
+ "concurrently": false,
3412
+ "method": "btree",
3413
+ "with": {}
3414
+ }
3415
+ },
3416
+ "foreignKeys": {
3417
+ "brand_kit_organization_id_organization_id_fk": {
3418
+ "name": "brand_kit_organization_id_organization_id_fk",
3419
+ "tableFrom": "brand_kit",
3420
+ "tableTo": "organization",
3421
+ "columnsFrom": ["organization_id"],
3422
+ "columnsTo": ["id"],
3423
+ "onDelete": "cascade",
3424
+ "onUpdate": "no action"
3425
+ }
3426
+ },
3427
+ "compositePrimaryKeys": {},
3428
+ "uniqueConstraints": {},
3429
+ "policies": {},
3430
+ "checkConstraints": {},
3431
+ "isRLSEnabled": false
3432
+ },
3433
+ "public.reusable_block": {
3434
+ "name": "reusable_block",
3435
+ "schema": "",
3436
+ "columns": {
3437
+ "id": {
3438
+ "name": "id",
3439
+ "type": "text",
3440
+ "primaryKey": true,
3441
+ "notNull": true
3442
+ },
3443
+ "organization_id": {
3444
+ "name": "organization_id",
3445
+ "type": "text",
3446
+ "primaryKey": false,
3447
+ "notNull": true
3448
+ },
3449
+ "name": {
3450
+ "name": "name",
3451
+ "type": "text",
3452
+ "primaryKey": false,
3453
+ "notNull": true
3454
+ },
3455
+ "description": {
3456
+ "name": "description",
3457
+ "type": "text",
3458
+ "primaryKey": false,
3459
+ "notNull": false
3460
+ },
3461
+ "category": {
3462
+ "name": "category",
3463
+ "type": "text",
3464
+ "primaryKey": false,
3465
+ "notNull": true,
3466
+ "default": "'custom'"
3467
+ },
3468
+ "content": {
3469
+ "name": "content",
3470
+ "type": "jsonb",
3471
+ "primaryKey": false,
3472
+ "notNull": true
3473
+ },
3474
+ "thumbnail": {
3475
+ "name": "thumbnail",
3476
+ "type": "text",
3477
+ "primaryKey": false,
3478
+ "notNull": false
3479
+ },
3480
+ "is_public": {
3481
+ "name": "is_public",
3482
+ "type": "boolean",
3483
+ "primaryKey": false,
3484
+ "notNull": true,
3485
+ "default": false
3486
+ },
3487
+ "usage_count": {
3488
+ "name": "usage_count",
3489
+ "type": "integer",
3490
+ "primaryKey": false,
3491
+ "notNull": true,
3492
+ "default": 0
3493
+ },
3494
+ "created_at": {
3495
+ "name": "created_at",
3496
+ "type": "timestamp",
3497
+ "primaryKey": false,
3498
+ "notNull": true,
3499
+ "default": "now()"
3500
+ },
3501
+ "updated_at": {
3502
+ "name": "updated_at",
3503
+ "type": "timestamp",
3504
+ "primaryKey": false,
3505
+ "notNull": true,
3506
+ "default": "now()"
3507
+ },
3508
+ "created_by": {
3509
+ "name": "created_by",
3510
+ "type": "text",
3511
+ "primaryKey": false,
3512
+ "notNull": true
3513
+ }
3514
+ },
3515
+ "indexes": {
3516
+ "reusable_block_org_idx": {
3517
+ "name": "reusable_block_org_idx",
3518
+ "columns": [
3519
+ {
3520
+ "expression": "organization_id",
3521
+ "isExpression": false,
3522
+ "asc": true,
3523
+ "nulls": "last"
3524
+ }
3525
+ ],
3526
+ "isUnique": false,
3527
+ "concurrently": false,
3528
+ "method": "btree",
3529
+ "with": {}
3530
+ },
3531
+ "reusable_block_created_by_category_idx": {
3532
+ "name": "reusable_block_created_by_category_idx",
3533
+ "columns": [
3534
+ {
3535
+ "expression": "created_by",
3536
+ "isExpression": false,
3537
+ "asc": true,
3538
+ "nulls": "last"
3539
+ },
3540
+ {
3541
+ "expression": "category",
3542
+ "isExpression": false,
3543
+ "asc": true,
3544
+ "nulls": "last"
3545
+ }
3546
+ ],
3547
+ "isUnique": false,
3548
+ "concurrently": false,
3549
+ "method": "btree",
3550
+ "with": {}
3551
+ },
3552
+ "reusable_block_public_category_idx": {
3553
+ "name": "reusable_block_public_category_idx",
3554
+ "columns": [
3555
+ {
3556
+ "expression": "is_public",
3557
+ "isExpression": false,
3558
+ "asc": true,
3559
+ "nulls": "last"
3560
+ },
3561
+ {
3562
+ "expression": "category",
3563
+ "isExpression": false,
3564
+ "asc": true,
3565
+ "nulls": "last"
3566
+ }
3567
+ ],
3568
+ "isUnique": false,
3569
+ "concurrently": false,
3570
+ "method": "btree",
3571
+ "with": {}
3572
+ }
3573
+ },
3574
+ "foreignKeys": {
3575
+ "reusable_block_organization_id_organization_id_fk": {
3576
+ "name": "reusable_block_organization_id_organization_id_fk",
3577
+ "tableFrom": "reusable_block",
3578
+ "tableTo": "organization",
3579
+ "columnsFrom": ["organization_id"],
3580
+ "columnsTo": ["id"],
3581
+ "onDelete": "cascade",
3582
+ "onUpdate": "no action"
3583
+ },
3584
+ "reusable_block_created_by_user_id_fk": {
3585
+ "name": "reusable_block_created_by_user_id_fk",
3586
+ "tableFrom": "reusable_block",
3587
+ "tableTo": "user",
3588
+ "columnsFrom": ["created_by"],
3589
+ "columnsTo": ["id"],
3590
+ "onDelete": "set null",
3591
+ "onUpdate": "no action"
3592
+ }
3593
+ },
3594
+ "compositePrimaryKeys": {},
3595
+ "uniqueConstraints": {},
3596
+ "policies": {},
3597
+ "checkConstraints": {},
3598
+ "isRLSEnabled": false
3599
+ },
3600
+ "public.template": {
3601
+ "name": "template",
3602
+ "schema": "",
3603
+ "columns": {
3604
+ "id": {
3605
+ "name": "id",
3606
+ "type": "text",
3607
+ "primaryKey": true,
3608
+ "notNull": true
3609
+ },
3610
+ "organization_id": {
3611
+ "name": "organization_id",
3612
+ "type": "text",
3613
+ "primaryKey": false,
3614
+ "notNull": true
3615
+ },
3616
+ "name": {
3617
+ "name": "name",
3618
+ "type": "text",
3619
+ "primaryKey": false,
3620
+ "notNull": true
3621
+ },
3622
+ "description": {
3623
+ "name": "description",
3624
+ "type": "text",
3625
+ "primaryKey": false,
3626
+ "notNull": false
3627
+ },
3628
+ "subject": {
3629
+ "name": "subject",
3630
+ "type": "text",
3631
+ "primaryKey": false,
3632
+ "notNull": false
3633
+ },
3634
+ "content": {
3635
+ "name": "content",
3636
+ "type": "jsonb",
3637
+ "primaryKey": false,
3638
+ "notNull": true
3639
+ },
3640
+ "compiled_html": {
3641
+ "name": "compiled_html",
3642
+ "type": "text",
3643
+ "primaryKey": false,
3644
+ "notNull": false
3645
+ },
3646
+ "compiled_text": {
3647
+ "name": "compiled_text",
3648
+ "type": "text",
3649
+ "primaryKey": false,
3650
+ "notNull": false
3651
+ },
3652
+ "variables": {
3653
+ "name": "variables",
3654
+ "type": "jsonb",
3655
+ "primaryKey": false,
3656
+ "notNull": false,
3657
+ "default": "'[]'::jsonb"
3658
+ },
3659
+ "test_data": {
3660
+ "name": "test_data",
3661
+ "type": "jsonb",
3662
+ "primaryKey": false,
3663
+ "notNull": false,
3664
+ "default": "'{}'::jsonb"
3665
+ },
3666
+ "room_id": {
3667
+ "name": "room_id",
3668
+ "type": "text",
3669
+ "primaryKey": false,
3670
+ "notNull": false
3671
+ },
3672
+ "is_collaborative": {
3673
+ "name": "is_collaborative",
3674
+ "type": "boolean",
3675
+ "primaryKey": false,
3676
+ "notNull": true,
3677
+ "default": false
3678
+ },
3679
+ "ai_generated": {
3680
+ "name": "ai_generated",
3681
+ "type": "boolean",
3682
+ "primaryKey": false,
3683
+ "notNull": true,
3684
+ "default": false
3685
+ },
3686
+ "ai_conversation_id": {
3687
+ "name": "ai_conversation_id",
3688
+ "type": "text",
3689
+ "primaryKey": false,
3690
+ "notNull": false
3691
+ },
3692
+ "ses_template_name": {
3693
+ "name": "ses_template_name",
3694
+ "type": "text",
3695
+ "primaryKey": false,
3696
+ "notNull": false
3697
+ },
3698
+ "published_at": {
3699
+ "name": "published_at",
3700
+ "type": "timestamp",
3701
+ "primaryKey": false,
3702
+ "notNull": false
3703
+ },
3704
+ "status": {
3705
+ "name": "status",
3706
+ "type": "template_status",
3707
+ "typeSchema": "public",
3708
+ "primaryKey": false,
3709
+ "notNull": true,
3710
+ "default": "'DRAFT'"
3711
+ },
3712
+ "created_at": {
3713
+ "name": "created_at",
3714
+ "type": "timestamp",
3715
+ "primaryKey": false,
3716
+ "notNull": true,
3717
+ "default": "now()"
3718
+ },
3719
+ "updated_at": {
3720
+ "name": "updated_at",
3721
+ "type": "timestamp",
3722
+ "primaryKey": false,
3723
+ "notNull": true,
3724
+ "default": "now()"
3725
+ },
3726
+ "created_by": {
3727
+ "name": "created_by",
3728
+ "type": "text",
3729
+ "primaryKey": false,
3730
+ "notNull": true
3731
+ },
3732
+ "last_edited_by": {
3733
+ "name": "last_edited_by",
3734
+ "type": "text",
3735
+ "primaryKey": false,
3736
+ "notNull": false
3737
+ }
3738
+ },
3739
+ "indexes": {
3740
+ "template_org_idx": {
3741
+ "name": "template_org_idx",
3742
+ "columns": [
3743
+ {
3744
+ "expression": "organization_id",
3745
+ "isExpression": false,
3746
+ "asc": true,
3747
+ "nulls": "last"
3748
+ }
3749
+ ],
3750
+ "isUnique": false,
3751
+ "concurrently": false,
3752
+ "method": "btree",
3753
+ "with": {}
3754
+ },
3755
+ "template_status_updated_at_idx": {
3756
+ "name": "template_status_updated_at_idx",
3757
+ "columns": [
3758
+ {
3759
+ "expression": "status",
3760
+ "isExpression": false,
3761
+ "asc": true,
3762
+ "nulls": "last"
3763
+ },
3764
+ {
3765
+ "expression": "updated_at",
3766
+ "isExpression": false,
3767
+ "asc": true,
3768
+ "nulls": "last"
3769
+ }
3770
+ ],
3771
+ "isUnique": false,
3772
+ "concurrently": false,
3773
+ "method": "btree",
3774
+ "with": {}
3775
+ },
3776
+ "template_created_by_idx": {
3777
+ "name": "template_created_by_idx",
3778
+ "columns": [
3779
+ {
3780
+ "expression": "created_by",
3781
+ "isExpression": false,
3782
+ "asc": true,
3783
+ "nulls": "last"
3784
+ }
3785
+ ],
3786
+ "isUnique": false,
3787
+ "concurrently": false,
3788
+ "method": "btree",
3789
+ "with": {}
3790
+ },
3791
+ "template_room_id_idx": {
3792
+ "name": "template_room_id_idx",
3793
+ "columns": [
3794
+ {
3795
+ "expression": "room_id",
3796
+ "isExpression": false,
3797
+ "asc": true,
3798
+ "nulls": "last"
3799
+ }
3800
+ ],
3801
+ "isUnique": true,
3802
+ "concurrently": false,
3803
+ "method": "btree",
3804
+ "with": {}
3805
+ }
3806
+ },
3807
+ "foreignKeys": {
3808
+ "template_organization_id_organization_id_fk": {
3809
+ "name": "template_organization_id_organization_id_fk",
3810
+ "tableFrom": "template",
3811
+ "tableTo": "organization",
3812
+ "columnsFrom": ["organization_id"],
3813
+ "columnsTo": ["id"],
3814
+ "onDelete": "cascade",
3815
+ "onUpdate": "no action"
3816
+ },
3817
+ "template_created_by_user_id_fk": {
3818
+ "name": "template_created_by_user_id_fk",
3819
+ "tableFrom": "template",
3820
+ "tableTo": "user",
3821
+ "columnsFrom": ["created_by"],
3822
+ "columnsTo": ["id"],
3823
+ "onDelete": "set null",
3824
+ "onUpdate": "no action"
3825
+ },
3826
+ "template_last_edited_by_user_id_fk": {
3827
+ "name": "template_last_edited_by_user_id_fk",
3828
+ "tableFrom": "template",
3829
+ "tableTo": "user",
3830
+ "columnsFrom": ["last_edited_by"],
3831
+ "columnsTo": ["id"],
3832
+ "onDelete": "set null",
3833
+ "onUpdate": "no action"
3834
+ }
3835
+ },
3836
+ "compositePrimaryKeys": {},
3837
+ "uniqueConstraints": {},
3838
+ "policies": {},
3839
+ "checkConstraints": {},
3840
+ "isRLSEnabled": false
3841
+ },
3842
+ "public.template_variable": {
3843
+ "name": "template_variable",
3844
+ "schema": "",
3845
+ "columns": {
3846
+ "id": {
3847
+ "name": "id",
3848
+ "type": "text",
3849
+ "primaryKey": true,
3850
+ "notNull": true
3851
+ },
3852
+ "organization_id": {
3853
+ "name": "organization_id",
3854
+ "type": "text",
3855
+ "primaryKey": false,
3856
+ "notNull": true
3857
+ },
3858
+ "name": {
3859
+ "name": "name",
3860
+ "type": "text",
3861
+ "primaryKey": false,
3862
+ "notNull": true
3863
+ },
3864
+ "label": {
3865
+ "name": "label",
3866
+ "type": "text",
3867
+ "primaryKey": false,
3868
+ "notNull": true
3869
+ },
3870
+ "type": {
3871
+ "name": "type",
3872
+ "type": "variable_type",
3873
+ "typeSchema": "public",
3874
+ "primaryKey": false,
3875
+ "notNull": true
3876
+ },
3877
+ "required": {
3878
+ "name": "required",
3879
+ "type": "boolean",
3880
+ "primaryKey": false,
3881
+ "notNull": true,
3882
+ "default": false
3883
+ },
3884
+ "fallback": {
3885
+ "name": "fallback",
3886
+ "type": "text",
3887
+ "primaryKey": false,
3888
+ "notNull": false
3889
+ },
3890
+ "validation": {
3891
+ "name": "validation",
3892
+ "type": "jsonb",
3893
+ "primaryKey": false,
3894
+ "notNull": false
3895
+ },
3896
+ "created_at": {
3897
+ "name": "created_at",
3898
+ "type": "timestamp",
3899
+ "primaryKey": false,
3900
+ "notNull": true,
3901
+ "default": "now()"
3902
+ },
3903
+ "updated_at": {
3904
+ "name": "updated_at",
3905
+ "type": "timestamp",
3906
+ "primaryKey": false,
3907
+ "notNull": true,
3908
+ "default": "now()"
3909
+ }
3910
+ },
3911
+ "indexes": {
3912
+ "template_variable_org_name_idx": {
3913
+ "name": "template_variable_org_name_idx",
3914
+ "columns": [
3915
+ {
3916
+ "expression": "organization_id",
3917
+ "isExpression": false,
3918
+ "asc": true,
3919
+ "nulls": "last"
3920
+ },
3921
+ {
3922
+ "expression": "name",
3923
+ "isExpression": false,
3924
+ "asc": true,
3925
+ "nulls": "last"
3926
+ }
3927
+ ],
3928
+ "isUnique": true,
3929
+ "concurrently": false,
3930
+ "method": "btree",
3931
+ "with": {}
3932
+ }
3933
+ },
3934
+ "foreignKeys": {
3935
+ "template_variable_organization_id_organization_id_fk": {
3936
+ "name": "template_variable_organization_id_organization_id_fk",
3937
+ "tableFrom": "template_variable",
3938
+ "tableTo": "organization",
3939
+ "columnsFrom": ["organization_id"],
3940
+ "columnsTo": ["id"],
3941
+ "onDelete": "cascade",
3942
+ "onUpdate": "no action"
3943
+ }
3944
+ },
3945
+ "compositePrimaryKeys": {},
3946
+ "uniqueConstraints": {},
3947
+ "policies": {},
3948
+ "checkConstraints": {},
3949
+ "isRLSEnabled": false
3950
+ },
3951
+ "public.template_version": {
3952
+ "name": "template_version",
3953
+ "schema": "",
3954
+ "columns": {
3955
+ "id": {
3956
+ "name": "id",
3957
+ "type": "text",
3958
+ "primaryKey": true,
3959
+ "notNull": true
3960
+ },
3961
+ "template_id": {
3962
+ "name": "template_id",
3963
+ "type": "text",
3964
+ "primaryKey": false,
3965
+ "notNull": true
3966
+ },
3967
+ "content": {
3968
+ "name": "content",
3969
+ "type": "jsonb",
3970
+ "primaryKey": false,
3971
+ "notNull": true
3972
+ },
3973
+ "version": {
3974
+ "name": "version",
3975
+ "type": "integer",
3976
+ "primaryKey": false,
3977
+ "notNull": true
3978
+ },
3979
+ "created_at": {
3980
+ "name": "created_at",
3981
+ "type": "timestamp",
3982
+ "primaryKey": false,
3983
+ "notNull": true,
3984
+ "default": "now()"
3985
+ },
3986
+ "created_by": {
3987
+ "name": "created_by",
3988
+ "type": "text",
3989
+ "primaryKey": false,
3990
+ "notNull": true
3991
+ },
3992
+ "change_note": {
3993
+ "name": "change_note",
3994
+ "type": "text",
3995
+ "primaryKey": false,
3996
+ "notNull": false
3997
+ }
3998
+ },
3999
+ "indexes": {
4000
+ "template_version_template_version_idx": {
4001
+ "name": "template_version_template_version_idx",
4002
+ "columns": [
4003
+ {
4004
+ "expression": "template_id",
4005
+ "isExpression": false,
4006
+ "asc": true,
4007
+ "nulls": "last"
4008
+ },
4009
+ {
4010
+ "expression": "version",
4011
+ "isExpression": false,
4012
+ "asc": true,
4013
+ "nulls": "last"
4014
+ }
4015
+ ],
4016
+ "isUnique": true,
4017
+ "concurrently": false,
4018
+ "method": "btree",
4019
+ "with": {}
4020
+ },
4021
+ "template_version_template_created_at_idx": {
4022
+ "name": "template_version_template_created_at_idx",
4023
+ "columns": [
4024
+ {
4025
+ "expression": "template_id",
4026
+ "isExpression": false,
4027
+ "asc": true,
4028
+ "nulls": "last"
4029
+ },
4030
+ {
4031
+ "expression": "created_at",
4032
+ "isExpression": false,
4033
+ "asc": true,
4034
+ "nulls": "last"
4035
+ }
4036
+ ],
4037
+ "isUnique": false,
4038
+ "concurrently": false,
4039
+ "method": "btree",
4040
+ "with": {}
4041
+ }
4042
+ },
4043
+ "foreignKeys": {
4044
+ "template_version_template_id_template_id_fk": {
4045
+ "name": "template_version_template_id_template_id_fk",
4046
+ "tableFrom": "template_version",
4047
+ "tableTo": "template",
4048
+ "columnsFrom": ["template_id"],
4049
+ "columnsTo": ["id"],
4050
+ "onDelete": "cascade",
4051
+ "onUpdate": "no action"
4052
+ },
4053
+ "template_version_created_by_user_id_fk": {
4054
+ "name": "template_version_created_by_user_id_fk",
4055
+ "tableFrom": "template_version",
4056
+ "tableTo": "user",
4057
+ "columnsFrom": ["created_by"],
4058
+ "columnsTo": ["id"],
4059
+ "onDelete": "set null",
4060
+ "onUpdate": "no action"
4061
+ }
4062
+ },
4063
+ "compositePrimaryKeys": {},
4064
+ "uniqueConstraints": {},
4065
+ "policies": {},
4066
+ "checkConstraints": {},
4067
+ "isRLSEnabled": false
4068
+ },
4069
+ "public.ai_usage_log": {
4070
+ "name": "ai_usage_log",
4071
+ "schema": "",
4072
+ "columns": {
4073
+ "id": {
4074
+ "name": "id",
4075
+ "type": "text",
4076
+ "primaryKey": true,
4077
+ "notNull": true
4078
+ },
4079
+ "organization_id": {
4080
+ "name": "organization_id",
4081
+ "type": "text",
4082
+ "primaryKey": false,
4083
+ "notNull": true
4084
+ },
4085
+ "user_id": {
4086
+ "name": "user_id",
4087
+ "type": "text",
4088
+ "primaryKey": false,
4089
+ "notNull": false
4090
+ },
4091
+ "period_key": {
4092
+ "name": "period_key",
4093
+ "type": "text",
4094
+ "primaryKey": false,
4095
+ "notNull": true
4096
+ },
4097
+ "feature_type": {
4098
+ "name": "feature_type",
4099
+ "type": "text",
4100
+ "primaryKey": false,
4101
+ "notNull": true,
4102
+ "default": "'ai_chat'"
4103
+ },
4104
+ "template_id": {
4105
+ "name": "template_id",
4106
+ "type": "text",
4107
+ "primaryKey": false,
4108
+ "notNull": false
4109
+ },
4110
+ "input_tokens": {
4111
+ "name": "input_tokens",
4112
+ "type": "integer",
4113
+ "primaryKey": false,
4114
+ "notNull": false
4115
+ },
4116
+ "output_tokens": {
4117
+ "name": "output_tokens",
4118
+ "type": "integer",
4119
+ "primaryKey": false,
4120
+ "notNull": false
4121
+ },
4122
+ "total_tokens": {
4123
+ "name": "total_tokens",
4124
+ "type": "integer",
4125
+ "primaryKey": false,
4126
+ "notNull": false
4127
+ },
4128
+ "model": {
4129
+ "name": "model",
4130
+ "type": "text",
4131
+ "primaryKey": false,
4132
+ "notNull": false
4133
+ },
4134
+ "duration_ms": {
4135
+ "name": "duration_ms",
4136
+ "type": "integer",
4137
+ "primaryKey": false,
4138
+ "notNull": false
4139
+ },
4140
+ "created_at": {
4141
+ "name": "created_at",
4142
+ "type": "timestamp",
4143
+ "primaryKey": false,
4144
+ "notNull": true,
4145
+ "default": "now()"
4146
+ }
4147
+ },
4148
+ "indexes": {
4149
+ "ai_usage_log_org_idx": {
4150
+ "name": "ai_usage_log_org_idx",
4151
+ "columns": [
4152
+ {
4153
+ "expression": "organization_id",
4154
+ "isExpression": false,
4155
+ "asc": true,
4156
+ "nulls": "last"
4157
+ }
4158
+ ],
4159
+ "isUnique": false,
4160
+ "concurrently": false,
4161
+ "method": "btree",
4162
+ "with": {}
4163
+ },
4164
+ "ai_usage_log_period_idx": {
4165
+ "name": "ai_usage_log_period_idx",
4166
+ "columns": [
4167
+ {
4168
+ "expression": "period_key",
4169
+ "isExpression": false,
4170
+ "asc": true,
4171
+ "nulls": "last"
4172
+ }
4173
+ ],
4174
+ "isUnique": false,
4175
+ "concurrently": false,
4176
+ "method": "btree",
4177
+ "with": {}
4178
+ },
4179
+ "ai_usage_log_org_period_idx": {
4180
+ "name": "ai_usage_log_org_period_idx",
4181
+ "columns": [
4182
+ {
4183
+ "expression": "organization_id",
4184
+ "isExpression": false,
4185
+ "asc": true,
4186
+ "nulls": "last"
4187
+ },
4188
+ {
4189
+ "expression": "period_key",
4190
+ "isExpression": false,
4191
+ "asc": true,
4192
+ "nulls": "last"
4193
+ }
4194
+ ],
4195
+ "isUnique": false,
4196
+ "concurrently": false,
4197
+ "method": "btree",
4198
+ "with": {}
4199
+ },
4200
+ "ai_usage_log_user_idx": {
4201
+ "name": "ai_usage_log_user_idx",
4202
+ "columns": [
4203
+ {
4204
+ "expression": "user_id",
4205
+ "isExpression": false,
4206
+ "asc": true,
4207
+ "nulls": "last"
4208
+ }
4209
+ ],
4210
+ "isUnique": false,
4211
+ "concurrently": false,
4212
+ "method": "btree",
4213
+ "with": {}
4214
+ },
4215
+ "ai_usage_log_created_idx": {
4216
+ "name": "ai_usage_log_created_idx",
4217
+ "columns": [
4218
+ {
4219
+ "expression": "created_at",
4220
+ "isExpression": false,
4221
+ "asc": true,
4222
+ "nulls": "last"
4223
+ }
4224
+ ],
4225
+ "isUnique": false,
4226
+ "concurrently": false,
4227
+ "method": "btree",
4228
+ "with": {}
4229
+ }
4230
+ },
4231
+ "foreignKeys": {
4232
+ "ai_usage_log_organization_id_organization_id_fk": {
4233
+ "name": "ai_usage_log_organization_id_organization_id_fk",
4234
+ "tableFrom": "ai_usage_log",
4235
+ "tableTo": "organization",
4236
+ "columnsFrom": ["organization_id"],
4237
+ "columnsTo": ["id"],
4238
+ "onDelete": "cascade",
4239
+ "onUpdate": "no action"
4240
+ },
4241
+ "ai_usage_log_user_id_user_id_fk": {
4242
+ "name": "ai_usage_log_user_id_user_id_fk",
4243
+ "tableFrom": "ai_usage_log",
4244
+ "tableTo": "user",
4245
+ "columnsFrom": ["user_id"],
4246
+ "columnsTo": ["id"],
4247
+ "onDelete": "set null",
4248
+ "onUpdate": "no action"
4249
+ }
4250
+ },
4251
+ "compositePrimaryKeys": {},
4252
+ "uniqueConstraints": {},
4253
+ "policies": {},
4254
+ "checkConstraints": {},
4255
+ "isRLSEnabled": false
4256
+ },
4257
+ "public.ai_usage_monthly": {
4258
+ "name": "ai_usage_monthly",
4259
+ "schema": "",
4260
+ "columns": {
4261
+ "id": {
4262
+ "name": "id",
4263
+ "type": "text",
4264
+ "primaryKey": true,
4265
+ "notNull": true
4266
+ },
4267
+ "organization_id": {
4268
+ "name": "organization_id",
4269
+ "type": "text",
4270
+ "primaryKey": false,
4271
+ "notNull": true
4272
+ },
4273
+ "period_key": {
4274
+ "name": "period_key",
4275
+ "type": "text",
4276
+ "primaryKey": false,
4277
+ "notNull": true
4278
+ },
4279
+ "message_count": {
4280
+ "name": "message_count",
4281
+ "type": "integer",
4282
+ "primaryKey": false,
4283
+ "notNull": true,
4284
+ "default": 0
4285
+ },
4286
+ "updated_at": {
4287
+ "name": "updated_at",
4288
+ "type": "timestamp",
4289
+ "primaryKey": false,
4290
+ "notNull": true,
4291
+ "default": "now()"
4292
+ }
4293
+ },
4294
+ "indexes": {
4295
+ "ai_usage_monthly_org_period_idx": {
4296
+ "name": "ai_usage_monthly_org_period_idx",
4297
+ "columns": [
4298
+ {
4299
+ "expression": "organization_id",
4300
+ "isExpression": false,
4301
+ "asc": true,
4302
+ "nulls": "last"
4303
+ },
4304
+ {
4305
+ "expression": "period_key",
4306
+ "isExpression": false,
4307
+ "asc": true,
4308
+ "nulls": "last"
4309
+ }
4310
+ ],
4311
+ "isUnique": true,
4312
+ "concurrently": false,
4313
+ "method": "btree",
4314
+ "with": {}
4315
+ },
4316
+ "ai_usage_monthly_period_idx": {
4317
+ "name": "ai_usage_monthly_period_idx",
4318
+ "columns": [
4319
+ {
4320
+ "expression": "period_key",
4321
+ "isExpression": false,
4322
+ "asc": true,
4323
+ "nulls": "last"
4324
+ }
4325
+ ],
4326
+ "isUnique": false,
4327
+ "concurrently": false,
4328
+ "method": "btree",
4329
+ "with": {}
4330
+ }
4331
+ },
4332
+ "foreignKeys": {
4333
+ "ai_usage_monthly_organization_id_organization_id_fk": {
4334
+ "name": "ai_usage_monthly_organization_id_organization_id_fk",
4335
+ "tableFrom": "ai_usage_monthly",
4336
+ "tableTo": "organization",
4337
+ "columnsFrom": ["organization_id"],
4338
+ "columnsTo": ["id"],
4339
+ "onDelete": "cascade",
4340
+ "onUpdate": "no action"
4341
+ }
4342
+ },
4343
+ "compositePrimaryKeys": {},
4344
+ "uniqueConstraints": {},
4345
+ "policies": {},
4346
+ "checkConstraints": {},
4347
+ "isRLSEnabled": false
4348
+ },
4349
+ "public.api_rate_limit_window": {
4350
+ "name": "api_rate_limit_window",
4351
+ "schema": "",
4352
+ "columns": {
4353
+ "id": {
4354
+ "name": "id",
4355
+ "type": "text",
4356
+ "primaryKey": true,
4357
+ "notNull": true
4358
+ },
4359
+ "organization_id": {
4360
+ "name": "organization_id",
4361
+ "type": "text",
4362
+ "primaryKey": false,
4363
+ "notNull": true
4364
+ },
4365
+ "minute_key": {
4366
+ "name": "minute_key",
4367
+ "type": "text",
4368
+ "primaryKey": false,
4369
+ "notNull": true
4370
+ },
4371
+ "request_count": {
4372
+ "name": "request_count",
4373
+ "type": "integer",
4374
+ "primaryKey": false,
4375
+ "notNull": true,
4376
+ "default": 0
4377
+ },
4378
+ "expires_at": {
4379
+ "name": "expires_at",
4380
+ "type": "timestamp",
4381
+ "primaryKey": false,
4382
+ "notNull": true
4383
+ }
4384
+ },
4385
+ "indexes": {
4386
+ "api_rate_limit_org_minute_idx": {
4387
+ "name": "api_rate_limit_org_minute_idx",
4388
+ "columns": [
4389
+ {
4390
+ "expression": "organization_id",
4391
+ "isExpression": false,
4392
+ "asc": true,
4393
+ "nulls": "last"
4394
+ },
4395
+ {
4396
+ "expression": "minute_key",
4397
+ "isExpression": false,
4398
+ "asc": true,
4399
+ "nulls": "last"
4400
+ }
4401
+ ],
4402
+ "isUnique": true,
4403
+ "concurrently": false,
4404
+ "method": "btree",
4405
+ "with": {}
4406
+ },
4407
+ "api_rate_limit_expires_idx": {
4408
+ "name": "api_rate_limit_expires_idx",
4409
+ "columns": [
4410
+ {
4411
+ "expression": "expires_at",
4412
+ "isExpression": false,
4413
+ "asc": true,
4414
+ "nulls": "last"
4415
+ }
4416
+ ],
4417
+ "isUnique": false,
4418
+ "concurrently": false,
4419
+ "method": "btree",
4420
+ "with": {}
4421
+ }
4422
+ },
4423
+ "foreignKeys": {
4424
+ "api_rate_limit_window_organization_id_organization_id_fk": {
4425
+ "name": "api_rate_limit_window_organization_id_organization_id_fk",
4426
+ "tableFrom": "api_rate_limit_window",
4427
+ "tableTo": "organization",
4428
+ "columnsFrom": ["organization_id"],
4429
+ "columnsTo": ["id"],
4430
+ "onDelete": "cascade",
4431
+ "onUpdate": "no action"
4432
+ }
4433
+ },
4434
+ "compositePrimaryKeys": {},
4435
+ "uniqueConstraints": {},
4436
+ "policies": {},
4437
+ "checkConstraints": {},
4438
+ "isRLSEnabled": false
4439
+ },
4440
+ "public.api_usage_daily": {
4441
+ "name": "api_usage_daily",
4442
+ "schema": "",
4443
+ "columns": {
4444
+ "id": {
4445
+ "name": "id",
4446
+ "type": "text",
4447
+ "primaryKey": true,
4448
+ "notNull": true
4449
+ },
4450
+ "organization_id": {
4451
+ "name": "organization_id",
4452
+ "type": "text",
4453
+ "primaryKey": false,
4454
+ "notNull": true
4455
+ },
4456
+ "date_key": {
4457
+ "name": "date_key",
4458
+ "type": "text",
4459
+ "primaryKey": false,
4460
+ "notNull": true
4461
+ },
4462
+ "request_count": {
4463
+ "name": "request_count",
4464
+ "type": "integer",
4465
+ "primaryKey": false,
4466
+ "notNull": true,
4467
+ "default": 0
4468
+ },
4469
+ "updated_at": {
4470
+ "name": "updated_at",
4471
+ "type": "timestamp",
4472
+ "primaryKey": false,
4473
+ "notNull": true,
4474
+ "default": "now()"
4475
+ }
4476
+ },
4477
+ "indexes": {
4478
+ "api_usage_daily_org_date_idx": {
4479
+ "name": "api_usage_daily_org_date_idx",
4480
+ "columns": [
4481
+ {
4482
+ "expression": "organization_id",
4483
+ "isExpression": false,
4484
+ "asc": true,
4485
+ "nulls": "last"
4486
+ },
4487
+ {
4488
+ "expression": "date_key",
4489
+ "isExpression": false,
4490
+ "asc": true,
4491
+ "nulls": "last"
4492
+ }
4493
+ ],
4494
+ "isUnique": true,
4495
+ "concurrently": false,
4496
+ "method": "btree",
4497
+ "with": {}
4498
+ },
4499
+ "api_usage_daily_date_idx": {
4500
+ "name": "api_usage_daily_date_idx",
4501
+ "columns": [
4502
+ {
4503
+ "expression": "date_key",
4504
+ "isExpression": false,
4505
+ "asc": true,
4506
+ "nulls": "last"
4507
+ }
4508
+ ],
4509
+ "isUnique": false,
4510
+ "concurrently": false,
4511
+ "method": "btree",
4512
+ "with": {}
4513
+ }
4514
+ },
4515
+ "foreignKeys": {
4516
+ "api_usage_daily_organization_id_organization_id_fk": {
4517
+ "name": "api_usage_daily_organization_id_organization_id_fk",
4518
+ "tableFrom": "api_usage_daily",
4519
+ "tableTo": "organization",
4520
+ "columnsFrom": ["organization_id"],
4521
+ "columnsTo": ["id"],
4522
+ "onDelete": "cascade",
4523
+ "onUpdate": "no action"
4524
+ }
4525
+ },
4526
+ "compositePrimaryKeys": {},
4527
+ "uniqueConstraints": {},
4528
+ "policies": {},
4529
+ "checkConstraints": {},
4530
+ "isRLSEnabled": false
4531
+ },
4532
+ "public.waitlist": {
4533
+ "name": "waitlist",
4534
+ "schema": "",
4535
+ "columns": {
4536
+ "id": {
4537
+ "name": "id",
4538
+ "type": "text",
4539
+ "primaryKey": true,
4540
+ "notNull": true
4541
+ },
4542
+ "email": {
4543
+ "name": "email",
4544
+ "type": "text",
4545
+ "primaryKey": false,
4546
+ "notNull": true
4547
+ },
4548
+ "email_hash": {
4549
+ "name": "email_hash",
4550
+ "type": "text",
4551
+ "primaryKey": false,
4552
+ "notNull": true
4553
+ },
4554
+ "product": {
4555
+ "name": "product",
4556
+ "type": "text",
4557
+ "primaryKey": false,
4558
+ "notNull": true
4559
+ },
4560
+ "source": {
4561
+ "name": "source",
4562
+ "type": "text",
4563
+ "primaryKey": false,
4564
+ "notNull": false
4565
+ },
4566
+ "referrer": {
4567
+ "name": "referrer",
4568
+ "type": "text",
4569
+ "primaryKey": false,
4570
+ "notNull": false
4571
+ },
4572
+ "created_at": {
4573
+ "name": "created_at",
4574
+ "type": "timestamp",
4575
+ "primaryKey": false,
4576
+ "notNull": true,
4577
+ "default": "now()"
4578
+ }
4579
+ },
4580
+ "indexes": {
4581
+ "waitlist_email_product_idx": {
4582
+ "name": "waitlist_email_product_idx",
4583
+ "columns": [
4584
+ {
4585
+ "expression": "email_hash",
4586
+ "isExpression": false,
4587
+ "asc": true,
4588
+ "nulls": "last"
4589
+ },
4590
+ {
4591
+ "expression": "product",
4592
+ "isExpression": false,
4593
+ "asc": true,
4594
+ "nulls": "last"
4595
+ }
4596
+ ],
4597
+ "isUnique": true,
4598
+ "concurrently": false,
4599
+ "method": "btree",
4600
+ "with": {}
4601
+ },
4602
+ "waitlist_product_idx": {
4603
+ "name": "waitlist_product_idx",
4604
+ "columns": [
4605
+ {
4606
+ "expression": "product",
4607
+ "isExpression": false,
4608
+ "asc": true,
4609
+ "nulls": "last"
4610
+ }
4611
+ ],
4612
+ "isUnique": false,
4613
+ "concurrently": false,
4614
+ "method": "btree",
4615
+ "with": {}
4616
+ },
4617
+ "waitlist_created_at_idx": {
4618
+ "name": "waitlist_created_at_idx",
4619
+ "columns": [
4620
+ {
4621
+ "expression": "created_at",
4622
+ "isExpression": false,
4623
+ "asc": true,
4624
+ "nulls": "last"
4625
+ }
4626
+ ],
4627
+ "isUnique": false,
4628
+ "concurrently": false,
4629
+ "method": "btree",
4630
+ "with": {}
4631
+ }
4632
+ },
4633
+ "foreignKeys": {},
4634
+ "compositePrimaryKeys": {},
4635
+ "uniqueConstraints": {},
4636
+ "policies": {},
4637
+ "checkConstraints": {},
4638
+ "isRLSEnabled": false
4639
+ }
4640
+ },
4641
+ "enums": {
4642
+ "public.batch_send_status": {
4643
+ "name": "batch_send_status",
4644
+ "schema": "public",
4645
+ "values": [
4646
+ "draft",
4647
+ "scheduled",
4648
+ "queued",
4649
+ "processing",
4650
+ "completed",
4651
+ "failed",
4652
+ "cancelled"
4653
+ ]
4654
+ },
4655
+ "public.message_send_status": {
4656
+ "name": "message_send_status",
4657
+ "schema": "public",
4658
+ "values": [
4659
+ "pending",
4660
+ "queued",
4661
+ "sent",
4662
+ "delivered",
4663
+ "opened",
4664
+ "clicked",
4665
+ "bounced",
4666
+ "complained",
4667
+ "failed",
4668
+ "opted_out"
4669
+ ]
4670
+ },
4671
+ "public.message_source_type": {
4672
+ "name": "message_source_type",
4673
+ "schema": "public",
4674
+ "values": ["transactional", "batch", "campaign", "workflow"]
4675
+ },
4676
+ "public.template_status": {
4677
+ "name": "template_status",
4678
+ "schema": "public",
4679
+ "values": ["DRAFT", "PUBLISHED", "ARCHIVED"]
4680
+ },
4681
+ "public.variable_type": {
4682
+ "name": "variable_type",
4683
+ "schema": "public",
4684
+ "values": ["TEXT", "NUMBER", "BOOLEAN", "DATE", "URL", "EMAIL"]
4685
+ }
4686
+ },
4687
+ "schemas": {},
4688
+ "sequences": {},
4689
+ "roles": {},
4690
+ "policies": {},
4691
+ "views": {},
4692
+ "_meta": {
4693
+ "columns": {},
4694
+ "schemas": {},
4695
+ "tables": {}
4696
+ }
4697
+ }