@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,4821 @@
1
+ {
2
+ "id": "1a1e4b8e-01ac-4bae-ab59-c6e7f6f18112",
3
+ "prevId": "946a250d-f7bf-49d8-9def-9a2064faa185",
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
+ "first_name": {
2494
+ "name": "first_name",
2495
+ "type": "text",
2496
+ "primaryKey": false,
2497
+ "notNull": false
2498
+ },
2499
+ "last_name": {
2500
+ "name": "last_name",
2501
+ "type": "text",
2502
+ "primaryKey": false,
2503
+ "notNull": false
2504
+ },
2505
+ "company": {
2506
+ "name": "company",
2507
+ "type": "text",
2508
+ "primaryKey": false,
2509
+ "notNull": false
2510
+ },
2511
+ "job_title": {
2512
+ "name": "job_title",
2513
+ "type": "text",
2514
+ "primaryKey": false,
2515
+ "notNull": false
2516
+ },
2517
+ "properties": {
2518
+ "name": "properties",
2519
+ "type": "json",
2520
+ "primaryKey": false,
2521
+ "notNull": true,
2522
+ "default": "'{}'::json"
2523
+ },
2524
+ "last_activity_at": {
2525
+ "name": "last_activity_at",
2526
+ "type": "timestamp",
2527
+ "primaryKey": false,
2528
+ "notNull": false
2529
+ },
2530
+ "created_at": {
2531
+ "name": "created_at",
2532
+ "type": "timestamp",
2533
+ "primaryKey": false,
2534
+ "notNull": true,
2535
+ "default": "now()"
2536
+ },
2537
+ "updated_at": {
2538
+ "name": "updated_at",
2539
+ "type": "timestamp",
2540
+ "primaryKey": false,
2541
+ "notNull": true,
2542
+ "default": "now()"
2543
+ },
2544
+ "created_by": {
2545
+ "name": "created_by",
2546
+ "type": "text",
2547
+ "primaryKey": false,
2548
+ "notNull": false
2549
+ },
2550
+ "status": {
2551
+ "name": "status",
2552
+ "type": "text",
2553
+ "primaryKey": false,
2554
+ "notNull": true,
2555
+ "default": "'active'"
2556
+ },
2557
+ "confirmed_at": {
2558
+ "name": "confirmed_at",
2559
+ "type": "timestamp",
2560
+ "primaryKey": false,
2561
+ "notNull": false
2562
+ },
2563
+ "unsubscribed_at": {
2564
+ "name": "unsubscribed_at",
2565
+ "type": "timestamp",
2566
+ "primaryKey": false,
2567
+ "notNull": false
2568
+ },
2569
+ "bounced_at": {
2570
+ "name": "bounced_at",
2571
+ "type": "timestamp",
2572
+ "primaryKey": false,
2573
+ "notNull": false
2574
+ },
2575
+ "complained_at": {
2576
+ "name": "complained_at",
2577
+ "type": "timestamp",
2578
+ "primaryKey": false,
2579
+ "notNull": false
2580
+ }
2581
+ },
2582
+ "indexes": {
2583
+ "contact_org_idx": {
2584
+ "name": "contact_org_idx",
2585
+ "columns": [
2586
+ {
2587
+ "expression": "organization_id",
2588
+ "isExpression": false,
2589
+ "asc": true,
2590
+ "nulls": "last"
2591
+ }
2592
+ ],
2593
+ "isUnique": false,
2594
+ "concurrently": false,
2595
+ "method": "btree",
2596
+ "with": {}
2597
+ },
2598
+ "contact_email_idx": {
2599
+ "name": "contact_email_idx",
2600
+ "columns": [
2601
+ {
2602
+ "expression": "email",
2603
+ "isExpression": false,
2604
+ "asc": true,
2605
+ "nulls": "last"
2606
+ }
2607
+ ],
2608
+ "isUnique": false,
2609
+ "concurrently": false,
2610
+ "method": "btree",
2611
+ "with": {}
2612
+ },
2613
+ "contact_unique_org_email_idx": {
2614
+ "name": "contact_unique_org_email_idx",
2615
+ "columns": [
2616
+ {
2617
+ "expression": "organization_id",
2618
+ "isExpression": false,
2619
+ "asc": true,
2620
+ "nulls": "last"
2621
+ },
2622
+ {
2623
+ "expression": "email_hash",
2624
+ "isExpression": false,
2625
+ "asc": true,
2626
+ "nulls": "last"
2627
+ }
2628
+ ],
2629
+ "isUnique": true,
2630
+ "where": "email_hash IS NOT NULL",
2631
+ "concurrently": false,
2632
+ "method": "btree",
2633
+ "with": {}
2634
+ },
2635
+ "contact_email_status_idx": {
2636
+ "name": "contact_email_status_idx",
2637
+ "columns": [
2638
+ {
2639
+ "expression": "organization_id",
2640
+ "isExpression": false,
2641
+ "asc": true,
2642
+ "nulls": "last"
2643
+ },
2644
+ {
2645
+ "expression": "email_status",
2646
+ "isExpression": false,
2647
+ "asc": true,
2648
+ "nulls": "last"
2649
+ }
2650
+ ],
2651
+ "isUnique": false,
2652
+ "concurrently": false,
2653
+ "method": "btree",
2654
+ "with": {}
2655
+ },
2656
+ "contact_phone_idx": {
2657
+ "name": "contact_phone_idx",
2658
+ "columns": [
2659
+ {
2660
+ "expression": "phone",
2661
+ "isExpression": false,
2662
+ "asc": true,
2663
+ "nulls": "last"
2664
+ }
2665
+ ],
2666
+ "isUnique": false,
2667
+ "concurrently": false,
2668
+ "method": "btree",
2669
+ "with": {}
2670
+ },
2671
+ "contact_unique_org_phone_idx": {
2672
+ "name": "contact_unique_org_phone_idx",
2673
+ "columns": [
2674
+ {
2675
+ "expression": "organization_id",
2676
+ "isExpression": false,
2677
+ "asc": true,
2678
+ "nulls": "last"
2679
+ },
2680
+ {
2681
+ "expression": "phone_hash",
2682
+ "isExpression": false,
2683
+ "asc": true,
2684
+ "nulls": "last"
2685
+ }
2686
+ ],
2687
+ "isUnique": true,
2688
+ "where": "phone_hash IS NOT NULL",
2689
+ "concurrently": false,
2690
+ "method": "btree",
2691
+ "with": {}
2692
+ },
2693
+ "contact_sms_status_idx": {
2694
+ "name": "contact_sms_status_idx",
2695
+ "columns": [
2696
+ {
2697
+ "expression": "organization_id",
2698
+ "isExpression": false,
2699
+ "asc": true,
2700
+ "nulls": "last"
2701
+ },
2702
+ {
2703
+ "expression": "sms_status",
2704
+ "isExpression": false,
2705
+ "asc": true,
2706
+ "nulls": "last"
2707
+ }
2708
+ ],
2709
+ "isUnique": false,
2710
+ "concurrently": false,
2711
+ "method": "btree",
2712
+ "with": {}
2713
+ },
2714
+ "contact_status_idx": {
2715
+ "name": "contact_status_idx",
2716
+ "columns": [
2717
+ {
2718
+ "expression": "organization_id",
2719
+ "isExpression": false,
2720
+ "asc": true,
2721
+ "nulls": "last"
2722
+ },
2723
+ {
2724
+ "expression": "status",
2725
+ "isExpression": false,
2726
+ "asc": true,
2727
+ "nulls": "last"
2728
+ }
2729
+ ],
2730
+ "isUnique": false,
2731
+ "concurrently": false,
2732
+ "method": "btree",
2733
+ "with": {}
2734
+ }
2735
+ },
2736
+ "foreignKeys": {
2737
+ "contact_organization_id_organization_id_fk": {
2738
+ "name": "contact_organization_id_organization_id_fk",
2739
+ "tableFrom": "contact",
2740
+ "tableTo": "organization",
2741
+ "columnsFrom": ["organization_id"],
2742
+ "columnsTo": ["id"],
2743
+ "onDelete": "cascade",
2744
+ "onUpdate": "no action"
2745
+ },
2746
+ "contact_created_by_user_id_fk": {
2747
+ "name": "contact_created_by_user_id_fk",
2748
+ "tableFrom": "contact",
2749
+ "tableTo": "user",
2750
+ "columnsFrom": ["created_by"],
2751
+ "columnsTo": ["id"],
2752
+ "onDelete": "no action",
2753
+ "onUpdate": "no action"
2754
+ }
2755
+ },
2756
+ "compositePrimaryKeys": {},
2757
+ "uniqueConstraints": {},
2758
+ "policies": {},
2759
+ "checkConstraints": {},
2760
+ "isRLSEnabled": false
2761
+ },
2762
+ "public.contact_topic": {
2763
+ "name": "contact_topic",
2764
+ "schema": "",
2765
+ "columns": {
2766
+ "contact_id": {
2767
+ "name": "contact_id",
2768
+ "type": "text",
2769
+ "primaryKey": false,
2770
+ "notNull": true
2771
+ },
2772
+ "topic_id": {
2773
+ "name": "topic_id",
2774
+ "type": "text",
2775
+ "primaryKey": false,
2776
+ "notNull": true
2777
+ },
2778
+ "status": {
2779
+ "name": "status",
2780
+ "type": "text",
2781
+ "primaryKey": false,
2782
+ "notNull": true,
2783
+ "default": "'subscribed'"
2784
+ },
2785
+ "subscribed_at": {
2786
+ "name": "subscribed_at",
2787
+ "type": "timestamp",
2788
+ "primaryKey": false,
2789
+ "notNull": false,
2790
+ "default": "now()"
2791
+ },
2792
+ "unsubscribed_at": {
2793
+ "name": "unsubscribed_at",
2794
+ "type": "timestamp",
2795
+ "primaryKey": false,
2796
+ "notNull": false
2797
+ },
2798
+ "confirmed_at": {
2799
+ "name": "confirmed_at",
2800
+ "type": "timestamp",
2801
+ "primaryKey": false,
2802
+ "notNull": false
2803
+ }
2804
+ },
2805
+ "indexes": {
2806
+ "contact_topic_topic_idx": {
2807
+ "name": "contact_topic_topic_idx",
2808
+ "columns": [
2809
+ {
2810
+ "expression": "topic_id",
2811
+ "isExpression": false,
2812
+ "asc": true,
2813
+ "nulls": "last"
2814
+ }
2815
+ ],
2816
+ "isUnique": false,
2817
+ "concurrently": false,
2818
+ "method": "btree",
2819
+ "with": {}
2820
+ },
2821
+ "contact_topic_status_idx": {
2822
+ "name": "contact_topic_status_idx",
2823
+ "columns": [
2824
+ {
2825
+ "expression": "topic_id",
2826
+ "isExpression": false,
2827
+ "asc": true,
2828
+ "nulls": "last"
2829
+ },
2830
+ {
2831
+ "expression": "status",
2832
+ "isExpression": false,
2833
+ "asc": true,
2834
+ "nulls": "last"
2835
+ }
2836
+ ],
2837
+ "isUnique": false,
2838
+ "concurrently": false,
2839
+ "method": "btree",
2840
+ "with": {}
2841
+ }
2842
+ },
2843
+ "foreignKeys": {
2844
+ "contact_topic_contact_id_contact_id_fk": {
2845
+ "name": "contact_topic_contact_id_contact_id_fk",
2846
+ "tableFrom": "contact_topic",
2847
+ "tableTo": "contact",
2848
+ "columnsFrom": ["contact_id"],
2849
+ "columnsTo": ["id"],
2850
+ "onDelete": "cascade",
2851
+ "onUpdate": "no action"
2852
+ },
2853
+ "contact_topic_topic_id_topic_id_fk": {
2854
+ "name": "contact_topic_topic_id_topic_id_fk",
2855
+ "tableFrom": "contact_topic",
2856
+ "tableTo": "topic",
2857
+ "columnsFrom": ["topic_id"],
2858
+ "columnsTo": ["id"],
2859
+ "onDelete": "cascade",
2860
+ "onUpdate": "no action"
2861
+ }
2862
+ },
2863
+ "compositePrimaryKeys": {
2864
+ "contact_topic_contact_id_topic_id_pk": {
2865
+ "name": "contact_topic_contact_id_topic_id_pk",
2866
+ "columns": ["contact_id", "topic_id"]
2867
+ }
2868
+ },
2869
+ "uniqueConstraints": {},
2870
+ "policies": {},
2871
+ "checkConstraints": {},
2872
+ "isRLSEnabled": false
2873
+ },
2874
+ "public.topic": {
2875
+ "name": "topic",
2876
+ "schema": "",
2877
+ "columns": {
2878
+ "id": {
2879
+ "name": "id",
2880
+ "type": "text",
2881
+ "primaryKey": true,
2882
+ "notNull": true
2883
+ },
2884
+ "organization_id": {
2885
+ "name": "organization_id",
2886
+ "type": "text",
2887
+ "primaryKey": false,
2888
+ "notNull": true
2889
+ },
2890
+ "name": {
2891
+ "name": "name",
2892
+ "type": "text",
2893
+ "primaryKey": false,
2894
+ "notNull": true
2895
+ },
2896
+ "slug": {
2897
+ "name": "slug",
2898
+ "type": "text",
2899
+ "primaryKey": false,
2900
+ "notNull": true
2901
+ },
2902
+ "description": {
2903
+ "name": "description",
2904
+ "type": "text",
2905
+ "primaryKey": false,
2906
+ "notNull": false
2907
+ },
2908
+ "public": {
2909
+ "name": "public",
2910
+ "type": "boolean",
2911
+ "primaryKey": false,
2912
+ "notNull": true,
2913
+ "default": true
2914
+ },
2915
+ "double_opt_in": {
2916
+ "name": "double_opt_in",
2917
+ "type": "boolean",
2918
+ "primaryKey": false,
2919
+ "notNull": true,
2920
+ "default": false
2921
+ },
2922
+ "created_at": {
2923
+ "name": "created_at",
2924
+ "type": "timestamp",
2925
+ "primaryKey": false,
2926
+ "notNull": true,
2927
+ "default": "now()"
2928
+ },
2929
+ "updated_at": {
2930
+ "name": "updated_at",
2931
+ "type": "timestamp",
2932
+ "primaryKey": false,
2933
+ "notNull": true,
2934
+ "default": "now()"
2935
+ },
2936
+ "created_by": {
2937
+ "name": "created_by",
2938
+ "type": "text",
2939
+ "primaryKey": false,
2940
+ "notNull": false
2941
+ }
2942
+ },
2943
+ "indexes": {
2944
+ "topic_org_idx": {
2945
+ "name": "topic_org_idx",
2946
+ "columns": [
2947
+ {
2948
+ "expression": "organization_id",
2949
+ "isExpression": false,
2950
+ "asc": true,
2951
+ "nulls": "last"
2952
+ }
2953
+ ],
2954
+ "isUnique": false,
2955
+ "concurrently": false,
2956
+ "method": "btree",
2957
+ "with": {}
2958
+ },
2959
+ "topic_unique_org_slug_idx": {
2960
+ "name": "topic_unique_org_slug_idx",
2961
+ "columns": [
2962
+ {
2963
+ "expression": "organization_id",
2964
+ "isExpression": false,
2965
+ "asc": true,
2966
+ "nulls": "last"
2967
+ },
2968
+ {
2969
+ "expression": "slug",
2970
+ "isExpression": false,
2971
+ "asc": true,
2972
+ "nulls": "last"
2973
+ }
2974
+ ],
2975
+ "isUnique": true,
2976
+ "concurrently": false,
2977
+ "method": "btree",
2978
+ "with": {}
2979
+ }
2980
+ },
2981
+ "foreignKeys": {
2982
+ "topic_organization_id_organization_id_fk": {
2983
+ "name": "topic_organization_id_organization_id_fk",
2984
+ "tableFrom": "topic",
2985
+ "tableTo": "organization",
2986
+ "columnsFrom": ["organization_id"],
2987
+ "columnsTo": ["id"],
2988
+ "onDelete": "cascade",
2989
+ "onUpdate": "no action"
2990
+ },
2991
+ "topic_created_by_user_id_fk": {
2992
+ "name": "topic_created_by_user_id_fk",
2993
+ "tableFrom": "topic",
2994
+ "tableTo": "user",
2995
+ "columnsFrom": ["created_by"],
2996
+ "columnsTo": ["id"],
2997
+ "onDelete": "no action",
2998
+ "onUpdate": "no action"
2999
+ }
3000
+ },
3001
+ "compositePrimaryKeys": {},
3002
+ "uniqueConstraints": {},
3003
+ "policies": {},
3004
+ "checkConstraints": {},
3005
+ "isRLSEnabled": false
3006
+ },
3007
+ "public.topic_settings": {
3008
+ "name": "topic_settings",
3009
+ "schema": "",
3010
+ "columns": {
3011
+ "organization_id": {
3012
+ "name": "organization_id",
3013
+ "type": "text",
3014
+ "primaryKey": true,
3015
+ "notNull": true
3016
+ },
3017
+ "confirmation_from_name": {
3018
+ "name": "confirmation_from_name",
3019
+ "type": "text",
3020
+ "primaryKey": false,
3021
+ "notNull": false
3022
+ },
3023
+ "confirmation_from_email": {
3024
+ "name": "confirmation_from_email",
3025
+ "type": "text",
3026
+ "primaryKey": false,
3027
+ "notNull": false
3028
+ },
3029
+ "confirmation_reply_to_email": {
3030
+ "name": "confirmation_reply_to_email",
3031
+ "type": "text",
3032
+ "primaryKey": false,
3033
+ "notNull": false
3034
+ },
3035
+ "confirmation_template_id": {
3036
+ "name": "confirmation_template_id",
3037
+ "type": "text",
3038
+ "primaryKey": false,
3039
+ "notNull": false
3040
+ },
3041
+ "preference_center_title": {
3042
+ "name": "preference_center_title",
3043
+ "type": "text",
3044
+ "primaryKey": false,
3045
+ "notNull": false
3046
+ },
3047
+ "preference_center_description": {
3048
+ "name": "preference_center_description",
3049
+ "type": "text",
3050
+ "primaryKey": false,
3051
+ "notNull": false
3052
+ },
3053
+ "updated_at": {
3054
+ "name": "updated_at",
3055
+ "type": "timestamp",
3056
+ "primaryKey": false,
3057
+ "notNull": true,
3058
+ "default": "now()"
3059
+ }
3060
+ },
3061
+ "indexes": {},
3062
+ "foreignKeys": {
3063
+ "topic_settings_organization_id_organization_id_fk": {
3064
+ "name": "topic_settings_organization_id_organization_id_fk",
3065
+ "tableFrom": "topic_settings",
3066
+ "tableTo": "organization",
3067
+ "columnsFrom": ["organization_id"],
3068
+ "columnsTo": ["id"],
3069
+ "onDelete": "cascade",
3070
+ "onUpdate": "no action"
3071
+ },
3072
+ "topic_settings_confirmation_template_id_template_id_fk": {
3073
+ "name": "topic_settings_confirmation_template_id_template_id_fk",
3074
+ "tableFrom": "topic_settings",
3075
+ "tableTo": "template",
3076
+ "columnsFrom": ["confirmation_template_id"],
3077
+ "columnsTo": ["id"],
3078
+ "onDelete": "set null",
3079
+ "onUpdate": "no action"
3080
+ }
3081
+ },
3082
+ "compositePrimaryKeys": {},
3083
+ "uniqueConstraints": {},
3084
+ "policies": {},
3085
+ "checkConstraints": {},
3086
+ "isRLSEnabled": false
3087
+ },
3088
+ "public.segment": {
3089
+ "name": "segment",
3090
+ "schema": "",
3091
+ "columns": {
3092
+ "id": {
3093
+ "name": "id",
3094
+ "type": "text",
3095
+ "primaryKey": true,
3096
+ "notNull": true
3097
+ },
3098
+ "organization_id": {
3099
+ "name": "organization_id",
3100
+ "type": "text",
3101
+ "primaryKey": false,
3102
+ "notNull": true
3103
+ },
3104
+ "name": {
3105
+ "name": "name",
3106
+ "type": "text",
3107
+ "primaryKey": false,
3108
+ "notNull": true
3109
+ },
3110
+ "description": {
3111
+ "name": "description",
3112
+ "type": "text",
3113
+ "primaryKey": false,
3114
+ "notNull": false
3115
+ },
3116
+ "condition": {
3117
+ "name": "condition",
3118
+ "type": "json",
3119
+ "primaryKey": false,
3120
+ "notNull": true
3121
+ },
3122
+ "track_membership": {
3123
+ "name": "track_membership",
3124
+ "type": "boolean",
3125
+ "primaryKey": false,
3126
+ "notNull": true,
3127
+ "default": false
3128
+ },
3129
+ "member_count": {
3130
+ "name": "member_count",
3131
+ "type": "integer",
3132
+ "primaryKey": false,
3133
+ "notNull": true,
3134
+ "default": 0
3135
+ },
3136
+ "last_computed_at": {
3137
+ "name": "last_computed_at",
3138
+ "type": "timestamp",
3139
+ "primaryKey": false,
3140
+ "notNull": false
3141
+ },
3142
+ "created_by": {
3143
+ "name": "created_by",
3144
+ "type": "text",
3145
+ "primaryKey": false,
3146
+ "notNull": false
3147
+ },
3148
+ "created_at": {
3149
+ "name": "created_at",
3150
+ "type": "timestamp",
3151
+ "primaryKey": false,
3152
+ "notNull": true,
3153
+ "default": "now()"
3154
+ },
3155
+ "updated_at": {
3156
+ "name": "updated_at",
3157
+ "type": "timestamp",
3158
+ "primaryKey": false,
3159
+ "notNull": true,
3160
+ "default": "now()"
3161
+ }
3162
+ },
3163
+ "indexes": {
3164
+ "segment_org_idx": {
3165
+ "name": "segment_org_idx",
3166
+ "columns": [
3167
+ {
3168
+ "expression": "organization_id",
3169
+ "isExpression": false,
3170
+ "asc": true,
3171
+ "nulls": "last"
3172
+ }
3173
+ ],
3174
+ "isUnique": false,
3175
+ "concurrently": false,
3176
+ "method": "btree",
3177
+ "with": {}
3178
+ },
3179
+ "segment_name_idx": {
3180
+ "name": "segment_name_idx",
3181
+ "columns": [
3182
+ {
3183
+ "expression": "organization_id",
3184
+ "isExpression": false,
3185
+ "asc": true,
3186
+ "nulls": "last"
3187
+ },
3188
+ {
3189
+ "expression": "name",
3190
+ "isExpression": false,
3191
+ "asc": true,
3192
+ "nulls": "last"
3193
+ }
3194
+ ],
3195
+ "isUnique": false,
3196
+ "concurrently": false,
3197
+ "method": "btree",
3198
+ "with": {}
3199
+ }
3200
+ },
3201
+ "foreignKeys": {
3202
+ "segment_organization_id_organization_id_fk": {
3203
+ "name": "segment_organization_id_organization_id_fk",
3204
+ "tableFrom": "segment",
3205
+ "tableTo": "organization",
3206
+ "columnsFrom": ["organization_id"],
3207
+ "columnsTo": ["id"],
3208
+ "onDelete": "cascade",
3209
+ "onUpdate": "no action"
3210
+ },
3211
+ "segment_created_by_user_id_fk": {
3212
+ "name": "segment_created_by_user_id_fk",
3213
+ "tableFrom": "segment",
3214
+ "tableTo": "user",
3215
+ "columnsFrom": ["created_by"],
3216
+ "columnsTo": ["id"],
3217
+ "onDelete": "no action",
3218
+ "onUpdate": "no action"
3219
+ }
3220
+ },
3221
+ "compositePrimaryKeys": {},
3222
+ "uniqueConstraints": {},
3223
+ "policies": {},
3224
+ "checkConstraints": {},
3225
+ "isRLSEnabled": false
3226
+ },
3227
+ "public.ai_conversation": {
3228
+ "name": "ai_conversation",
3229
+ "schema": "",
3230
+ "columns": {
3231
+ "id": {
3232
+ "name": "id",
3233
+ "type": "text",
3234
+ "primaryKey": true,
3235
+ "notNull": true
3236
+ },
3237
+ "organization_id": {
3238
+ "name": "organization_id",
3239
+ "type": "text",
3240
+ "primaryKey": false,
3241
+ "notNull": true
3242
+ },
3243
+ "template_id": {
3244
+ "name": "template_id",
3245
+ "type": "text",
3246
+ "primaryKey": false,
3247
+ "notNull": false
3248
+ },
3249
+ "messages": {
3250
+ "name": "messages",
3251
+ "type": "jsonb",
3252
+ "primaryKey": false,
3253
+ "notNull": false,
3254
+ "default": "'[]'::jsonb"
3255
+ },
3256
+ "total_tokens": {
3257
+ "name": "total_tokens",
3258
+ "type": "integer",
3259
+ "primaryKey": false,
3260
+ "notNull": true,
3261
+ "default": 0
3262
+ },
3263
+ "created_at": {
3264
+ "name": "created_at",
3265
+ "type": "timestamp",
3266
+ "primaryKey": false,
3267
+ "notNull": true,
3268
+ "default": "now()"
3269
+ },
3270
+ "updated_at": {
3271
+ "name": "updated_at",
3272
+ "type": "timestamp",
3273
+ "primaryKey": false,
3274
+ "notNull": true,
3275
+ "default": "now()"
3276
+ },
3277
+ "created_by": {
3278
+ "name": "created_by",
3279
+ "type": "text",
3280
+ "primaryKey": false,
3281
+ "notNull": true
3282
+ }
3283
+ },
3284
+ "indexes": {
3285
+ "ai_conversation_org_idx": {
3286
+ "name": "ai_conversation_org_idx",
3287
+ "columns": [
3288
+ {
3289
+ "expression": "organization_id",
3290
+ "isExpression": false,
3291
+ "asc": true,
3292
+ "nulls": "last"
3293
+ }
3294
+ ],
3295
+ "isUnique": false,
3296
+ "concurrently": false,
3297
+ "method": "btree",
3298
+ "with": {}
3299
+ },
3300
+ "ai_conversation_template_idx": {
3301
+ "name": "ai_conversation_template_idx",
3302
+ "columns": [
3303
+ {
3304
+ "expression": "template_id",
3305
+ "isExpression": false,
3306
+ "asc": true,
3307
+ "nulls": "last"
3308
+ }
3309
+ ],
3310
+ "isUnique": false,
3311
+ "concurrently": false,
3312
+ "method": "btree",
3313
+ "with": {}
3314
+ }
3315
+ },
3316
+ "foreignKeys": {
3317
+ "ai_conversation_organization_id_organization_id_fk": {
3318
+ "name": "ai_conversation_organization_id_organization_id_fk",
3319
+ "tableFrom": "ai_conversation",
3320
+ "tableTo": "organization",
3321
+ "columnsFrom": ["organization_id"],
3322
+ "columnsTo": ["id"],
3323
+ "onDelete": "cascade",
3324
+ "onUpdate": "no action"
3325
+ },
3326
+ "ai_conversation_template_id_template_id_fk": {
3327
+ "name": "ai_conversation_template_id_template_id_fk",
3328
+ "tableFrom": "ai_conversation",
3329
+ "tableTo": "template",
3330
+ "columnsFrom": ["template_id"],
3331
+ "columnsTo": ["id"],
3332
+ "onDelete": "cascade",
3333
+ "onUpdate": "no action"
3334
+ },
3335
+ "ai_conversation_created_by_user_id_fk": {
3336
+ "name": "ai_conversation_created_by_user_id_fk",
3337
+ "tableFrom": "ai_conversation",
3338
+ "tableTo": "user",
3339
+ "columnsFrom": ["created_by"],
3340
+ "columnsTo": ["id"],
3341
+ "onDelete": "set null",
3342
+ "onUpdate": "no action"
3343
+ }
3344
+ },
3345
+ "compositePrimaryKeys": {},
3346
+ "uniqueConstraints": {},
3347
+ "policies": {},
3348
+ "checkConstraints": {},
3349
+ "isRLSEnabled": false
3350
+ },
3351
+ "public.brand_kit": {
3352
+ "name": "brand_kit",
3353
+ "schema": "",
3354
+ "columns": {
3355
+ "id": {
3356
+ "name": "id",
3357
+ "type": "text",
3358
+ "primaryKey": true,
3359
+ "notNull": true
3360
+ },
3361
+ "organization_id": {
3362
+ "name": "organization_id",
3363
+ "type": "text",
3364
+ "primaryKey": false,
3365
+ "notNull": true
3366
+ },
3367
+ "name": {
3368
+ "name": "name",
3369
+ "type": "text",
3370
+ "primaryKey": false,
3371
+ "notNull": true,
3372
+ "default": "'Default'"
3373
+ },
3374
+ "logo_url": {
3375
+ "name": "logo_url",
3376
+ "type": "text",
3377
+ "primaryKey": false,
3378
+ "notNull": false
3379
+ },
3380
+ "primary_color": {
3381
+ "name": "primary_color",
3382
+ "type": "text",
3383
+ "primaryKey": false,
3384
+ "notNull": true,
3385
+ "default": "'#5046e5'"
3386
+ },
3387
+ "secondary_color": {
3388
+ "name": "secondary_color",
3389
+ "type": "text",
3390
+ "primaryKey": false,
3391
+ "notNull": true,
3392
+ "default": "'#6366f1'"
3393
+ },
3394
+ "background_color": {
3395
+ "name": "background_color",
3396
+ "type": "text",
3397
+ "primaryKey": false,
3398
+ "notNull": true,
3399
+ "default": "'#ffffff'"
3400
+ },
3401
+ "text_color": {
3402
+ "name": "text_color",
3403
+ "type": "text",
3404
+ "primaryKey": false,
3405
+ "notNull": true,
3406
+ "default": "'#1f2937'"
3407
+ },
3408
+ "font_family": {
3409
+ "name": "font_family",
3410
+ "type": "text",
3411
+ "primaryKey": false,
3412
+ "notNull": true,
3413
+ "default": "'system-ui, sans-serif'"
3414
+ },
3415
+ "heading_font_family": {
3416
+ "name": "heading_font_family",
3417
+ "type": "text",
3418
+ "primaryKey": false,
3419
+ "notNull": false
3420
+ },
3421
+ "button_style": {
3422
+ "name": "button_style",
3423
+ "type": "text",
3424
+ "primaryKey": false,
3425
+ "notNull": true,
3426
+ "default": "'rounded'"
3427
+ },
3428
+ "button_radius": {
3429
+ "name": "button_radius",
3430
+ "type": "text",
3431
+ "primaryKey": false,
3432
+ "notNull": true,
3433
+ "default": "'4px'"
3434
+ },
3435
+ "company_name": {
3436
+ "name": "company_name",
3437
+ "type": "text",
3438
+ "primaryKey": false,
3439
+ "notNull": false
3440
+ },
3441
+ "company_address": {
3442
+ "name": "company_address",
3443
+ "type": "text",
3444
+ "primaryKey": false,
3445
+ "notNull": false
3446
+ },
3447
+ "social_links": {
3448
+ "name": "social_links",
3449
+ "type": "jsonb",
3450
+ "primaryKey": false,
3451
+ "notNull": false,
3452
+ "default": "'[]'::jsonb"
3453
+ },
3454
+ "source_domain": {
3455
+ "name": "source_domain",
3456
+ "type": "text",
3457
+ "primaryKey": false,
3458
+ "notNull": false
3459
+ },
3460
+ "auto_extracted": {
3461
+ "name": "auto_extracted",
3462
+ "type": "boolean",
3463
+ "primaryKey": false,
3464
+ "notNull": true,
3465
+ "default": false
3466
+ },
3467
+ "is_default": {
3468
+ "name": "is_default",
3469
+ "type": "boolean",
3470
+ "primaryKey": false,
3471
+ "notNull": true,
3472
+ "default": false
3473
+ },
3474
+ "created_at": {
3475
+ "name": "created_at",
3476
+ "type": "timestamp",
3477
+ "primaryKey": false,
3478
+ "notNull": true,
3479
+ "default": "now()"
3480
+ },
3481
+ "updated_at": {
3482
+ "name": "updated_at",
3483
+ "type": "timestamp",
3484
+ "primaryKey": false,
3485
+ "notNull": true,
3486
+ "default": "now()"
3487
+ }
3488
+ },
3489
+ "indexes": {
3490
+ "brand_kit_org_idx": {
3491
+ "name": "brand_kit_org_idx",
3492
+ "columns": [
3493
+ {
3494
+ "expression": "organization_id",
3495
+ "isExpression": false,
3496
+ "asc": true,
3497
+ "nulls": "last"
3498
+ }
3499
+ ],
3500
+ "isUnique": false,
3501
+ "concurrently": false,
3502
+ "method": "btree",
3503
+ "with": {}
3504
+ },
3505
+ "brand_kit_default_idx": {
3506
+ "name": "brand_kit_default_idx",
3507
+ "columns": [
3508
+ {
3509
+ "expression": "organization_id",
3510
+ "isExpression": false,
3511
+ "asc": true,
3512
+ "nulls": "last"
3513
+ },
3514
+ {
3515
+ "expression": "is_default",
3516
+ "isExpression": false,
3517
+ "asc": true,
3518
+ "nulls": "last"
3519
+ }
3520
+ ],
3521
+ "isUnique": false,
3522
+ "concurrently": false,
3523
+ "method": "btree",
3524
+ "with": {}
3525
+ }
3526
+ },
3527
+ "foreignKeys": {
3528
+ "brand_kit_organization_id_organization_id_fk": {
3529
+ "name": "brand_kit_organization_id_organization_id_fk",
3530
+ "tableFrom": "brand_kit",
3531
+ "tableTo": "organization",
3532
+ "columnsFrom": ["organization_id"],
3533
+ "columnsTo": ["id"],
3534
+ "onDelete": "cascade",
3535
+ "onUpdate": "no action"
3536
+ }
3537
+ },
3538
+ "compositePrimaryKeys": {},
3539
+ "uniqueConstraints": {},
3540
+ "policies": {},
3541
+ "checkConstraints": {},
3542
+ "isRLSEnabled": false
3543
+ },
3544
+ "public.reusable_block": {
3545
+ "name": "reusable_block",
3546
+ "schema": "",
3547
+ "columns": {
3548
+ "id": {
3549
+ "name": "id",
3550
+ "type": "text",
3551
+ "primaryKey": true,
3552
+ "notNull": true
3553
+ },
3554
+ "organization_id": {
3555
+ "name": "organization_id",
3556
+ "type": "text",
3557
+ "primaryKey": false,
3558
+ "notNull": true
3559
+ },
3560
+ "name": {
3561
+ "name": "name",
3562
+ "type": "text",
3563
+ "primaryKey": false,
3564
+ "notNull": true
3565
+ },
3566
+ "description": {
3567
+ "name": "description",
3568
+ "type": "text",
3569
+ "primaryKey": false,
3570
+ "notNull": false
3571
+ },
3572
+ "category": {
3573
+ "name": "category",
3574
+ "type": "text",
3575
+ "primaryKey": false,
3576
+ "notNull": true,
3577
+ "default": "'custom'"
3578
+ },
3579
+ "content": {
3580
+ "name": "content",
3581
+ "type": "jsonb",
3582
+ "primaryKey": false,
3583
+ "notNull": true
3584
+ },
3585
+ "thumbnail": {
3586
+ "name": "thumbnail",
3587
+ "type": "text",
3588
+ "primaryKey": false,
3589
+ "notNull": false
3590
+ },
3591
+ "is_public": {
3592
+ "name": "is_public",
3593
+ "type": "boolean",
3594
+ "primaryKey": false,
3595
+ "notNull": true,
3596
+ "default": false
3597
+ },
3598
+ "usage_count": {
3599
+ "name": "usage_count",
3600
+ "type": "integer",
3601
+ "primaryKey": false,
3602
+ "notNull": true,
3603
+ "default": 0
3604
+ },
3605
+ "created_at": {
3606
+ "name": "created_at",
3607
+ "type": "timestamp",
3608
+ "primaryKey": false,
3609
+ "notNull": true,
3610
+ "default": "now()"
3611
+ },
3612
+ "updated_at": {
3613
+ "name": "updated_at",
3614
+ "type": "timestamp",
3615
+ "primaryKey": false,
3616
+ "notNull": true,
3617
+ "default": "now()"
3618
+ },
3619
+ "created_by": {
3620
+ "name": "created_by",
3621
+ "type": "text",
3622
+ "primaryKey": false,
3623
+ "notNull": true
3624
+ }
3625
+ },
3626
+ "indexes": {
3627
+ "reusable_block_org_idx": {
3628
+ "name": "reusable_block_org_idx",
3629
+ "columns": [
3630
+ {
3631
+ "expression": "organization_id",
3632
+ "isExpression": false,
3633
+ "asc": true,
3634
+ "nulls": "last"
3635
+ }
3636
+ ],
3637
+ "isUnique": false,
3638
+ "concurrently": false,
3639
+ "method": "btree",
3640
+ "with": {}
3641
+ },
3642
+ "reusable_block_created_by_category_idx": {
3643
+ "name": "reusable_block_created_by_category_idx",
3644
+ "columns": [
3645
+ {
3646
+ "expression": "created_by",
3647
+ "isExpression": false,
3648
+ "asc": true,
3649
+ "nulls": "last"
3650
+ },
3651
+ {
3652
+ "expression": "category",
3653
+ "isExpression": false,
3654
+ "asc": true,
3655
+ "nulls": "last"
3656
+ }
3657
+ ],
3658
+ "isUnique": false,
3659
+ "concurrently": false,
3660
+ "method": "btree",
3661
+ "with": {}
3662
+ },
3663
+ "reusable_block_public_category_idx": {
3664
+ "name": "reusable_block_public_category_idx",
3665
+ "columns": [
3666
+ {
3667
+ "expression": "is_public",
3668
+ "isExpression": false,
3669
+ "asc": true,
3670
+ "nulls": "last"
3671
+ },
3672
+ {
3673
+ "expression": "category",
3674
+ "isExpression": false,
3675
+ "asc": true,
3676
+ "nulls": "last"
3677
+ }
3678
+ ],
3679
+ "isUnique": false,
3680
+ "concurrently": false,
3681
+ "method": "btree",
3682
+ "with": {}
3683
+ }
3684
+ },
3685
+ "foreignKeys": {
3686
+ "reusable_block_organization_id_organization_id_fk": {
3687
+ "name": "reusable_block_organization_id_organization_id_fk",
3688
+ "tableFrom": "reusable_block",
3689
+ "tableTo": "organization",
3690
+ "columnsFrom": ["organization_id"],
3691
+ "columnsTo": ["id"],
3692
+ "onDelete": "cascade",
3693
+ "onUpdate": "no action"
3694
+ },
3695
+ "reusable_block_created_by_user_id_fk": {
3696
+ "name": "reusable_block_created_by_user_id_fk",
3697
+ "tableFrom": "reusable_block",
3698
+ "tableTo": "user",
3699
+ "columnsFrom": ["created_by"],
3700
+ "columnsTo": ["id"],
3701
+ "onDelete": "set null",
3702
+ "onUpdate": "no action"
3703
+ }
3704
+ },
3705
+ "compositePrimaryKeys": {},
3706
+ "uniqueConstraints": {},
3707
+ "policies": {},
3708
+ "checkConstraints": {},
3709
+ "isRLSEnabled": false
3710
+ },
3711
+ "public.template": {
3712
+ "name": "template",
3713
+ "schema": "",
3714
+ "columns": {
3715
+ "id": {
3716
+ "name": "id",
3717
+ "type": "text",
3718
+ "primaryKey": true,
3719
+ "notNull": true
3720
+ },
3721
+ "organization_id": {
3722
+ "name": "organization_id",
3723
+ "type": "text",
3724
+ "primaryKey": false,
3725
+ "notNull": true
3726
+ },
3727
+ "name": {
3728
+ "name": "name",
3729
+ "type": "text",
3730
+ "primaryKey": false,
3731
+ "notNull": true
3732
+ },
3733
+ "description": {
3734
+ "name": "description",
3735
+ "type": "text",
3736
+ "primaryKey": false,
3737
+ "notNull": false
3738
+ },
3739
+ "subject": {
3740
+ "name": "subject",
3741
+ "type": "text",
3742
+ "primaryKey": false,
3743
+ "notNull": false
3744
+ },
3745
+ "email_type": {
3746
+ "name": "email_type",
3747
+ "type": "email_type",
3748
+ "typeSchema": "public",
3749
+ "primaryKey": false,
3750
+ "notNull": true,
3751
+ "default": "'marketing'"
3752
+ },
3753
+ "content": {
3754
+ "name": "content",
3755
+ "type": "jsonb",
3756
+ "primaryKey": false,
3757
+ "notNull": true
3758
+ },
3759
+ "compiled_html": {
3760
+ "name": "compiled_html",
3761
+ "type": "text",
3762
+ "primaryKey": false,
3763
+ "notNull": false
3764
+ },
3765
+ "compiled_text": {
3766
+ "name": "compiled_text",
3767
+ "type": "text",
3768
+ "primaryKey": false,
3769
+ "notNull": false
3770
+ },
3771
+ "variables": {
3772
+ "name": "variables",
3773
+ "type": "jsonb",
3774
+ "primaryKey": false,
3775
+ "notNull": false,
3776
+ "default": "'[]'::jsonb"
3777
+ },
3778
+ "test_data": {
3779
+ "name": "test_data",
3780
+ "type": "jsonb",
3781
+ "primaryKey": false,
3782
+ "notNull": false,
3783
+ "default": "'{}'::jsonb"
3784
+ },
3785
+ "room_id": {
3786
+ "name": "room_id",
3787
+ "type": "text",
3788
+ "primaryKey": false,
3789
+ "notNull": false
3790
+ },
3791
+ "is_collaborative": {
3792
+ "name": "is_collaborative",
3793
+ "type": "boolean",
3794
+ "primaryKey": false,
3795
+ "notNull": true,
3796
+ "default": false
3797
+ },
3798
+ "ai_generated": {
3799
+ "name": "ai_generated",
3800
+ "type": "boolean",
3801
+ "primaryKey": false,
3802
+ "notNull": true,
3803
+ "default": false
3804
+ },
3805
+ "ai_conversation_id": {
3806
+ "name": "ai_conversation_id",
3807
+ "type": "text",
3808
+ "primaryKey": false,
3809
+ "notNull": false
3810
+ },
3811
+ "ses_template_name": {
3812
+ "name": "ses_template_name",
3813
+ "type": "text",
3814
+ "primaryKey": false,
3815
+ "notNull": false
3816
+ },
3817
+ "published_at": {
3818
+ "name": "published_at",
3819
+ "type": "timestamp",
3820
+ "primaryKey": false,
3821
+ "notNull": false
3822
+ },
3823
+ "status": {
3824
+ "name": "status",
3825
+ "type": "template_status",
3826
+ "typeSchema": "public",
3827
+ "primaryKey": false,
3828
+ "notNull": true,
3829
+ "default": "'DRAFT'"
3830
+ },
3831
+ "created_at": {
3832
+ "name": "created_at",
3833
+ "type": "timestamp",
3834
+ "primaryKey": false,
3835
+ "notNull": true,
3836
+ "default": "now()"
3837
+ },
3838
+ "updated_at": {
3839
+ "name": "updated_at",
3840
+ "type": "timestamp",
3841
+ "primaryKey": false,
3842
+ "notNull": true,
3843
+ "default": "now()"
3844
+ },
3845
+ "created_by": {
3846
+ "name": "created_by",
3847
+ "type": "text",
3848
+ "primaryKey": false,
3849
+ "notNull": true
3850
+ },
3851
+ "last_edited_by": {
3852
+ "name": "last_edited_by",
3853
+ "type": "text",
3854
+ "primaryKey": false,
3855
+ "notNull": false
3856
+ }
3857
+ },
3858
+ "indexes": {
3859
+ "template_org_idx": {
3860
+ "name": "template_org_idx",
3861
+ "columns": [
3862
+ {
3863
+ "expression": "organization_id",
3864
+ "isExpression": false,
3865
+ "asc": true,
3866
+ "nulls": "last"
3867
+ }
3868
+ ],
3869
+ "isUnique": false,
3870
+ "concurrently": false,
3871
+ "method": "btree",
3872
+ "with": {}
3873
+ },
3874
+ "template_status_updated_at_idx": {
3875
+ "name": "template_status_updated_at_idx",
3876
+ "columns": [
3877
+ {
3878
+ "expression": "status",
3879
+ "isExpression": false,
3880
+ "asc": true,
3881
+ "nulls": "last"
3882
+ },
3883
+ {
3884
+ "expression": "updated_at",
3885
+ "isExpression": false,
3886
+ "asc": true,
3887
+ "nulls": "last"
3888
+ }
3889
+ ],
3890
+ "isUnique": false,
3891
+ "concurrently": false,
3892
+ "method": "btree",
3893
+ "with": {}
3894
+ },
3895
+ "template_created_by_idx": {
3896
+ "name": "template_created_by_idx",
3897
+ "columns": [
3898
+ {
3899
+ "expression": "created_by",
3900
+ "isExpression": false,
3901
+ "asc": true,
3902
+ "nulls": "last"
3903
+ }
3904
+ ],
3905
+ "isUnique": false,
3906
+ "concurrently": false,
3907
+ "method": "btree",
3908
+ "with": {}
3909
+ },
3910
+ "template_room_id_idx": {
3911
+ "name": "template_room_id_idx",
3912
+ "columns": [
3913
+ {
3914
+ "expression": "room_id",
3915
+ "isExpression": false,
3916
+ "asc": true,
3917
+ "nulls": "last"
3918
+ }
3919
+ ],
3920
+ "isUnique": true,
3921
+ "concurrently": false,
3922
+ "method": "btree",
3923
+ "with": {}
3924
+ }
3925
+ },
3926
+ "foreignKeys": {
3927
+ "template_organization_id_organization_id_fk": {
3928
+ "name": "template_organization_id_organization_id_fk",
3929
+ "tableFrom": "template",
3930
+ "tableTo": "organization",
3931
+ "columnsFrom": ["organization_id"],
3932
+ "columnsTo": ["id"],
3933
+ "onDelete": "cascade",
3934
+ "onUpdate": "no action"
3935
+ },
3936
+ "template_created_by_user_id_fk": {
3937
+ "name": "template_created_by_user_id_fk",
3938
+ "tableFrom": "template",
3939
+ "tableTo": "user",
3940
+ "columnsFrom": ["created_by"],
3941
+ "columnsTo": ["id"],
3942
+ "onDelete": "set null",
3943
+ "onUpdate": "no action"
3944
+ },
3945
+ "template_last_edited_by_user_id_fk": {
3946
+ "name": "template_last_edited_by_user_id_fk",
3947
+ "tableFrom": "template",
3948
+ "tableTo": "user",
3949
+ "columnsFrom": ["last_edited_by"],
3950
+ "columnsTo": ["id"],
3951
+ "onDelete": "set null",
3952
+ "onUpdate": "no action"
3953
+ }
3954
+ },
3955
+ "compositePrimaryKeys": {},
3956
+ "uniqueConstraints": {},
3957
+ "policies": {},
3958
+ "checkConstraints": {},
3959
+ "isRLSEnabled": false
3960
+ },
3961
+ "public.template_variable": {
3962
+ "name": "template_variable",
3963
+ "schema": "",
3964
+ "columns": {
3965
+ "id": {
3966
+ "name": "id",
3967
+ "type": "text",
3968
+ "primaryKey": true,
3969
+ "notNull": true
3970
+ },
3971
+ "organization_id": {
3972
+ "name": "organization_id",
3973
+ "type": "text",
3974
+ "primaryKey": false,
3975
+ "notNull": true
3976
+ },
3977
+ "name": {
3978
+ "name": "name",
3979
+ "type": "text",
3980
+ "primaryKey": false,
3981
+ "notNull": true
3982
+ },
3983
+ "label": {
3984
+ "name": "label",
3985
+ "type": "text",
3986
+ "primaryKey": false,
3987
+ "notNull": true
3988
+ },
3989
+ "type": {
3990
+ "name": "type",
3991
+ "type": "variable_type",
3992
+ "typeSchema": "public",
3993
+ "primaryKey": false,
3994
+ "notNull": true
3995
+ },
3996
+ "required": {
3997
+ "name": "required",
3998
+ "type": "boolean",
3999
+ "primaryKey": false,
4000
+ "notNull": true,
4001
+ "default": false
4002
+ },
4003
+ "fallback": {
4004
+ "name": "fallback",
4005
+ "type": "text",
4006
+ "primaryKey": false,
4007
+ "notNull": false
4008
+ },
4009
+ "validation": {
4010
+ "name": "validation",
4011
+ "type": "jsonb",
4012
+ "primaryKey": false,
4013
+ "notNull": false
4014
+ },
4015
+ "created_at": {
4016
+ "name": "created_at",
4017
+ "type": "timestamp",
4018
+ "primaryKey": false,
4019
+ "notNull": true,
4020
+ "default": "now()"
4021
+ },
4022
+ "updated_at": {
4023
+ "name": "updated_at",
4024
+ "type": "timestamp",
4025
+ "primaryKey": false,
4026
+ "notNull": true,
4027
+ "default": "now()"
4028
+ }
4029
+ },
4030
+ "indexes": {
4031
+ "template_variable_org_name_idx": {
4032
+ "name": "template_variable_org_name_idx",
4033
+ "columns": [
4034
+ {
4035
+ "expression": "organization_id",
4036
+ "isExpression": false,
4037
+ "asc": true,
4038
+ "nulls": "last"
4039
+ },
4040
+ {
4041
+ "expression": "name",
4042
+ "isExpression": false,
4043
+ "asc": true,
4044
+ "nulls": "last"
4045
+ }
4046
+ ],
4047
+ "isUnique": true,
4048
+ "concurrently": false,
4049
+ "method": "btree",
4050
+ "with": {}
4051
+ }
4052
+ },
4053
+ "foreignKeys": {
4054
+ "template_variable_organization_id_organization_id_fk": {
4055
+ "name": "template_variable_organization_id_organization_id_fk",
4056
+ "tableFrom": "template_variable",
4057
+ "tableTo": "organization",
4058
+ "columnsFrom": ["organization_id"],
4059
+ "columnsTo": ["id"],
4060
+ "onDelete": "cascade",
4061
+ "onUpdate": "no action"
4062
+ }
4063
+ },
4064
+ "compositePrimaryKeys": {},
4065
+ "uniqueConstraints": {},
4066
+ "policies": {},
4067
+ "checkConstraints": {},
4068
+ "isRLSEnabled": false
4069
+ },
4070
+ "public.template_version": {
4071
+ "name": "template_version",
4072
+ "schema": "",
4073
+ "columns": {
4074
+ "id": {
4075
+ "name": "id",
4076
+ "type": "text",
4077
+ "primaryKey": true,
4078
+ "notNull": true
4079
+ },
4080
+ "template_id": {
4081
+ "name": "template_id",
4082
+ "type": "text",
4083
+ "primaryKey": false,
4084
+ "notNull": true
4085
+ },
4086
+ "content": {
4087
+ "name": "content",
4088
+ "type": "jsonb",
4089
+ "primaryKey": false,
4090
+ "notNull": true
4091
+ },
4092
+ "version": {
4093
+ "name": "version",
4094
+ "type": "integer",
4095
+ "primaryKey": false,
4096
+ "notNull": true
4097
+ },
4098
+ "created_at": {
4099
+ "name": "created_at",
4100
+ "type": "timestamp",
4101
+ "primaryKey": false,
4102
+ "notNull": true,
4103
+ "default": "now()"
4104
+ },
4105
+ "created_by": {
4106
+ "name": "created_by",
4107
+ "type": "text",
4108
+ "primaryKey": false,
4109
+ "notNull": true
4110
+ },
4111
+ "change_note": {
4112
+ "name": "change_note",
4113
+ "type": "text",
4114
+ "primaryKey": false,
4115
+ "notNull": false
4116
+ }
4117
+ },
4118
+ "indexes": {
4119
+ "template_version_template_version_idx": {
4120
+ "name": "template_version_template_version_idx",
4121
+ "columns": [
4122
+ {
4123
+ "expression": "template_id",
4124
+ "isExpression": false,
4125
+ "asc": true,
4126
+ "nulls": "last"
4127
+ },
4128
+ {
4129
+ "expression": "version",
4130
+ "isExpression": false,
4131
+ "asc": true,
4132
+ "nulls": "last"
4133
+ }
4134
+ ],
4135
+ "isUnique": true,
4136
+ "concurrently": false,
4137
+ "method": "btree",
4138
+ "with": {}
4139
+ },
4140
+ "template_version_template_created_at_idx": {
4141
+ "name": "template_version_template_created_at_idx",
4142
+ "columns": [
4143
+ {
4144
+ "expression": "template_id",
4145
+ "isExpression": false,
4146
+ "asc": true,
4147
+ "nulls": "last"
4148
+ },
4149
+ {
4150
+ "expression": "created_at",
4151
+ "isExpression": false,
4152
+ "asc": true,
4153
+ "nulls": "last"
4154
+ }
4155
+ ],
4156
+ "isUnique": false,
4157
+ "concurrently": false,
4158
+ "method": "btree",
4159
+ "with": {}
4160
+ }
4161
+ },
4162
+ "foreignKeys": {
4163
+ "template_version_template_id_template_id_fk": {
4164
+ "name": "template_version_template_id_template_id_fk",
4165
+ "tableFrom": "template_version",
4166
+ "tableTo": "template",
4167
+ "columnsFrom": ["template_id"],
4168
+ "columnsTo": ["id"],
4169
+ "onDelete": "cascade",
4170
+ "onUpdate": "no action"
4171
+ },
4172
+ "template_version_created_by_user_id_fk": {
4173
+ "name": "template_version_created_by_user_id_fk",
4174
+ "tableFrom": "template_version",
4175
+ "tableTo": "user",
4176
+ "columnsFrom": ["created_by"],
4177
+ "columnsTo": ["id"],
4178
+ "onDelete": "set null",
4179
+ "onUpdate": "no action"
4180
+ }
4181
+ },
4182
+ "compositePrimaryKeys": {},
4183
+ "uniqueConstraints": {},
4184
+ "policies": {},
4185
+ "checkConstraints": {},
4186
+ "isRLSEnabled": false
4187
+ },
4188
+ "public.ai_usage_log": {
4189
+ "name": "ai_usage_log",
4190
+ "schema": "",
4191
+ "columns": {
4192
+ "id": {
4193
+ "name": "id",
4194
+ "type": "text",
4195
+ "primaryKey": true,
4196
+ "notNull": true
4197
+ },
4198
+ "organization_id": {
4199
+ "name": "organization_id",
4200
+ "type": "text",
4201
+ "primaryKey": false,
4202
+ "notNull": true
4203
+ },
4204
+ "user_id": {
4205
+ "name": "user_id",
4206
+ "type": "text",
4207
+ "primaryKey": false,
4208
+ "notNull": false
4209
+ },
4210
+ "period_key": {
4211
+ "name": "period_key",
4212
+ "type": "text",
4213
+ "primaryKey": false,
4214
+ "notNull": true
4215
+ },
4216
+ "feature_type": {
4217
+ "name": "feature_type",
4218
+ "type": "text",
4219
+ "primaryKey": false,
4220
+ "notNull": true,
4221
+ "default": "'ai_chat'"
4222
+ },
4223
+ "template_id": {
4224
+ "name": "template_id",
4225
+ "type": "text",
4226
+ "primaryKey": false,
4227
+ "notNull": false
4228
+ },
4229
+ "input_tokens": {
4230
+ "name": "input_tokens",
4231
+ "type": "integer",
4232
+ "primaryKey": false,
4233
+ "notNull": false
4234
+ },
4235
+ "output_tokens": {
4236
+ "name": "output_tokens",
4237
+ "type": "integer",
4238
+ "primaryKey": false,
4239
+ "notNull": false
4240
+ },
4241
+ "total_tokens": {
4242
+ "name": "total_tokens",
4243
+ "type": "integer",
4244
+ "primaryKey": false,
4245
+ "notNull": false
4246
+ },
4247
+ "model": {
4248
+ "name": "model",
4249
+ "type": "text",
4250
+ "primaryKey": false,
4251
+ "notNull": false
4252
+ },
4253
+ "duration_ms": {
4254
+ "name": "duration_ms",
4255
+ "type": "integer",
4256
+ "primaryKey": false,
4257
+ "notNull": false
4258
+ },
4259
+ "created_at": {
4260
+ "name": "created_at",
4261
+ "type": "timestamp",
4262
+ "primaryKey": false,
4263
+ "notNull": true,
4264
+ "default": "now()"
4265
+ }
4266
+ },
4267
+ "indexes": {
4268
+ "ai_usage_log_org_idx": {
4269
+ "name": "ai_usage_log_org_idx",
4270
+ "columns": [
4271
+ {
4272
+ "expression": "organization_id",
4273
+ "isExpression": false,
4274
+ "asc": true,
4275
+ "nulls": "last"
4276
+ }
4277
+ ],
4278
+ "isUnique": false,
4279
+ "concurrently": false,
4280
+ "method": "btree",
4281
+ "with": {}
4282
+ },
4283
+ "ai_usage_log_period_idx": {
4284
+ "name": "ai_usage_log_period_idx",
4285
+ "columns": [
4286
+ {
4287
+ "expression": "period_key",
4288
+ "isExpression": false,
4289
+ "asc": true,
4290
+ "nulls": "last"
4291
+ }
4292
+ ],
4293
+ "isUnique": false,
4294
+ "concurrently": false,
4295
+ "method": "btree",
4296
+ "with": {}
4297
+ },
4298
+ "ai_usage_log_org_period_idx": {
4299
+ "name": "ai_usage_log_org_period_idx",
4300
+ "columns": [
4301
+ {
4302
+ "expression": "organization_id",
4303
+ "isExpression": false,
4304
+ "asc": true,
4305
+ "nulls": "last"
4306
+ },
4307
+ {
4308
+ "expression": "period_key",
4309
+ "isExpression": false,
4310
+ "asc": true,
4311
+ "nulls": "last"
4312
+ }
4313
+ ],
4314
+ "isUnique": false,
4315
+ "concurrently": false,
4316
+ "method": "btree",
4317
+ "with": {}
4318
+ },
4319
+ "ai_usage_log_user_idx": {
4320
+ "name": "ai_usage_log_user_idx",
4321
+ "columns": [
4322
+ {
4323
+ "expression": "user_id",
4324
+ "isExpression": false,
4325
+ "asc": true,
4326
+ "nulls": "last"
4327
+ }
4328
+ ],
4329
+ "isUnique": false,
4330
+ "concurrently": false,
4331
+ "method": "btree",
4332
+ "with": {}
4333
+ },
4334
+ "ai_usage_log_created_idx": {
4335
+ "name": "ai_usage_log_created_idx",
4336
+ "columns": [
4337
+ {
4338
+ "expression": "created_at",
4339
+ "isExpression": false,
4340
+ "asc": true,
4341
+ "nulls": "last"
4342
+ }
4343
+ ],
4344
+ "isUnique": false,
4345
+ "concurrently": false,
4346
+ "method": "btree",
4347
+ "with": {}
4348
+ }
4349
+ },
4350
+ "foreignKeys": {
4351
+ "ai_usage_log_organization_id_organization_id_fk": {
4352
+ "name": "ai_usage_log_organization_id_organization_id_fk",
4353
+ "tableFrom": "ai_usage_log",
4354
+ "tableTo": "organization",
4355
+ "columnsFrom": ["organization_id"],
4356
+ "columnsTo": ["id"],
4357
+ "onDelete": "cascade",
4358
+ "onUpdate": "no action"
4359
+ },
4360
+ "ai_usage_log_user_id_user_id_fk": {
4361
+ "name": "ai_usage_log_user_id_user_id_fk",
4362
+ "tableFrom": "ai_usage_log",
4363
+ "tableTo": "user",
4364
+ "columnsFrom": ["user_id"],
4365
+ "columnsTo": ["id"],
4366
+ "onDelete": "set null",
4367
+ "onUpdate": "no action"
4368
+ }
4369
+ },
4370
+ "compositePrimaryKeys": {},
4371
+ "uniqueConstraints": {},
4372
+ "policies": {},
4373
+ "checkConstraints": {},
4374
+ "isRLSEnabled": false
4375
+ },
4376
+ "public.ai_usage_monthly": {
4377
+ "name": "ai_usage_monthly",
4378
+ "schema": "",
4379
+ "columns": {
4380
+ "id": {
4381
+ "name": "id",
4382
+ "type": "text",
4383
+ "primaryKey": true,
4384
+ "notNull": true
4385
+ },
4386
+ "organization_id": {
4387
+ "name": "organization_id",
4388
+ "type": "text",
4389
+ "primaryKey": false,
4390
+ "notNull": true
4391
+ },
4392
+ "period_key": {
4393
+ "name": "period_key",
4394
+ "type": "text",
4395
+ "primaryKey": false,
4396
+ "notNull": true
4397
+ },
4398
+ "message_count": {
4399
+ "name": "message_count",
4400
+ "type": "integer",
4401
+ "primaryKey": false,
4402
+ "notNull": true,
4403
+ "default": 0
4404
+ },
4405
+ "updated_at": {
4406
+ "name": "updated_at",
4407
+ "type": "timestamp",
4408
+ "primaryKey": false,
4409
+ "notNull": true,
4410
+ "default": "now()"
4411
+ }
4412
+ },
4413
+ "indexes": {
4414
+ "ai_usage_monthly_org_period_idx": {
4415
+ "name": "ai_usage_monthly_org_period_idx",
4416
+ "columns": [
4417
+ {
4418
+ "expression": "organization_id",
4419
+ "isExpression": false,
4420
+ "asc": true,
4421
+ "nulls": "last"
4422
+ },
4423
+ {
4424
+ "expression": "period_key",
4425
+ "isExpression": false,
4426
+ "asc": true,
4427
+ "nulls": "last"
4428
+ }
4429
+ ],
4430
+ "isUnique": true,
4431
+ "concurrently": false,
4432
+ "method": "btree",
4433
+ "with": {}
4434
+ },
4435
+ "ai_usage_monthly_period_idx": {
4436
+ "name": "ai_usage_monthly_period_idx",
4437
+ "columns": [
4438
+ {
4439
+ "expression": "period_key",
4440
+ "isExpression": false,
4441
+ "asc": true,
4442
+ "nulls": "last"
4443
+ }
4444
+ ],
4445
+ "isUnique": false,
4446
+ "concurrently": false,
4447
+ "method": "btree",
4448
+ "with": {}
4449
+ }
4450
+ },
4451
+ "foreignKeys": {
4452
+ "ai_usage_monthly_organization_id_organization_id_fk": {
4453
+ "name": "ai_usage_monthly_organization_id_organization_id_fk",
4454
+ "tableFrom": "ai_usage_monthly",
4455
+ "tableTo": "organization",
4456
+ "columnsFrom": ["organization_id"],
4457
+ "columnsTo": ["id"],
4458
+ "onDelete": "cascade",
4459
+ "onUpdate": "no action"
4460
+ }
4461
+ },
4462
+ "compositePrimaryKeys": {},
4463
+ "uniqueConstraints": {},
4464
+ "policies": {},
4465
+ "checkConstraints": {},
4466
+ "isRLSEnabled": false
4467
+ },
4468
+ "public.api_rate_limit_window": {
4469
+ "name": "api_rate_limit_window",
4470
+ "schema": "",
4471
+ "columns": {
4472
+ "id": {
4473
+ "name": "id",
4474
+ "type": "text",
4475
+ "primaryKey": true,
4476
+ "notNull": true
4477
+ },
4478
+ "organization_id": {
4479
+ "name": "organization_id",
4480
+ "type": "text",
4481
+ "primaryKey": false,
4482
+ "notNull": true
4483
+ },
4484
+ "minute_key": {
4485
+ "name": "minute_key",
4486
+ "type": "text",
4487
+ "primaryKey": false,
4488
+ "notNull": true
4489
+ },
4490
+ "request_count": {
4491
+ "name": "request_count",
4492
+ "type": "integer",
4493
+ "primaryKey": false,
4494
+ "notNull": true,
4495
+ "default": 0
4496
+ },
4497
+ "expires_at": {
4498
+ "name": "expires_at",
4499
+ "type": "timestamp",
4500
+ "primaryKey": false,
4501
+ "notNull": true
4502
+ }
4503
+ },
4504
+ "indexes": {
4505
+ "api_rate_limit_org_minute_idx": {
4506
+ "name": "api_rate_limit_org_minute_idx",
4507
+ "columns": [
4508
+ {
4509
+ "expression": "organization_id",
4510
+ "isExpression": false,
4511
+ "asc": true,
4512
+ "nulls": "last"
4513
+ },
4514
+ {
4515
+ "expression": "minute_key",
4516
+ "isExpression": false,
4517
+ "asc": true,
4518
+ "nulls": "last"
4519
+ }
4520
+ ],
4521
+ "isUnique": true,
4522
+ "concurrently": false,
4523
+ "method": "btree",
4524
+ "with": {}
4525
+ },
4526
+ "api_rate_limit_expires_idx": {
4527
+ "name": "api_rate_limit_expires_idx",
4528
+ "columns": [
4529
+ {
4530
+ "expression": "expires_at",
4531
+ "isExpression": false,
4532
+ "asc": true,
4533
+ "nulls": "last"
4534
+ }
4535
+ ],
4536
+ "isUnique": false,
4537
+ "concurrently": false,
4538
+ "method": "btree",
4539
+ "with": {}
4540
+ }
4541
+ },
4542
+ "foreignKeys": {
4543
+ "api_rate_limit_window_organization_id_organization_id_fk": {
4544
+ "name": "api_rate_limit_window_organization_id_organization_id_fk",
4545
+ "tableFrom": "api_rate_limit_window",
4546
+ "tableTo": "organization",
4547
+ "columnsFrom": ["organization_id"],
4548
+ "columnsTo": ["id"],
4549
+ "onDelete": "cascade",
4550
+ "onUpdate": "no action"
4551
+ }
4552
+ },
4553
+ "compositePrimaryKeys": {},
4554
+ "uniqueConstraints": {},
4555
+ "policies": {},
4556
+ "checkConstraints": {},
4557
+ "isRLSEnabled": false
4558
+ },
4559
+ "public.api_usage_daily": {
4560
+ "name": "api_usage_daily",
4561
+ "schema": "",
4562
+ "columns": {
4563
+ "id": {
4564
+ "name": "id",
4565
+ "type": "text",
4566
+ "primaryKey": true,
4567
+ "notNull": true
4568
+ },
4569
+ "organization_id": {
4570
+ "name": "organization_id",
4571
+ "type": "text",
4572
+ "primaryKey": false,
4573
+ "notNull": true
4574
+ },
4575
+ "date_key": {
4576
+ "name": "date_key",
4577
+ "type": "text",
4578
+ "primaryKey": false,
4579
+ "notNull": true
4580
+ },
4581
+ "request_count": {
4582
+ "name": "request_count",
4583
+ "type": "integer",
4584
+ "primaryKey": false,
4585
+ "notNull": true,
4586
+ "default": 0
4587
+ },
4588
+ "updated_at": {
4589
+ "name": "updated_at",
4590
+ "type": "timestamp",
4591
+ "primaryKey": false,
4592
+ "notNull": true,
4593
+ "default": "now()"
4594
+ }
4595
+ },
4596
+ "indexes": {
4597
+ "api_usage_daily_org_date_idx": {
4598
+ "name": "api_usage_daily_org_date_idx",
4599
+ "columns": [
4600
+ {
4601
+ "expression": "organization_id",
4602
+ "isExpression": false,
4603
+ "asc": true,
4604
+ "nulls": "last"
4605
+ },
4606
+ {
4607
+ "expression": "date_key",
4608
+ "isExpression": false,
4609
+ "asc": true,
4610
+ "nulls": "last"
4611
+ }
4612
+ ],
4613
+ "isUnique": true,
4614
+ "concurrently": false,
4615
+ "method": "btree",
4616
+ "with": {}
4617
+ },
4618
+ "api_usage_daily_date_idx": {
4619
+ "name": "api_usage_daily_date_idx",
4620
+ "columns": [
4621
+ {
4622
+ "expression": "date_key",
4623
+ "isExpression": false,
4624
+ "asc": true,
4625
+ "nulls": "last"
4626
+ }
4627
+ ],
4628
+ "isUnique": false,
4629
+ "concurrently": false,
4630
+ "method": "btree",
4631
+ "with": {}
4632
+ }
4633
+ },
4634
+ "foreignKeys": {
4635
+ "api_usage_daily_organization_id_organization_id_fk": {
4636
+ "name": "api_usage_daily_organization_id_organization_id_fk",
4637
+ "tableFrom": "api_usage_daily",
4638
+ "tableTo": "organization",
4639
+ "columnsFrom": ["organization_id"],
4640
+ "columnsTo": ["id"],
4641
+ "onDelete": "cascade",
4642
+ "onUpdate": "no action"
4643
+ }
4644
+ },
4645
+ "compositePrimaryKeys": {},
4646
+ "uniqueConstraints": {},
4647
+ "policies": {},
4648
+ "checkConstraints": {},
4649
+ "isRLSEnabled": false
4650
+ },
4651
+ "public.waitlist": {
4652
+ "name": "waitlist",
4653
+ "schema": "",
4654
+ "columns": {
4655
+ "id": {
4656
+ "name": "id",
4657
+ "type": "text",
4658
+ "primaryKey": true,
4659
+ "notNull": true
4660
+ },
4661
+ "email": {
4662
+ "name": "email",
4663
+ "type": "text",
4664
+ "primaryKey": false,
4665
+ "notNull": true
4666
+ },
4667
+ "email_hash": {
4668
+ "name": "email_hash",
4669
+ "type": "text",
4670
+ "primaryKey": false,
4671
+ "notNull": true
4672
+ },
4673
+ "product": {
4674
+ "name": "product",
4675
+ "type": "text",
4676
+ "primaryKey": false,
4677
+ "notNull": true
4678
+ },
4679
+ "source": {
4680
+ "name": "source",
4681
+ "type": "text",
4682
+ "primaryKey": false,
4683
+ "notNull": false
4684
+ },
4685
+ "referrer": {
4686
+ "name": "referrer",
4687
+ "type": "text",
4688
+ "primaryKey": false,
4689
+ "notNull": false
4690
+ },
4691
+ "created_at": {
4692
+ "name": "created_at",
4693
+ "type": "timestamp",
4694
+ "primaryKey": false,
4695
+ "notNull": true,
4696
+ "default": "now()"
4697
+ }
4698
+ },
4699
+ "indexes": {
4700
+ "waitlist_email_product_idx": {
4701
+ "name": "waitlist_email_product_idx",
4702
+ "columns": [
4703
+ {
4704
+ "expression": "email_hash",
4705
+ "isExpression": false,
4706
+ "asc": true,
4707
+ "nulls": "last"
4708
+ },
4709
+ {
4710
+ "expression": "product",
4711
+ "isExpression": false,
4712
+ "asc": true,
4713
+ "nulls": "last"
4714
+ }
4715
+ ],
4716
+ "isUnique": true,
4717
+ "concurrently": false,
4718
+ "method": "btree",
4719
+ "with": {}
4720
+ },
4721
+ "waitlist_product_idx": {
4722
+ "name": "waitlist_product_idx",
4723
+ "columns": [
4724
+ {
4725
+ "expression": "product",
4726
+ "isExpression": false,
4727
+ "asc": true,
4728
+ "nulls": "last"
4729
+ }
4730
+ ],
4731
+ "isUnique": false,
4732
+ "concurrently": false,
4733
+ "method": "btree",
4734
+ "with": {}
4735
+ },
4736
+ "waitlist_created_at_idx": {
4737
+ "name": "waitlist_created_at_idx",
4738
+ "columns": [
4739
+ {
4740
+ "expression": "created_at",
4741
+ "isExpression": false,
4742
+ "asc": true,
4743
+ "nulls": "last"
4744
+ }
4745
+ ],
4746
+ "isUnique": false,
4747
+ "concurrently": false,
4748
+ "method": "btree",
4749
+ "with": {}
4750
+ }
4751
+ },
4752
+ "foreignKeys": {},
4753
+ "compositePrimaryKeys": {},
4754
+ "uniqueConstraints": {},
4755
+ "policies": {},
4756
+ "checkConstraints": {},
4757
+ "isRLSEnabled": false
4758
+ }
4759
+ },
4760
+ "enums": {
4761
+ "public.batch_send_status": {
4762
+ "name": "batch_send_status",
4763
+ "schema": "public",
4764
+ "values": [
4765
+ "draft",
4766
+ "scheduled",
4767
+ "queued",
4768
+ "processing",
4769
+ "completed",
4770
+ "failed",
4771
+ "cancelled"
4772
+ ]
4773
+ },
4774
+ "public.message_send_status": {
4775
+ "name": "message_send_status",
4776
+ "schema": "public",
4777
+ "values": [
4778
+ "pending",
4779
+ "queued",
4780
+ "sent",
4781
+ "delivered",
4782
+ "opened",
4783
+ "clicked",
4784
+ "bounced",
4785
+ "complained",
4786
+ "failed",
4787
+ "opted_out"
4788
+ ]
4789
+ },
4790
+ "public.message_source_type": {
4791
+ "name": "message_source_type",
4792
+ "schema": "public",
4793
+ "values": ["transactional", "batch", "campaign", "workflow"]
4794
+ },
4795
+ "public.email_type": {
4796
+ "name": "email_type",
4797
+ "schema": "public",
4798
+ "values": ["marketing", "transactional"]
4799
+ },
4800
+ "public.template_status": {
4801
+ "name": "template_status",
4802
+ "schema": "public",
4803
+ "values": ["DRAFT", "PUBLISHED", "ARCHIVED"]
4804
+ },
4805
+ "public.variable_type": {
4806
+ "name": "variable_type",
4807
+ "schema": "public",
4808
+ "values": ["TEXT", "NUMBER", "BOOLEAN", "DATE", "URL", "EMAIL"]
4809
+ }
4810
+ },
4811
+ "schemas": {},
4812
+ "sequences": {},
4813
+ "roles": {},
4814
+ "policies": {},
4815
+ "views": {},
4816
+ "_meta": {
4817
+ "columns": {},
4818
+ "schemas": {},
4819
+ "tables": {}
4820
+ }
4821
+ }