@hogsend/db 0.0.1

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 (47) hide show
  1. package/LICENSE +93 -0
  2. package/README.md +14 -0
  3. package/drizzle/0000_nifty_songbird.sql +188 -0
  4. package/drizzle/0001_minor_shockwave.sql +13 -0
  5. package/drizzle/0002_early_owl.sql +1 -0
  6. package/drizzle/0003_bizarre_annihilus.sql +9 -0
  7. package/drizzle/0004_brave_betty_brant.sql +1 -0
  8. package/drizzle/0005_groovy_princess_powerful.sql +8 -0
  9. package/drizzle/0006_groovy_charles_xavier.sql +100 -0
  10. package/drizzle/0007_serious_captain_universe.sql +1 -0
  11. package/drizzle/0008_demonic_agent_brand.sql +5 -0
  12. package/drizzle/meta/0000_snapshot.json +1264 -0
  13. package/drizzle/meta/0001_snapshot.json +1353 -0
  14. package/drizzle/meta/0002_snapshot.json +1380 -0
  15. package/drizzle/meta/0003_snapshot.json +1443 -0
  16. package/drizzle/meta/0004_snapshot.json +1464 -0
  17. package/drizzle/meta/0005_snapshot.json +1588 -0
  18. package/drizzle/meta/0006_snapshot.json +2331 -0
  19. package/drizzle/meta/0007_snapshot.json +2346 -0
  20. package/drizzle/meta/0008_snapshot.json +2449 -0
  21. package/drizzle/meta/_journal.json +69 -0
  22. package/package.json +49 -0
  23. package/src/index.ts +35 -0
  24. package/src/migrate-client.ts +56 -0
  25. package/src/migrate.ts +173 -0
  26. package/src/schema/_shared.ts +10 -0
  27. package/src/schema/alert-history.ts +21 -0
  28. package/src/schema/alert-rules.ts +36 -0
  29. package/src/schema/api-keys.ts +30 -0
  30. package/src/schema/audit-logs.ts +22 -0
  31. package/src/schema/auth.ts +89 -0
  32. package/src/schema/contacts.ts +31 -0
  33. package/src/schema/dead-letter-queue.ts +31 -0
  34. package/src/schema/email-preferences.ts +35 -0
  35. package/src/schema/email-sends.ts +34 -0
  36. package/src/schema/enums.ts +47 -0
  37. package/src/schema/import-jobs.ts +26 -0
  38. package/src/schema/index.ts +18 -0
  39. package/src/schema/journey-configs.ts +15 -0
  40. package/src/schema/journey-logs.ts +21 -0
  41. package/src/schema/journey-states.ts +54 -0
  42. package/src/schema/link-clicks.ts +21 -0
  43. package/src/schema/relations.ts +160 -0
  44. package/src/schema/tracked-links.ts +17 -0
  45. package/src/schema/user-events.ts +35 -0
  46. package/src/seed.ts +91 -0
  47. package/src/version.ts +162 -0
@@ -0,0 +1,2449 @@
1
+ {
2
+ "id": "e1baa516-09d7-4789-8196-d08d5af393d1",
3
+ "prevId": "73f870f2-499c-4b71-91b8-57df6c3afe80",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.alert_history": {
8
+ "name": "alert_history",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "alert_rule_id": {
19
+ "name": "alert_rule_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "payload": {
25
+ "name": "payload",
26
+ "type": "jsonb",
27
+ "primaryKey": false,
28
+ "notNull": false
29
+ },
30
+ "delivery_status": {
31
+ "name": "delivery_status",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "error": {
37
+ "name": "error",
38
+ "type": "text",
39
+ "primaryKey": false,
40
+ "notNull": false
41
+ },
42
+ "created_at": {
43
+ "name": "created_at",
44
+ "type": "timestamp with time zone",
45
+ "primaryKey": false,
46
+ "notNull": true,
47
+ "default": "now()"
48
+ },
49
+ "updated_at": {
50
+ "name": "updated_at",
51
+ "type": "timestamp with time zone",
52
+ "primaryKey": false,
53
+ "notNull": true,
54
+ "default": "now()"
55
+ }
56
+ },
57
+ "indexes": {
58
+ "alert_history_rule_id_idx": {
59
+ "name": "alert_history_rule_id_idx",
60
+ "columns": [
61
+ {
62
+ "expression": "alert_rule_id",
63
+ "isExpression": false,
64
+ "asc": true,
65
+ "nulls": "last"
66
+ }
67
+ ],
68
+ "isUnique": false,
69
+ "concurrently": false,
70
+ "method": "btree",
71
+ "with": {}
72
+ },
73
+ "alert_history_created_at_idx": {
74
+ "name": "alert_history_created_at_idx",
75
+ "columns": [
76
+ {
77
+ "expression": "created_at",
78
+ "isExpression": false,
79
+ "asc": true,
80
+ "nulls": "last"
81
+ }
82
+ ],
83
+ "isUnique": false,
84
+ "concurrently": false,
85
+ "method": "btree",
86
+ "with": {}
87
+ }
88
+ },
89
+ "foreignKeys": {
90
+ "alert_history_alert_rule_id_alert_rules_id_fk": {
91
+ "name": "alert_history_alert_rule_id_alert_rules_id_fk",
92
+ "tableFrom": "alert_history",
93
+ "tableTo": "alert_rules",
94
+ "columnsFrom": [
95
+ "alert_rule_id"
96
+ ],
97
+ "columnsTo": [
98
+ "id"
99
+ ],
100
+ "onDelete": "no action",
101
+ "onUpdate": "no action"
102
+ }
103
+ },
104
+ "compositePrimaryKeys": {},
105
+ "uniqueConstraints": {},
106
+ "policies": {},
107
+ "checkConstraints": {},
108
+ "isRLSEnabled": false
109
+ },
110
+ "public.alert_rules": {
111
+ "name": "alert_rules",
112
+ "schema": "",
113
+ "columns": {
114
+ "id": {
115
+ "name": "id",
116
+ "type": "uuid",
117
+ "primaryKey": true,
118
+ "notNull": true,
119
+ "default": "gen_random_uuid()"
120
+ },
121
+ "name": {
122
+ "name": "name",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": true
126
+ },
127
+ "type": {
128
+ "name": "type",
129
+ "type": "alert_rule_type",
130
+ "typeSchema": "public",
131
+ "primaryKey": false,
132
+ "notNull": true
133
+ },
134
+ "threshold": {
135
+ "name": "threshold",
136
+ "type": "jsonb",
137
+ "primaryKey": false,
138
+ "notNull": true
139
+ },
140
+ "channel": {
141
+ "name": "channel",
142
+ "type": "alert_channel",
143
+ "typeSchema": "public",
144
+ "primaryKey": false,
145
+ "notNull": true
146
+ },
147
+ "channel_config": {
148
+ "name": "channel_config",
149
+ "type": "jsonb",
150
+ "primaryKey": false,
151
+ "notNull": true
152
+ },
153
+ "enabled": {
154
+ "name": "enabled",
155
+ "type": "boolean",
156
+ "primaryKey": false,
157
+ "notNull": true,
158
+ "default": true
159
+ },
160
+ "cooldown_minutes": {
161
+ "name": "cooldown_minutes",
162
+ "type": "integer",
163
+ "primaryKey": false,
164
+ "notNull": true,
165
+ "default": 60
166
+ },
167
+ "last_fired_at": {
168
+ "name": "last_fired_at",
169
+ "type": "timestamp with time zone",
170
+ "primaryKey": false,
171
+ "notNull": false
172
+ },
173
+ "created_at": {
174
+ "name": "created_at",
175
+ "type": "timestamp with time zone",
176
+ "primaryKey": false,
177
+ "notNull": true,
178
+ "default": "now()"
179
+ },
180
+ "updated_at": {
181
+ "name": "updated_at",
182
+ "type": "timestamp with time zone",
183
+ "primaryKey": false,
184
+ "notNull": true,
185
+ "default": "now()"
186
+ }
187
+ },
188
+ "indexes": {
189
+ "alert_rules_type_idx": {
190
+ "name": "alert_rules_type_idx",
191
+ "columns": [
192
+ {
193
+ "expression": "type",
194
+ "isExpression": false,
195
+ "asc": true,
196
+ "nulls": "last"
197
+ }
198
+ ],
199
+ "isUnique": false,
200
+ "concurrently": false,
201
+ "method": "btree",
202
+ "with": {}
203
+ },
204
+ "alert_rules_enabled_idx": {
205
+ "name": "alert_rules_enabled_idx",
206
+ "columns": [
207
+ {
208
+ "expression": "enabled",
209
+ "isExpression": false,
210
+ "asc": true,
211
+ "nulls": "last"
212
+ }
213
+ ],
214
+ "isUnique": false,
215
+ "concurrently": false,
216
+ "method": "btree",
217
+ "with": {}
218
+ }
219
+ },
220
+ "foreignKeys": {},
221
+ "compositePrimaryKeys": {},
222
+ "uniqueConstraints": {},
223
+ "policies": {},
224
+ "checkConstraints": {},
225
+ "isRLSEnabled": false
226
+ },
227
+ "public.api_keys": {
228
+ "name": "api_keys",
229
+ "schema": "",
230
+ "columns": {
231
+ "id": {
232
+ "name": "id",
233
+ "type": "uuid",
234
+ "primaryKey": true,
235
+ "notNull": true,
236
+ "default": "gen_random_uuid()"
237
+ },
238
+ "organization_id": {
239
+ "name": "organization_id",
240
+ "type": "text",
241
+ "primaryKey": false,
242
+ "notNull": false
243
+ },
244
+ "name": {
245
+ "name": "name",
246
+ "type": "text",
247
+ "primaryKey": false,
248
+ "notNull": true
249
+ },
250
+ "key_prefix": {
251
+ "name": "key_prefix",
252
+ "type": "text",
253
+ "primaryKey": false,
254
+ "notNull": true
255
+ },
256
+ "key_hash": {
257
+ "name": "key_hash",
258
+ "type": "text",
259
+ "primaryKey": false,
260
+ "notNull": true
261
+ },
262
+ "scopes": {
263
+ "name": "scopes",
264
+ "type": "jsonb",
265
+ "primaryKey": false,
266
+ "notNull": true,
267
+ "default": "'[\"read\"]'::jsonb"
268
+ },
269
+ "created_by": {
270
+ "name": "created_by",
271
+ "type": "text",
272
+ "primaryKey": false,
273
+ "notNull": false
274
+ },
275
+ "last_used_at": {
276
+ "name": "last_used_at",
277
+ "type": "timestamp with time zone",
278
+ "primaryKey": false,
279
+ "notNull": false
280
+ },
281
+ "revoked_at": {
282
+ "name": "revoked_at",
283
+ "type": "timestamp with time zone",
284
+ "primaryKey": false,
285
+ "notNull": false
286
+ },
287
+ "expires_at": {
288
+ "name": "expires_at",
289
+ "type": "timestamp with time zone",
290
+ "primaryKey": false,
291
+ "notNull": false
292
+ },
293
+ "created_at": {
294
+ "name": "created_at",
295
+ "type": "timestamp with time zone",
296
+ "primaryKey": false,
297
+ "notNull": true,
298
+ "default": "now()"
299
+ },
300
+ "updated_at": {
301
+ "name": "updated_at",
302
+ "type": "timestamp with time zone",
303
+ "primaryKey": false,
304
+ "notNull": true,
305
+ "default": "now()"
306
+ }
307
+ },
308
+ "indexes": {
309
+ "api_keys_key_hash_idx": {
310
+ "name": "api_keys_key_hash_idx",
311
+ "columns": [
312
+ {
313
+ "expression": "key_hash",
314
+ "isExpression": false,
315
+ "asc": true,
316
+ "nulls": "last"
317
+ }
318
+ ],
319
+ "isUnique": false,
320
+ "concurrently": false,
321
+ "method": "btree",
322
+ "with": {}
323
+ },
324
+ "api_keys_revoked_at_idx": {
325
+ "name": "api_keys_revoked_at_idx",
326
+ "columns": [
327
+ {
328
+ "expression": "revoked_at",
329
+ "isExpression": false,
330
+ "asc": true,
331
+ "nulls": "last"
332
+ }
333
+ ],
334
+ "isUnique": false,
335
+ "concurrently": false,
336
+ "method": "btree",
337
+ "with": {}
338
+ }
339
+ },
340
+ "foreignKeys": {},
341
+ "compositePrimaryKeys": {},
342
+ "uniqueConstraints": {
343
+ "api_keys_key_hash_unique": {
344
+ "name": "api_keys_key_hash_unique",
345
+ "nullsNotDistinct": false,
346
+ "columns": [
347
+ "key_hash"
348
+ ]
349
+ }
350
+ },
351
+ "policies": {},
352
+ "checkConstraints": {},
353
+ "isRLSEnabled": false
354
+ },
355
+ "public.audit_logs": {
356
+ "name": "audit_logs",
357
+ "schema": "",
358
+ "columns": {
359
+ "id": {
360
+ "name": "id",
361
+ "type": "uuid",
362
+ "primaryKey": true,
363
+ "notNull": true,
364
+ "default": "gen_random_uuid()"
365
+ },
366
+ "actor": {
367
+ "name": "actor",
368
+ "type": "text",
369
+ "primaryKey": false,
370
+ "notNull": true
371
+ },
372
+ "actor_key_id": {
373
+ "name": "actor_key_id",
374
+ "type": "uuid",
375
+ "primaryKey": false,
376
+ "notNull": false
377
+ },
378
+ "action": {
379
+ "name": "action",
380
+ "type": "text",
381
+ "primaryKey": false,
382
+ "notNull": true
383
+ },
384
+ "resource": {
385
+ "name": "resource",
386
+ "type": "text",
387
+ "primaryKey": false,
388
+ "notNull": true
389
+ },
390
+ "resource_id": {
391
+ "name": "resource_id",
392
+ "type": "text",
393
+ "primaryKey": false,
394
+ "notNull": false
395
+ },
396
+ "detail": {
397
+ "name": "detail",
398
+ "type": "jsonb",
399
+ "primaryKey": false,
400
+ "notNull": false
401
+ },
402
+ "ip_address": {
403
+ "name": "ip_address",
404
+ "type": "text",
405
+ "primaryKey": false,
406
+ "notNull": false
407
+ },
408
+ "created_at": {
409
+ "name": "created_at",
410
+ "type": "timestamp with time zone",
411
+ "primaryKey": false,
412
+ "notNull": true,
413
+ "default": "now()"
414
+ },
415
+ "updated_at": {
416
+ "name": "updated_at",
417
+ "type": "timestamp with time zone",
418
+ "primaryKey": false,
419
+ "notNull": true,
420
+ "default": "now()"
421
+ }
422
+ },
423
+ "indexes": {
424
+ "audit_logs_actor_idx": {
425
+ "name": "audit_logs_actor_idx",
426
+ "columns": [
427
+ {
428
+ "expression": "actor",
429
+ "isExpression": false,
430
+ "asc": true,
431
+ "nulls": "last"
432
+ }
433
+ ],
434
+ "isUnique": false,
435
+ "concurrently": false,
436
+ "method": "btree",
437
+ "with": {}
438
+ },
439
+ "audit_logs_resource_idx": {
440
+ "name": "audit_logs_resource_idx",
441
+ "columns": [
442
+ {
443
+ "expression": "resource",
444
+ "isExpression": false,
445
+ "asc": true,
446
+ "nulls": "last"
447
+ },
448
+ {
449
+ "expression": "resource_id",
450
+ "isExpression": false,
451
+ "asc": true,
452
+ "nulls": "last"
453
+ }
454
+ ],
455
+ "isUnique": false,
456
+ "concurrently": false,
457
+ "method": "btree",
458
+ "with": {}
459
+ },
460
+ "audit_logs_created_at_idx": {
461
+ "name": "audit_logs_created_at_idx",
462
+ "columns": [
463
+ {
464
+ "expression": "created_at",
465
+ "isExpression": false,
466
+ "asc": true,
467
+ "nulls": "last"
468
+ }
469
+ ],
470
+ "isUnique": false,
471
+ "concurrently": false,
472
+ "method": "btree",
473
+ "with": {}
474
+ }
475
+ },
476
+ "foreignKeys": {},
477
+ "compositePrimaryKeys": {},
478
+ "uniqueConstraints": {},
479
+ "policies": {},
480
+ "checkConstraints": {},
481
+ "isRLSEnabled": false
482
+ },
483
+ "public.account": {
484
+ "name": "account",
485
+ "schema": "",
486
+ "columns": {
487
+ "id": {
488
+ "name": "id",
489
+ "type": "text",
490
+ "primaryKey": true,
491
+ "notNull": true
492
+ },
493
+ "account_id": {
494
+ "name": "account_id",
495
+ "type": "text",
496
+ "primaryKey": false,
497
+ "notNull": true
498
+ },
499
+ "provider_id": {
500
+ "name": "provider_id",
501
+ "type": "text",
502
+ "primaryKey": false,
503
+ "notNull": true
504
+ },
505
+ "user_id": {
506
+ "name": "user_id",
507
+ "type": "text",
508
+ "primaryKey": false,
509
+ "notNull": true
510
+ },
511
+ "access_token": {
512
+ "name": "access_token",
513
+ "type": "text",
514
+ "primaryKey": false,
515
+ "notNull": false
516
+ },
517
+ "refresh_token": {
518
+ "name": "refresh_token",
519
+ "type": "text",
520
+ "primaryKey": false,
521
+ "notNull": false
522
+ },
523
+ "id_token": {
524
+ "name": "id_token",
525
+ "type": "text",
526
+ "primaryKey": false,
527
+ "notNull": false
528
+ },
529
+ "access_token_expires_at": {
530
+ "name": "access_token_expires_at",
531
+ "type": "timestamp with time zone",
532
+ "primaryKey": false,
533
+ "notNull": false
534
+ },
535
+ "refresh_token_expires_at": {
536
+ "name": "refresh_token_expires_at",
537
+ "type": "timestamp with time zone",
538
+ "primaryKey": false,
539
+ "notNull": false
540
+ },
541
+ "scope": {
542
+ "name": "scope",
543
+ "type": "text",
544
+ "primaryKey": false,
545
+ "notNull": false
546
+ },
547
+ "password": {
548
+ "name": "password",
549
+ "type": "text",
550
+ "primaryKey": false,
551
+ "notNull": false
552
+ },
553
+ "created_at": {
554
+ "name": "created_at",
555
+ "type": "timestamp with time zone",
556
+ "primaryKey": false,
557
+ "notNull": true,
558
+ "default": "now()"
559
+ },
560
+ "updated_at": {
561
+ "name": "updated_at",
562
+ "type": "timestamp with time zone",
563
+ "primaryKey": false,
564
+ "notNull": true,
565
+ "default": "now()"
566
+ }
567
+ },
568
+ "indexes": {},
569
+ "foreignKeys": {
570
+ "account_user_id_user_id_fk": {
571
+ "name": "account_user_id_user_id_fk",
572
+ "tableFrom": "account",
573
+ "tableTo": "user",
574
+ "columnsFrom": [
575
+ "user_id"
576
+ ],
577
+ "columnsTo": [
578
+ "id"
579
+ ],
580
+ "onDelete": "cascade",
581
+ "onUpdate": "no action"
582
+ }
583
+ },
584
+ "compositePrimaryKeys": {},
585
+ "uniqueConstraints": {},
586
+ "policies": {},
587
+ "checkConstraints": {},
588
+ "isRLSEnabled": false
589
+ },
590
+ "public.invitation": {
591
+ "name": "invitation",
592
+ "schema": "",
593
+ "columns": {
594
+ "id": {
595
+ "name": "id",
596
+ "type": "text",
597
+ "primaryKey": true,
598
+ "notNull": true
599
+ },
600
+ "organization_id": {
601
+ "name": "organization_id",
602
+ "type": "text",
603
+ "primaryKey": false,
604
+ "notNull": true
605
+ },
606
+ "email": {
607
+ "name": "email",
608
+ "type": "text",
609
+ "primaryKey": false,
610
+ "notNull": true
611
+ },
612
+ "role": {
613
+ "name": "role",
614
+ "type": "text",
615
+ "primaryKey": false,
616
+ "notNull": false
617
+ },
618
+ "status": {
619
+ "name": "status",
620
+ "type": "text",
621
+ "primaryKey": false,
622
+ "notNull": true,
623
+ "default": "'pending'"
624
+ },
625
+ "expires_at": {
626
+ "name": "expires_at",
627
+ "type": "timestamp with time zone",
628
+ "primaryKey": false,
629
+ "notNull": true
630
+ },
631
+ "inviter_id": {
632
+ "name": "inviter_id",
633
+ "type": "text",
634
+ "primaryKey": false,
635
+ "notNull": true
636
+ },
637
+ "created_at": {
638
+ "name": "created_at",
639
+ "type": "timestamp with time zone",
640
+ "primaryKey": false,
641
+ "notNull": true,
642
+ "default": "now()"
643
+ },
644
+ "updated_at": {
645
+ "name": "updated_at",
646
+ "type": "timestamp with time zone",
647
+ "primaryKey": false,
648
+ "notNull": true,
649
+ "default": "now()"
650
+ }
651
+ },
652
+ "indexes": {},
653
+ "foreignKeys": {
654
+ "invitation_organization_id_organization_id_fk": {
655
+ "name": "invitation_organization_id_organization_id_fk",
656
+ "tableFrom": "invitation",
657
+ "tableTo": "organization",
658
+ "columnsFrom": [
659
+ "organization_id"
660
+ ],
661
+ "columnsTo": [
662
+ "id"
663
+ ],
664
+ "onDelete": "cascade",
665
+ "onUpdate": "no action"
666
+ },
667
+ "invitation_inviter_id_user_id_fk": {
668
+ "name": "invitation_inviter_id_user_id_fk",
669
+ "tableFrom": "invitation",
670
+ "tableTo": "user",
671
+ "columnsFrom": [
672
+ "inviter_id"
673
+ ],
674
+ "columnsTo": [
675
+ "id"
676
+ ],
677
+ "onDelete": "cascade",
678
+ "onUpdate": "no action"
679
+ }
680
+ },
681
+ "compositePrimaryKeys": {},
682
+ "uniqueConstraints": {},
683
+ "policies": {},
684
+ "checkConstraints": {},
685
+ "isRLSEnabled": false
686
+ },
687
+ "public.member": {
688
+ "name": "member",
689
+ "schema": "",
690
+ "columns": {
691
+ "id": {
692
+ "name": "id",
693
+ "type": "text",
694
+ "primaryKey": true,
695
+ "notNull": true
696
+ },
697
+ "organization_id": {
698
+ "name": "organization_id",
699
+ "type": "text",
700
+ "primaryKey": false,
701
+ "notNull": true
702
+ },
703
+ "user_id": {
704
+ "name": "user_id",
705
+ "type": "text",
706
+ "primaryKey": false,
707
+ "notNull": true
708
+ },
709
+ "role": {
710
+ "name": "role",
711
+ "type": "text",
712
+ "primaryKey": false,
713
+ "notNull": true,
714
+ "default": "'member'"
715
+ },
716
+ "created_at": {
717
+ "name": "created_at",
718
+ "type": "timestamp with time zone",
719
+ "primaryKey": false,
720
+ "notNull": true,
721
+ "default": "now()"
722
+ },
723
+ "updated_at": {
724
+ "name": "updated_at",
725
+ "type": "timestamp with time zone",
726
+ "primaryKey": false,
727
+ "notNull": true,
728
+ "default": "now()"
729
+ }
730
+ },
731
+ "indexes": {},
732
+ "foreignKeys": {
733
+ "member_organization_id_organization_id_fk": {
734
+ "name": "member_organization_id_organization_id_fk",
735
+ "tableFrom": "member",
736
+ "tableTo": "organization",
737
+ "columnsFrom": [
738
+ "organization_id"
739
+ ],
740
+ "columnsTo": [
741
+ "id"
742
+ ],
743
+ "onDelete": "cascade",
744
+ "onUpdate": "no action"
745
+ },
746
+ "member_user_id_user_id_fk": {
747
+ "name": "member_user_id_user_id_fk",
748
+ "tableFrom": "member",
749
+ "tableTo": "user",
750
+ "columnsFrom": [
751
+ "user_id"
752
+ ],
753
+ "columnsTo": [
754
+ "id"
755
+ ],
756
+ "onDelete": "cascade",
757
+ "onUpdate": "no action"
758
+ }
759
+ },
760
+ "compositePrimaryKeys": {},
761
+ "uniqueConstraints": {},
762
+ "policies": {},
763
+ "checkConstraints": {},
764
+ "isRLSEnabled": false
765
+ },
766
+ "public.organization": {
767
+ "name": "organization",
768
+ "schema": "",
769
+ "columns": {
770
+ "id": {
771
+ "name": "id",
772
+ "type": "text",
773
+ "primaryKey": true,
774
+ "notNull": true
775
+ },
776
+ "name": {
777
+ "name": "name",
778
+ "type": "text",
779
+ "primaryKey": false,
780
+ "notNull": true
781
+ },
782
+ "slug": {
783
+ "name": "slug",
784
+ "type": "text",
785
+ "primaryKey": false,
786
+ "notNull": false
787
+ },
788
+ "logo": {
789
+ "name": "logo",
790
+ "type": "text",
791
+ "primaryKey": false,
792
+ "notNull": false
793
+ },
794
+ "metadata": {
795
+ "name": "metadata",
796
+ "type": "text",
797
+ "primaryKey": false,
798
+ "notNull": false
799
+ },
800
+ "created_at": {
801
+ "name": "created_at",
802
+ "type": "timestamp with time zone",
803
+ "primaryKey": false,
804
+ "notNull": true,
805
+ "default": "now()"
806
+ },
807
+ "updated_at": {
808
+ "name": "updated_at",
809
+ "type": "timestamp with time zone",
810
+ "primaryKey": false,
811
+ "notNull": true,
812
+ "default": "now()"
813
+ }
814
+ },
815
+ "indexes": {},
816
+ "foreignKeys": {},
817
+ "compositePrimaryKeys": {},
818
+ "uniqueConstraints": {
819
+ "organization_slug_unique": {
820
+ "name": "organization_slug_unique",
821
+ "nullsNotDistinct": false,
822
+ "columns": [
823
+ "slug"
824
+ ]
825
+ }
826
+ },
827
+ "policies": {},
828
+ "checkConstraints": {},
829
+ "isRLSEnabled": false
830
+ },
831
+ "public.session": {
832
+ "name": "session",
833
+ "schema": "",
834
+ "columns": {
835
+ "id": {
836
+ "name": "id",
837
+ "type": "text",
838
+ "primaryKey": true,
839
+ "notNull": true
840
+ },
841
+ "expires_at": {
842
+ "name": "expires_at",
843
+ "type": "timestamp with time zone",
844
+ "primaryKey": false,
845
+ "notNull": true
846
+ },
847
+ "token": {
848
+ "name": "token",
849
+ "type": "text",
850
+ "primaryKey": false,
851
+ "notNull": true
852
+ },
853
+ "ip_address": {
854
+ "name": "ip_address",
855
+ "type": "text",
856
+ "primaryKey": false,
857
+ "notNull": false
858
+ },
859
+ "user_agent": {
860
+ "name": "user_agent",
861
+ "type": "text",
862
+ "primaryKey": false,
863
+ "notNull": false
864
+ },
865
+ "user_id": {
866
+ "name": "user_id",
867
+ "type": "text",
868
+ "primaryKey": false,
869
+ "notNull": true
870
+ },
871
+ "active_organization_id": {
872
+ "name": "active_organization_id",
873
+ "type": "text",
874
+ "primaryKey": false,
875
+ "notNull": false
876
+ },
877
+ "created_at": {
878
+ "name": "created_at",
879
+ "type": "timestamp with time zone",
880
+ "primaryKey": false,
881
+ "notNull": true,
882
+ "default": "now()"
883
+ },
884
+ "updated_at": {
885
+ "name": "updated_at",
886
+ "type": "timestamp with time zone",
887
+ "primaryKey": false,
888
+ "notNull": true,
889
+ "default": "now()"
890
+ }
891
+ },
892
+ "indexes": {},
893
+ "foreignKeys": {
894
+ "session_user_id_user_id_fk": {
895
+ "name": "session_user_id_user_id_fk",
896
+ "tableFrom": "session",
897
+ "tableTo": "user",
898
+ "columnsFrom": [
899
+ "user_id"
900
+ ],
901
+ "columnsTo": [
902
+ "id"
903
+ ],
904
+ "onDelete": "cascade",
905
+ "onUpdate": "no action"
906
+ }
907
+ },
908
+ "compositePrimaryKeys": {},
909
+ "uniqueConstraints": {
910
+ "session_token_unique": {
911
+ "name": "session_token_unique",
912
+ "nullsNotDistinct": false,
913
+ "columns": [
914
+ "token"
915
+ ]
916
+ }
917
+ },
918
+ "policies": {},
919
+ "checkConstraints": {},
920
+ "isRLSEnabled": false
921
+ },
922
+ "public.user": {
923
+ "name": "user",
924
+ "schema": "",
925
+ "columns": {
926
+ "id": {
927
+ "name": "id",
928
+ "type": "text",
929
+ "primaryKey": true,
930
+ "notNull": true
931
+ },
932
+ "name": {
933
+ "name": "name",
934
+ "type": "text",
935
+ "primaryKey": false,
936
+ "notNull": true
937
+ },
938
+ "email": {
939
+ "name": "email",
940
+ "type": "text",
941
+ "primaryKey": false,
942
+ "notNull": true
943
+ },
944
+ "email_verified": {
945
+ "name": "email_verified",
946
+ "type": "boolean",
947
+ "primaryKey": false,
948
+ "notNull": true,
949
+ "default": false
950
+ },
951
+ "image": {
952
+ "name": "image",
953
+ "type": "text",
954
+ "primaryKey": false,
955
+ "notNull": false
956
+ },
957
+ "created_at": {
958
+ "name": "created_at",
959
+ "type": "timestamp with time zone",
960
+ "primaryKey": false,
961
+ "notNull": true,
962
+ "default": "now()"
963
+ },
964
+ "updated_at": {
965
+ "name": "updated_at",
966
+ "type": "timestamp with time zone",
967
+ "primaryKey": false,
968
+ "notNull": true,
969
+ "default": "now()"
970
+ }
971
+ },
972
+ "indexes": {},
973
+ "foreignKeys": {},
974
+ "compositePrimaryKeys": {},
975
+ "uniqueConstraints": {
976
+ "user_email_unique": {
977
+ "name": "user_email_unique",
978
+ "nullsNotDistinct": false,
979
+ "columns": [
980
+ "email"
981
+ ]
982
+ }
983
+ },
984
+ "policies": {},
985
+ "checkConstraints": {},
986
+ "isRLSEnabled": false
987
+ },
988
+ "public.verification": {
989
+ "name": "verification",
990
+ "schema": "",
991
+ "columns": {
992
+ "id": {
993
+ "name": "id",
994
+ "type": "text",
995
+ "primaryKey": true,
996
+ "notNull": true
997
+ },
998
+ "identifier": {
999
+ "name": "identifier",
1000
+ "type": "text",
1001
+ "primaryKey": false,
1002
+ "notNull": true
1003
+ },
1004
+ "value": {
1005
+ "name": "value",
1006
+ "type": "text",
1007
+ "primaryKey": false,
1008
+ "notNull": true
1009
+ },
1010
+ "expires_at": {
1011
+ "name": "expires_at",
1012
+ "type": "timestamp with time zone",
1013
+ "primaryKey": false,
1014
+ "notNull": true
1015
+ },
1016
+ "created_at": {
1017
+ "name": "created_at",
1018
+ "type": "timestamp with time zone",
1019
+ "primaryKey": false,
1020
+ "notNull": true,
1021
+ "default": "now()"
1022
+ },
1023
+ "updated_at": {
1024
+ "name": "updated_at",
1025
+ "type": "timestamp with time zone",
1026
+ "primaryKey": false,
1027
+ "notNull": true,
1028
+ "default": "now()"
1029
+ }
1030
+ },
1031
+ "indexes": {},
1032
+ "foreignKeys": {},
1033
+ "compositePrimaryKeys": {},
1034
+ "uniqueConstraints": {},
1035
+ "policies": {},
1036
+ "checkConstraints": {},
1037
+ "isRLSEnabled": false
1038
+ },
1039
+ "public.contacts": {
1040
+ "name": "contacts",
1041
+ "schema": "",
1042
+ "columns": {
1043
+ "id": {
1044
+ "name": "id",
1045
+ "type": "uuid",
1046
+ "primaryKey": true,
1047
+ "notNull": true,
1048
+ "default": "gen_random_uuid()"
1049
+ },
1050
+ "organization_id": {
1051
+ "name": "organization_id",
1052
+ "type": "text",
1053
+ "primaryKey": false,
1054
+ "notNull": false
1055
+ },
1056
+ "external_id": {
1057
+ "name": "external_id",
1058
+ "type": "text",
1059
+ "primaryKey": false,
1060
+ "notNull": true
1061
+ },
1062
+ "email": {
1063
+ "name": "email",
1064
+ "type": "text",
1065
+ "primaryKey": false,
1066
+ "notNull": false
1067
+ },
1068
+ "properties": {
1069
+ "name": "properties",
1070
+ "type": "jsonb",
1071
+ "primaryKey": false,
1072
+ "notNull": false,
1073
+ "default": "'{}'::jsonb"
1074
+ },
1075
+ "first_seen_at": {
1076
+ "name": "first_seen_at",
1077
+ "type": "timestamp with time zone",
1078
+ "primaryKey": false,
1079
+ "notNull": true,
1080
+ "default": "now()"
1081
+ },
1082
+ "last_seen_at": {
1083
+ "name": "last_seen_at",
1084
+ "type": "timestamp with time zone",
1085
+ "primaryKey": false,
1086
+ "notNull": true,
1087
+ "default": "now()"
1088
+ },
1089
+ "deleted_at": {
1090
+ "name": "deleted_at",
1091
+ "type": "timestamp with time zone",
1092
+ "primaryKey": false,
1093
+ "notNull": false
1094
+ },
1095
+ "created_at": {
1096
+ "name": "created_at",
1097
+ "type": "timestamp with time zone",
1098
+ "primaryKey": false,
1099
+ "notNull": true,
1100
+ "default": "now()"
1101
+ },
1102
+ "updated_at": {
1103
+ "name": "updated_at",
1104
+ "type": "timestamp with time zone",
1105
+ "primaryKey": false,
1106
+ "notNull": true,
1107
+ "default": "now()"
1108
+ }
1109
+ },
1110
+ "indexes": {
1111
+ "contacts_email_idx": {
1112
+ "name": "contacts_email_idx",
1113
+ "columns": [
1114
+ {
1115
+ "expression": "email",
1116
+ "isExpression": false,
1117
+ "asc": true,
1118
+ "nulls": "last"
1119
+ }
1120
+ ],
1121
+ "isUnique": false,
1122
+ "concurrently": false,
1123
+ "method": "btree",
1124
+ "with": {}
1125
+ }
1126
+ },
1127
+ "foreignKeys": {},
1128
+ "compositePrimaryKeys": {},
1129
+ "uniqueConstraints": {
1130
+ "contacts_external_id_unique": {
1131
+ "name": "contacts_external_id_unique",
1132
+ "nullsNotDistinct": false,
1133
+ "columns": [
1134
+ "external_id"
1135
+ ]
1136
+ }
1137
+ },
1138
+ "policies": {},
1139
+ "checkConstraints": {},
1140
+ "isRLSEnabled": false
1141
+ },
1142
+ "public.dead_letter_queue": {
1143
+ "name": "dead_letter_queue",
1144
+ "schema": "",
1145
+ "columns": {
1146
+ "id": {
1147
+ "name": "id",
1148
+ "type": "uuid",
1149
+ "primaryKey": true,
1150
+ "notNull": true,
1151
+ "default": "gen_random_uuid()"
1152
+ },
1153
+ "source": {
1154
+ "name": "source",
1155
+ "type": "text",
1156
+ "primaryKey": false,
1157
+ "notNull": true
1158
+ },
1159
+ "source_id": {
1160
+ "name": "source_id",
1161
+ "type": "text",
1162
+ "primaryKey": false,
1163
+ "notNull": false
1164
+ },
1165
+ "payload": {
1166
+ "name": "payload",
1167
+ "type": "jsonb",
1168
+ "primaryKey": false,
1169
+ "notNull": true
1170
+ },
1171
+ "error": {
1172
+ "name": "error",
1173
+ "type": "text",
1174
+ "primaryKey": false,
1175
+ "notNull": true
1176
+ },
1177
+ "retry_count": {
1178
+ "name": "retry_count",
1179
+ "type": "integer",
1180
+ "primaryKey": false,
1181
+ "notNull": true,
1182
+ "default": 0
1183
+ },
1184
+ "status": {
1185
+ "name": "status",
1186
+ "type": "dlq_status",
1187
+ "typeSchema": "public",
1188
+ "primaryKey": false,
1189
+ "notNull": true,
1190
+ "default": "'pending'"
1191
+ },
1192
+ "retried_at": {
1193
+ "name": "retried_at",
1194
+ "type": "timestamp with time zone",
1195
+ "primaryKey": false,
1196
+ "notNull": false
1197
+ },
1198
+ "created_at": {
1199
+ "name": "created_at",
1200
+ "type": "timestamp with time zone",
1201
+ "primaryKey": false,
1202
+ "notNull": true,
1203
+ "default": "now()"
1204
+ },
1205
+ "updated_at": {
1206
+ "name": "updated_at",
1207
+ "type": "timestamp with time zone",
1208
+ "primaryKey": false,
1209
+ "notNull": true,
1210
+ "default": "now()"
1211
+ }
1212
+ },
1213
+ "indexes": {
1214
+ "dlq_source_idx": {
1215
+ "name": "dlq_source_idx",
1216
+ "columns": [
1217
+ {
1218
+ "expression": "source",
1219
+ "isExpression": false,
1220
+ "asc": true,
1221
+ "nulls": "last"
1222
+ }
1223
+ ],
1224
+ "isUnique": false,
1225
+ "concurrently": false,
1226
+ "method": "btree",
1227
+ "with": {}
1228
+ },
1229
+ "dlq_status_idx": {
1230
+ "name": "dlq_status_idx",
1231
+ "columns": [
1232
+ {
1233
+ "expression": "status",
1234
+ "isExpression": false,
1235
+ "asc": true,
1236
+ "nulls": "last"
1237
+ }
1238
+ ],
1239
+ "isUnique": false,
1240
+ "concurrently": false,
1241
+ "method": "btree",
1242
+ "with": {}
1243
+ },
1244
+ "dlq_created_at_idx": {
1245
+ "name": "dlq_created_at_idx",
1246
+ "columns": [
1247
+ {
1248
+ "expression": "created_at",
1249
+ "isExpression": false,
1250
+ "asc": true,
1251
+ "nulls": "last"
1252
+ }
1253
+ ],
1254
+ "isUnique": false,
1255
+ "concurrently": false,
1256
+ "method": "btree",
1257
+ "with": {}
1258
+ }
1259
+ },
1260
+ "foreignKeys": {},
1261
+ "compositePrimaryKeys": {},
1262
+ "uniqueConstraints": {},
1263
+ "policies": {},
1264
+ "checkConstraints": {},
1265
+ "isRLSEnabled": false
1266
+ },
1267
+ "public.email_preferences": {
1268
+ "name": "email_preferences",
1269
+ "schema": "",
1270
+ "columns": {
1271
+ "id": {
1272
+ "name": "id",
1273
+ "type": "uuid",
1274
+ "primaryKey": true,
1275
+ "notNull": true,
1276
+ "default": "gen_random_uuid()"
1277
+ },
1278
+ "user_id": {
1279
+ "name": "user_id",
1280
+ "type": "text",
1281
+ "primaryKey": false,
1282
+ "notNull": true
1283
+ },
1284
+ "email": {
1285
+ "name": "email",
1286
+ "type": "text",
1287
+ "primaryKey": false,
1288
+ "notNull": true
1289
+ },
1290
+ "unsubscribed_all": {
1291
+ "name": "unsubscribed_all",
1292
+ "type": "boolean",
1293
+ "primaryKey": false,
1294
+ "notNull": true,
1295
+ "default": false
1296
+ },
1297
+ "suppressed": {
1298
+ "name": "suppressed",
1299
+ "type": "boolean",
1300
+ "primaryKey": false,
1301
+ "notNull": true,
1302
+ "default": false
1303
+ },
1304
+ "bounce_count": {
1305
+ "name": "bounce_count",
1306
+ "type": "integer",
1307
+ "primaryKey": false,
1308
+ "notNull": true,
1309
+ "default": 0
1310
+ },
1311
+ "categories": {
1312
+ "name": "categories",
1313
+ "type": "jsonb",
1314
+ "primaryKey": false,
1315
+ "notNull": false,
1316
+ "default": "'{}'::jsonb"
1317
+ },
1318
+ "suppressed_at": {
1319
+ "name": "suppressed_at",
1320
+ "type": "timestamp with time zone",
1321
+ "primaryKey": false,
1322
+ "notNull": false
1323
+ },
1324
+ "last_bounce_at": {
1325
+ "name": "last_bounce_at",
1326
+ "type": "timestamp with time zone",
1327
+ "primaryKey": false,
1328
+ "notNull": false
1329
+ },
1330
+ "created_at": {
1331
+ "name": "created_at",
1332
+ "type": "timestamp with time zone",
1333
+ "primaryKey": false,
1334
+ "notNull": true,
1335
+ "default": "now()"
1336
+ },
1337
+ "updated_at": {
1338
+ "name": "updated_at",
1339
+ "type": "timestamp with time zone",
1340
+ "primaryKey": false,
1341
+ "notNull": true,
1342
+ "default": "now()"
1343
+ }
1344
+ },
1345
+ "indexes": {
1346
+ "email_preferences_user_email_idx": {
1347
+ "name": "email_preferences_user_email_idx",
1348
+ "columns": [
1349
+ {
1350
+ "expression": "user_id",
1351
+ "isExpression": false,
1352
+ "asc": true,
1353
+ "nulls": "last"
1354
+ },
1355
+ {
1356
+ "expression": "email",
1357
+ "isExpression": false,
1358
+ "asc": true,
1359
+ "nulls": "last"
1360
+ }
1361
+ ],
1362
+ "isUnique": true,
1363
+ "concurrently": false,
1364
+ "method": "btree",
1365
+ "with": {}
1366
+ }
1367
+ },
1368
+ "foreignKeys": {},
1369
+ "compositePrimaryKeys": {},
1370
+ "uniqueConstraints": {},
1371
+ "policies": {},
1372
+ "checkConstraints": {},
1373
+ "isRLSEnabled": false
1374
+ },
1375
+ "public.email_sends": {
1376
+ "name": "email_sends",
1377
+ "schema": "",
1378
+ "columns": {
1379
+ "id": {
1380
+ "name": "id",
1381
+ "type": "uuid",
1382
+ "primaryKey": true,
1383
+ "notNull": true,
1384
+ "default": "gen_random_uuid()"
1385
+ },
1386
+ "organization_id": {
1387
+ "name": "organization_id",
1388
+ "type": "text",
1389
+ "primaryKey": false,
1390
+ "notNull": false
1391
+ },
1392
+ "journey_state_id": {
1393
+ "name": "journey_state_id",
1394
+ "type": "uuid",
1395
+ "primaryKey": false,
1396
+ "notNull": false
1397
+ },
1398
+ "template_key": {
1399
+ "name": "template_key",
1400
+ "type": "text",
1401
+ "primaryKey": false,
1402
+ "notNull": false
1403
+ },
1404
+ "resend_id": {
1405
+ "name": "resend_id",
1406
+ "type": "text",
1407
+ "primaryKey": false,
1408
+ "notNull": false
1409
+ },
1410
+ "from_email": {
1411
+ "name": "from_email",
1412
+ "type": "text",
1413
+ "primaryKey": false,
1414
+ "notNull": true
1415
+ },
1416
+ "to_email": {
1417
+ "name": "to_email",
1418
+ "type": "text",
1419
+ "primaryKey": false,
1420
+ "notNull": true
1421
+ },
1422
+ "subject": {
1423
+ "name": "subject",
1424
+ "type": "text",
1425
+ "primaryKey": false,
1426
+ "notNull": true
1427
+ },
1428
+ "category": {
1429
+ "name": "category",
1430
+ "type": "text",
1431
+ "primaryKey": false,
1432
+ "notNull": false
1433
+ },
1434
+ "status": {
1435
+ "name": "status",
1436
+ "type": "email_send_status",
1437
+ "typeSchema": "public",
1438
+ "primaryKey": false,
1439
+ "notNull": true,
1440
+ "default": "'queued'"
1441
+ },
1442
+ "sent_at": {
1443
+ "name": "sent_at",
1444
+ "type": "timestamp with time zone",
1445
+ "primaryKey": false,
1446
+ "notNull": false
1447
+ },
1448
+ "delivered_at": {
1449
+ "name": "delivered_at",
1450
+ "type": "timestamp with time zone",
1451
+ "primaryKey": false,
1452
+ "notNull": false
1453
+ },
1454
+ "opened_at": {
1455
+ "name": "opened_at",
1456
+ "type": "timestamp with time zone",
1457
+ "primaryKey": false,
1458
+ "notNull": false
1459
+ },
1460
+ "clicked_at": {
1461
+ "name": "clicked_at",
1462
+ "type": "timestamp with time zone",
1463
+ "primaryKey": false,
1464
+ "notNull": false
1465
+ },
1466
+ "bounced_at": {
1467
+ "name": "bounced_at",
1468
+ "type": "timestamp with time zone",
1469
+ "primaryKey": false,
1470
+ "notNull": false
1471
+ },
1472
+ "complained_at": {
1473
+ "name": "complained_at",
1474
+ "type": "timestamp with time zone",
1475
+ "primaryKey": false,
1476
+ "notNull": false
1477
+ },
1478
+ "created_at": {
1479
+ "name": "created_at",
1480
+ "type": "timestamp with time zone",
1481
+ "primaryKey": false,
1482
+ "notNull": true,
1483
+ "default": "now()"
1484
+ },
1485
+ "updated_at": {
1486
+ "name": "updated_at",
1487
+ "type": "timestamp with time zone",
1488
+ "primaryKey": false,
1489
+ "notNull": true,
1490
+ "default": "now()"
1491
+ }
1492
+ },
1493
+ "indexes": {
1494
+ "email_sends_to_email_idx": {
1495
+ "name": "email_sends_to_email_idx",
1496
+ "columns": [
1497
+ {
1498
+ "expression": "to_email",
1499
+ "isExpression": false,
1500
+ "asc": true,
1501
+ "nulls": "last"
1502
+ }
1503
+ ],
1504
+ "isUnique": false,
1505
+ "concurrently": false,
1506
+ "method": "btree",
1507
+ "with": {}
1508
+ },
1509
+ "email_sends_template_key_idx": {
1510
+ "name": "email_sends_template_key_idx",
1511
+ "columns": [
1512
+ {
1513
+ "expression": "template_key",
1514
+ "isExpression": false,
1515
+ "asc": true,
1516
+ "nulls": "last"
1517
+ }
1518
+ ],
1519
+ "isUnique": false,
1520
+ "concurrently": false,
1521
+ "method": "btree",
1522
+ "with": {}
1523
+ },
1524
+ "email_sends_status_idx": {
1525
+ "name": "email_sends_status_idx",
1526
+ "columns": [
1527
+ {
1528
+ "expression": "status",
1529
+ "isExpression": false,
1530
+ "asc": true,
1531
+ "nulls": "last"
1532
+ }
1533
+ ],
1534
+ "isUnique": false,
1535
+ "concurrently": false,
1536
+ "method": "btree",
1537
+ "with": {}
1538
+ },
1539
+ "email_sends_created_at_idx": {
1540
+ "name": "email_sends_created_at_idx",
1541
+ "columns": [
1542
+ {
1543
+ "expression": "created_at",
1544
+ "isExpression": false,
1545
+ "asc": true,
1546
+ "nulls": "last"
1547
+ }
1548
+ ],
1549
+ "isUnique": false,
1550
+ "concurrently": false,
1551
+ "method": "btree",
1552
+ "with": {}
1553
+ },
1554
+ "email_sends_journey_state_id_idx": {
1555
+ "name": "email_sends_journey_state_id_idx",
1556
+ "columns": [
1557
+ {
1558
+ "expression": "journey_state_id",
1559
+ "isExpression": false,
1560
+ "asc": true,
1561
+ "nulls": "last"
1562
+ }
1563
+ ],
1564
+ "isUnique": false,
1565
+ "concurrently": false,
1566
+ "method": "btree",
1567
+ "with": {}
1568
+ }
1569
+ },
1570
+ "foreignKeys": {
1571
+ "email_sends_journey_state_id_journey_states_id_fk": {
1572
+ "name": "email_sends_journey_state_id_journey_states_id_fk",
1573
+ "tableFrom": "email_sends",
1574
+ "tableTo": "journey_states",
1575
+ "columnsFrom": [
1576
+ "journey_state_id"
1577
+ ],
1578
+ "columnsTo": [
1579
+ "id"
1580
+ ],
1581
+ "onDelete": "no action",
1582
+ "onUpdate": "no action"
1583
+ }
1584
+ },
1585
+ "compositePrimaryKeys": {},
1586
+ "uniqueConstraints": {},
1587
+ "policies": {},
1588
+ "checkConstraints": {},
1589
+ "isRLSEnabled": false
1590
+ },
1591
+ "public.import_jobs": {
1592
+ "name": "import_jobs",
1593
+ "schema": "",
1594
+ "columns": {
1595
+ "id": {
1596
+ "name": "id",
1597
+ "type": "uuid",
1598
+ "primaryKey": true,
1599
+ "notNull": true,
1600
+ "default": "gen_random_uuid()"
1601
+ },
1602
+ "file_name": {
1603
+ "name": "file_name",
1604
+ "type": "text",
1605
+ "primaryKey": false,
1606
+ "notNull": false
1607
+ },
1608
+ "format": {
1609
+ "name": "format",
1610
+ "type": "text",
1611
+ "primaryKey": false,
1612
+ "notNull": true
1613
+ },
1614
+ "status": {
1615
+ "name": "status",
1616
+ "type": "import_job_status",
1617
+ "typeSchema": "public",
1618
+ "primaryKey": false,
1619
+ "notNull": true,
1620
+ "default": "'pending'"
1621
+ },
1622
+ "total_rows": {
1623
+ "name": "total_rows",
1624
+ "type": "integer",
1625
+ "primaryKey": false,
1626
+ "notNull": false
1627
+ },
1628
+ "processed_rows": {
1629
+ "name": "processed_rows",
1630
+ "type": "integer",
1631
+ "primaryKey": false,
1632
+ "notNull": true,
1633
+ "default": 0
1634
+ },
1635
+ "failed_rows": {
1636
+ "name": "failed_rows",
1637
+ "type": "integer",
1638
+ "primaryKey": false,
1639
+ "notNull": true,
1640
+ "default": 0
1641
+ },
1642
+ "errors": {
1643
+ "name": "errors",
1644
+ "type": "jsonb",
1645
+ "primaryKey": false,
1646
+ "notNull": false
1647
+ },
1648
+ "created_at": {
1649
+ "name": "created_at",
1650
+ "type": "timestamp with time zone",
1651
+ "primaryKey": false,
1652
+ "notNull": true,
1653
+ "default": "now()"
1654
+ },
1655
+ "updated_at": {
1656
+ "name": "updated_at",
1657
+ "type": "timestamp with time zone",
1658
+ "primaryKey": false,
1659
+ "notNull": true,
1660
+ "default": "now()"
1661
+ }
1662
+ },
1663
+ "indexes": {
1664
+ "import_jobs_status_idx": {
1665
+ "name": "import_jobs_status_idx",
1666
+ "columns": [
1667
+ {
1668
+ "expression": "status",
1669
+ "isExpression": false,
1670
+ "asc": true,
1671
+ "nulls": "last"
1672
+ }
1673
+ ],
1674
+ "isUnique": false,
1675
+ "concurrently": false,
1676
+ "method": "btree",
1677
+ "with": {}
1678
+ }
1679
+ },
1680
+ "foreignKeys": {},
1681
+ "compositePrimaryKeys": {},
1682
+ "uniqueConstraints": {},
1683
+ "policies": {},
1684
+ "checkConstraints": {},
1685
+ "isRLSEnabled": false
1686
+ },
1687
+ "public.journey_configs": {
1688
+ "name": "journey_configs",
1689
+ "schema": "",
1690
+ "columns": {
1691
+ "id": {
1692
+ "name": "id",
1693
+ "type": "uuid",
1694
+ "primaryKey": true,
1695
+ "notNull": true,
1696
+ "default": "gen_random_uuid()"
1697
+ },
1698
+ "journey_id": {
1699
+ "name": "journey_id",
1700
+ "type": "text",
1701
+ "primaryKey": false,
1702
+ "notNull": true
1703
+ },
1704
+ "enabled": {
1705
+ "name": "enabled",
1706
+ "type": "boolean",
1707
+ "primaryKey": false,
1708
+ "notNull": true,
1709
+ "default": true
1710
+ },
1711
+ "created_at": {
1712
+ "name": "created_at",
1713
+ "type": "timestamp with time zone",
1714
+ "primaryKey": false,
1715
+ "notNull": true,
1716
+ "default": "now()"
1717
+ },
1718
+ "updated_at": {
1719
+ "name": "updated_at",
1720
+ "type": "timestamp with time zone",
1721
+ "primaryKey": false,
1722
+ "notNull": true,
1723
+ "default": "now()"
1724
+ }
1725
+ },
1726
+ "indexes": {
1727
+ "journey_configs_journey_id_idx": {
1728
+ "name": "journey_configs_journey_id_idx",
1729
+ "columns": [
1730
+ {
1731
+ "expression": "journey_id",
1732
+ "isExpression": false,
1733
+ "asc": true,
1734
+ "nulls": "last"
1735
+ }
1736
+ ],
1737
+ "isUnique": true,
1738
+ "concurrently": false,
1739
+ "method": "btree",
1740
+ "with": {}
1741
+ }
1742
+ },
1743
+ "foreignKeys": {},
1744
+ "compositePrimaryKeys": {},
1745
+ "uniqueConstraints": {},
1746
+ "policies": {},
1747
+ "checkConstraints": {},
1748
+ "isRLSEnabled": false
1749
+ },
1750
+ "public.journey_logs": {
1751
+ "name": "journey_logs",
1752
+ "schema": "",
1753
+ "columns": {
1754
+ "id": {
1755
+ "name": "id",
1756
+ "type": "uuid",
1757
+ "primaryKey": true,
1758
+ "notNull": true,
1759
+ "default": "gen_random_uuid()"
1760
+ },
1761
+ "journey_state_id": {
1762
+ "name": "journey_state_id",
1763
+ "type": "uuid",
1764
+ "primaryKey": false,
1765
+ "notNull": true
1766
+ },
1767
+ "from_node_id": {
1768
+ "name": "from_node_id",
1769
+ "type": "text",
1770
+ "primaryKey": false,
1771
+ "notNull": false
1772
+ },
1773
+ "to_node_id": {
1774
+ "name": "to_node_id",
1775
+ "type": "text",
1776
+ "primaryKey": false,
1777
+ "notNull": false
1778
+ },
1779
+ "action": {
1780
+ "name": "action",
1781
+ "type": "text",
1782
+ "primaryKey": false,
1783
+ "notNull": true
1784
+ },
1785
+ "detail": {
1786
+ "name": "detail",
1787
+ "type": "jsonb",
1788
+ "primaryKey": false,
1789
+ "notNull": false
1790
+ },
1791
+ "created_at": {
1792
+ "name": "created_at",
1793
+ "type": "timestamp with time zone",
1794
+ "primaryKey": false,
1795
+ "notNull": true,
1796
+ "default": "now()"
1797
+ },
1798
+ "updated_at": {
1799
+ "name": "updated_at",
1800
+ "type": "timestamp with time zone",
1801
+ "primaryKey": false,
1802
+ "notNull": true,
1803
+ "default": "now()"
1804
+ }
1805
+ },
1806
+ "indexes": {
1807
+ "journey_logs_journey_state_id_idx": {
1808
+ "name": "journey_logs_journey_state_id_idx",
1809
+ "columns": [
1810
+ {
1811
+ "expression": "journey_state_id",
1812
+ "isExpression": false,
1813
+ "asc": true,
1814
+ "nulls": "last"
1815
+ }
1816
+ ],
1817
+ "isUnique": false,
1818
+ "concurrently": false,
1819
+ "method": "btree",
1820
+ "with": {}
1821
+ }
1822
+ },
1823
+ "foreignKeys": {
1824
+ "journey_logs_journey_state_id_journey_states_id_fk": {
1825
+ "name": "journey_logs_journey_state_id_journey_states_id_fk",
1826
+ "tableFrom": "journey_logs",
1827
+ "tableTo": "journey_states",
1828
+ "columnsFrom": [
1829
+ "journey_state_id"
1830
+ ],
1831
+ "columnsTo": [
1832
+ "id"
1833
+ ],
1834
+ "onDelete": "cascade",
1835
+ "onUpdate": "no action"
1836
+ }
1837
+ },
1838
+ "compositePrimaryKeys": {},
1839
+ "uniqueConstraints": {},
1840
+ "policies": {},
1841
+ "checkConstraints": {},
1842
+ "isRLSEnabled": false
1843
+ },
1844
+ "public.journey_states": {
1845
+ "name": "journey_states",
1846
+ "schema": "",
1847
+ "columns": {
1848
+ "id": {
1849
+ "name": "id",
1850
+ "type": "uuid",
1851
+ "primaryKey": true,
1852
+ "notNull": true,
1853
+ "default": "gen_random_uuid()"
1854
+ },
1855
+ "organization_id": {
1856
+ "name": "organization_id",
1857
+ "type": "text",
1858
+ "primaryKey": false,
1859
+ "notNull": false
1860
+ },
1861
+ "user_id": {
1862
+ "name": "user_id",
1863
+ "type": "text",
1864
+ "primaryKey": false,
1865
+ "notNull": true
1866
+ },
1867
+ "user_email": {
1868
+ "name": "user_email",
1869
+ "type": "text",
1870
+ "primaryKey": false,
1871
+ "notNull": true
1872
+ },
1873
+ "journey_id": {
1874
+ "name": "journey_id",
1875
+ "type": "text",
1876
+ "primaryKey": false,
1877
+ "notNull": true
1878
+ },
1879
+ "current_node_id": {
1880
+ "name": "current_node_id",
1881
+ "type": "text",
1882
+ "primaryKey": false,
1883
+ "notNull": true
1884
+ },
1885
+ "status": {
1886
+ "name": "status",
1887
+ "type": "journey_status",
1888
+ "typeSchema": "public",
1889
+ "primaryKey": false,
1890
+ "notNull": true,
1891
+ "default": "'active'"
1892
+ },
1893
+ "hatchet_run_id": {
1894
+ "name": "hatchet_run_id",
1895
+ "type": "text",
1896
+ "primaryKey": false,
1897
+ "notNull": false
1898
+ },
1899
+ "context": {
1900
+ "name": "context",
1901
+ "type": "jsonb",
1902
+ "primaryKey": false,
1903
+ "notNull": false,
1904
+ "default": "'{}'::jsonb"
1905
+ },
1906
+ "error_message": {
1907
+ "name": "error_message",
1908
+ "type": "text",
1909
+ "primaryKey": false,
1910
+ "notNull": false
1911
+ },
1912
+ "entry_count": {
1913
+ "name": "entry_count",
1914
+ "type": "integer",
1915
+ "primaryKey": false,
1916
+ "notNull": true,
1917
+ "default": 1
1918
+ },
1919
+ "completed_at": {
1920
+ "name": "completed_at",
1921
+ "type": "timestamp with time zone",
1922
+ "primaryKey": false,
1923
+ "notNull": false
1924
+ },
1925
+ "exited_at": {
1926
+ "name": "exited_at",
1927
+ "type": "timestamp with time zone",
1928
+ "primaryKey": false,
1929
+ "notNull": false
1930
+ },
1931
+ "deleted_at": {
1932
+ "name": "deleted_at",
1933
+ "type": "timestamp with time zone",
1934
+ "primaryKey": false,
1935
+ "notNull": false
1936
+ },
1937
+ "created_at": {
1938
+ "name": "created_at",
1939
+ "type": "timestamp with time zone",
1940
+ "primaryKey": false,
1941
+ "notNull": true,
1942
+ "default": "now()"
1943
+ },
1944
+ "updated_at": {
1945
+ "name": "updated_at",
1946
+ "type": "timestamp with time zone",
1947
+ "primaryKey": false,
1948
+ "notNull": true,
1949
+ "default": "now()"
1950
+ }
1951
+ },
1952
+ "indexes": {
1953
+ "uq_user_journey_active": {
1954
+ "name": "uq_user_journey_active",
1955
+ "columns": [
1956
+ {
1957
+ "expression": "user_id",
1958
+ "isExpression": false,
1959
+ "asc": true,
1960
+ "nulls": "last"
1961
+ },
1962
+ {
1963
+ "expression": "journey_id",
1964
+ "isExpression": false,
1965
+ "asc": true,
1966
+ "nulls": "last"
1967
+ },
1968
+ {
1969
+ "expression": "status",
1970
+ "isExpression": false,
1971
+ "asc": true,
1972
+ "nulls": "last"
1973
+ }
1974
+ ],
1975
+ "isUnique": true,
1976
+ "concurrently": false,
1977
+ "method": "btree",
1978
+ "with": {}
1979
+ },
1980
+ "journey_states_status_idx": {
1981
+ "name": "journey_states_status_idx",
1982
+ "columns": [
1983
+ {
1984
+ "expression": "status",
1985
+ "isExpression": false,
1986
+ "asc": true,
1987
+ "nulls": "last"
1988
+ }
1989
+ ],
1990
+ "isUnique": false,
1991
+ "concurrently": false,
1992
+ "method": "btree",
1993
+ "with": {}
1994
+ },
1995
+ "journey_states_hatchet_run_idx": {
1996
+ "name": "journey_states_hatchet_run_idx",
1997
+ "columns": [
1998
+ {
1999
+ "expression": "hatchet_run_id",
2000
+ "isExpression": false,
2001
+ "asc": true,
2002
+ "nulls": "last"
2003
+ }
2004
+ ],
2005
+ "isUnique": false,
2006
+ "concurrently": false,
2007
+ "method": "btree",
2008
+ "with": {}
2009
+ },
2010
+ "journey_states_user_id_idx": {
2011
+ "name": "journey_states_user_id_idx",
2012
+ "columns": [
2013
+ {
2014
+ "expression": "user_id",
2015
+ "isExpression": false,
2016
+ "asc": true,
2017
+ "nulls": "last"
2018
+ }
2019
+ ],
2020
+ "isUnique": false,
2021
+ "concurrently": false,
2022
+ "method": "btree",
2023
+ "with": {}
2024
+ },
2025
+ "journey_states_journey_id_status_idx": {
2026
+ "name": "journey_states_journey_id_status_idx",
2027
+ "columns": [
2028
+ {
2029
+ "expression": "journey_id",
2030
+ "isExpression": false,
2031
+ "asc": true,
2032
+ "nulls": "last"
2033
+ },
2034
+ {
2035
+ "expression": "status",
2036
+ "isExpression": false,
2037
+ "asc": true,
2038
+ "nulls": "last"
2039
+ }
2040
+ ],
2041
+ "isUnique": false,
2042
+ "concurrently": false,
2043
+ "method": "btree",
2044
+ "with": {}
2045
+ }
2046
+ },
2047
+ "foreignKeys": {},
2048
+ "compositePrimaryKeys": {},
2049
+ "uniqueConstraints": {},
2050
+ "policies": {},
2051
+ "checkConstraints": {},
2052
+ "isRLSEnabled": false
2053
+ },
2054
+ "public.link_clicks": {
2055
+ "name": "link_clicks",
2056
+ "schema": "",
2057
+ "columns": {
2058
+ "id": {
2059
+ "name": "id",
2060
+ "type": "uuid",
2061
+ "primaryKey": true,
2062
+ "notNull": true,
2063
+ "default": "gen_random_uuid()"
2064
+ },
2065
+ "tracked_link_id": {
2066
+ "name": "tracked_link_id",
2067
+ "type": "uuid",
2068
+ "primaryKey": false,
2069
+ "notNull": true
2070
+ },
2071
+ "ip_address": {
2072
+ "name": "ip_address",
2073
+ "type": "text",
2074
+ "primaryKey": false,
2075
+ "notNull": false
2076
+ },
2077
+ "user_agent": {
2078
+ "name": "user_agent",
2079
+ "type": "text",
2080
+ "primaryKey": false,
2081
+ "notNull": false
2082
+ },
2083
+ "clicked_at": {
2084
+ "name": "clicked_at",
2085
+ "type": "timestamp with time zone",
2086
+ "primaryKey": false,
2087
+ "notNull": true,
2088
+ "default": "now()"
2089
+ }
2090
+ },
2091
+ "indexes": {
2092
+ "link_clicks_tracked_link_id_idx": {
2093
+ "name": "link_clicks_tracked_link_id_idx",
2094
+ "columns": [
2095
+ {
2096
+ "expression": "tracked_link_id",
2097
+ "isExpression": false,
2098
+ "asc": true,
2099
+ "nulls": "last"
2100
+ }
2101
+ ],
2102
+ "isUnique": false,
2103
+ "concurrently": false,
2104
+ "method": "btree",
2105
+ "with": {}
2106
+ },
2107
+ "link_clicks_clicked_at_idx": {
2108
+ "name": "link_clicks_clicked_at_idx",
2109
+ "columns": [
2110
+ {
2111
+ "expression": "clicked_at",
2112
+ "isExpression": false,
2113
+ "asc": true,
2114
+ "nulls": "last"
2115
+ }
2116
+ ],
2117
+ "isUnique": false,
2118
+ "concurrently": false,
2119
+ "method": "btree",
2120
+ "with": {}
2121
+ }
2122
+ },
2123
+ "foreignKeys": {
2124
+ "link_clicks_tracked_link_id_tracked_links_id_fk": {
2125
+ "name": "link_clicks_tracked_link_id_tracked_links_id_fk",
2126
+ "tableFrom": "link_clicks",
2127
+ "tableTo": "tracked_links",
2128
+ "columnsFrom": [
2129
+ "tracked_link_id"
2130
+ ],
2131
+ "columnsTo": [
2132
+ "id"
2133
+ ],
2134
+ "onDelete": "cascade",
2135
+ "onUpdate": "no action"
2136
+ }
2137
+ },
2138
+ "compositePrimaryKeys": {},
2139
+ "uniqueConstraints": {},
2140
+ "policies": {},
2141
+ "checkConstraints": {},
2142
+ "isRLSEnabled": false
2143
+ },
2144
+ "public.tracked_links": {
2145
+ "name": "tracked_links",
2146
+ "schema": "",
2147
+ "columns": {
2148
+ "id": {
2149
+ "name": "id",
2150
+ "type": "uuid",
2151
+ "primaryKey": true,
2152
+ "notNull": true,
2153
+ "default": "gen_random_uuid()"
2154
+ },
2155
+ "email_send_id": {
2156
+ "name": "email_send_id",
2157
+ "type": "uuid",
2158
+ "primaryKey": false,
2159
+ "notNull": true
2160
+ },
2161
+ "original_url": {
2162
+ "name": "original_url",
2163
+ "type": "text",
2164
+ "primaryKey": false,
2165
+ "notNull": true
2166
+ },
2167
+ "click_count": {
2168
+ "name": "click_count",
2169
+ "type": "integer",
2170
+ "primaryKey": false,
2171
+ "notNull": true,
2172
+ "default": 0
2173
+ },
2174
+ "created_at": {
2175
+ "name": "created_at",
2176
+ "type": "timestamp with time zone",
2177
+ "primaryKey": false,
2178
+ "notNull": true,
2179
+ "default": "now()"
2180
+ },
2181
+ "updated_at": {
2182
+ "name": "updated_at",
2183
+ "type": "timestamp with time zone",
2184
+ "primaryKey": false,
2185
+ "notNull": true,
2186
+ "default": "now()"
2187
+ }
2188
+ },
2189
+ "indexes": {
2190
+ "tracked_links_email_send_id_idx": {
2191
+ "name": "tracked_links_email_send_id_idx",
2192
+ "columns": [
2193
+ {
2194
+ "expression": "email_send_id",
2195
+ "isExpression": false,
2196
+ "asc": true,
2197
+ "nulls": "last"
2198
+ }
2199
+ ],
2200
+ "isUnique": false,
2201
+ "concurrently": false,
2202
+ "method": "btree",
2203
+ "with": {}
2204
+ }
2205
+ },
2206
+ "foreignKeys": {
2207
+ "tracked_links_email_send_id_email_sends_id_fk": {
2208
+ "name": "tracked_links_email_send_id_email_sends_id_fk",
2209
+ "tableFrom": "tracked_links",
2210
+ "tableTo": "email_sends",
2211
+ "columnsFrom": [
2212
+ "email_send_id"
2213
+ ],
2214
+ "columnsTo": [
2215
+ "id"
2216
+ ],
2217
+ "onDelete": "cascade",
2218
+ "onUpdate": "no action"
2219
+ }
2220
+ },
2221
+ "compositePrimaryKeys": {},
2222
+ "uniqueConstraints": {},
2223
+ "policies": {},
2224
+ "checkConstraints": {},
2225
+ "isRLSEnabled": false
2226
+ },
2227
+ "public.user_events": {
2228
+ "name": "user_events",
2229
+ "schema": "",
2230
+ "columns": {
2231
+ "id": {
2232
+ "name": "id",
2233
+ "type": "uuid",
2234
+ "primaryKey": true,
2235
+ "notNull": true,
2236
+ "default": "gen_random_uuid()"
2237
+ },
2238
+ "organization_id": {
2239
+ "name": "organization_id",
2240
+ "type": "text",
2241
+ "primaryKey": false,
2242
+ "notNull": false
2243
+ },
2244
+ "user_id": {
2245
+ "name": "user_id",
2246
+ "type": "text",
2247
+ "primaryKey": false,
2248
+ "notNull": true
2249
+ },
2250
+ "event": {
2251
+ "name": "event",
2252
+ "type": "text",
2253
+ "primaryKey": false,
2254
+ "notNull": true
2255
+ },
2256
+ "properties": {
2257
+ "name": "properties",
2258
+ "type": "jsonb",
2259
+ "primaryKey": false,
2260
+ "notNull": false
2261
+ },
2262
+ "idempotency_key": {
2263
+ "name": "idempotency_key",
2264
+ "type": "text",
2265
+ "primaryKey": false,
2266
+ "notNull": false
2267
+ },
2268
+ "occurred_at": {
2269
+ "name": "occurred_at",
2270
+ "type": "timestamp with time zone",
2271
+ "primaryKey": false,
2272
+ "notNull": true,
2273
+ "default": "now()"
2274
+ }
2275
+ },
2276
+ "indexes": {
2277
+ "user_events_user_id_idx": {
2278
+ "name": "user_events_user_id_idx",
2279
+ "columns": [
2280
+ {
2281
+ "expression": "user_id",
2282
+ "isExpression": false,
2283
+ "asc": true,
2284
+ "nulls": "last"
2285
+ }
2286
+ ],
2287
+ "isUnique": false,
2288
+ "concurrently": false,
2289
+ "method": "btree",
2290
+ "with": {}
2291
+ },
2292
+ "user_events_event_idx": {
2293
+ "name": "user_events_event_idx",
2294
+ "columns": [
2295
+ {
2296
+ "expression": "event",
2297
+ "isExpression": false,
2298
+ "asc": true,
2299
+ "nulls": "last"
2300
+ }
2301
+ ],
2302
+ "isUnique": false,
2303
+ "concurrently": false,
2304
+ "method": "btree",
2305
+ "with": {}
2306
+ },
2307
+ "user_events_occurred_at_idx": {
2308
+ "name": "user_events_occurred_at_idx",
2309
+ "columns": [
2310
+ {
2311
+ "expression": "occurred_at",
2312
+ "isExpression": false,
2313
+ "asc": true,
2314
+ "nulls": "last"
2315
+ }
2316
+ ],
2317
+ "isUnique": false,
2318
+ "concurrently": false,
2319
+ "method": "btree",
2320
+ "with": {}
2321
+ },
2322
+ "user_events_user_event_occurred_idx": {
2323
+ "name": "user_events_user_event_occurred_idx",
2324
+ "columns": [
2325
+ {
2326
+ "expression": "user_id",
2327
+ "isExpression": false,
2328
+ "asc": true,
2329
+ "nulls": "last"
2330
+ },
2331
+ {
2332
+ "expression": "event",
2333
+ "isExpression": false,
2334
+ "asc": true,
2335
+ "nulls": "last"
2336
+ },
2337
+ {
2338
+ "expression": "occurred_at",
2339
+ "isExpression": false,
2340
+ "asc": true,
2341
+ "nulls": "last"
2342
+ }
2343
+ ],
2344
+ "isUnique": false,
2345
+ "concurrently": false,
2346
+ "method": "btree",
2347
+ "with": {}
2348
+ },
2349
+ "user_events_idempotency_key_idx": {
2350
+ "name": "user_events_idempotency_key_idx",
2351
+ "columns": [
2352
+ {
2353
+ "expression": "idempotency_key",
2354
+ "isExpression": false,
2355
+ "asc": true,
2356
+ "nulls": "last"
2357
+ }
2358
+ ],
2359
+ "isUnique": true,
2360
+ "concurrently": false,
2361
+ "method": "btree",
2362
+ "with": {}
2363
+ }
2364
+ },
2365
+ "foreignKeys": {},
2366
+ "compositePrimaryKeys": {},
2367
+ "uniqueConstraints": {},
2368
+ "policies": {},
2369
+ "checkConstraints": {},
2370
+ "isRLSEnabled": false
2371
+ }
2372
+ },
2373
+ "enums": {
2374
+ "public.alert_channel": {
2375
+ "name": "alert_channel",
2376
+ "schema": "public",
2377
+ "values": [
2378
+ "webhook",
2379
+ "slack",
2380
+ "email"
2381
+ ]
2382
+ },
2383
+ "public.alert_rule_type": {
2384
+ "name": "alert_rule_type",
2385
+ "schema": "public",
2386
+ "values": [
2387
+ "bounce_rate_exceeded",
2388
+ "journey_failure_spike",
2389
+ "delivery_issue",
2390
+ "high_complaint_rate"
2391
+ ]
2392
+ },
2393
+ "public.dlq_status": {
2394
+ "name": "dlq_status",
2395
+ "schema": "public",
2396
+ "values": [
2397
+ "pending",
2398
+ "retried",
2399
+ "discarded"
2400
+ ]
2401
+ },
2402
+ "public.email_send_status": {
2403
+ "name": "email_send_status",
2404
+ "schema": "public",
2405
+ "values": [
2406
+ "queued",
2407
+ "rendered",
2408
+ "sent",
2409
+ "delivered",
2410
+ "opened",
2411
+ "clicked",
2412
+ "bounced",
2413
+ "complained",
2414
+ "failed"
2415
+ ]
2416
+ },
2417
+ "public.import_job_status": {
2418
+ "name": "import_job_status",
2419
+ "schema": "public",
2420
+ "values": [
2421
+ "pending",
2422
+ "processing",
2423
+ "completed",
2424
+ "failed"
2425
+ ]
2426
+ },
2427
+ "public.journey_status": {
2428
+ "name": "journey_status",
2429
+ "schema": "public",
2430
+ "values": [
2431
+ "active",
2432
+ "waiting",
2433
+ "completed",
2434
+ "failed",
2435
+ "exited"
2436
+ ]
2437
+ }
2438
+ },
2439
+ "schemas": {},
2440
+ "sequences": {},
2441
+ "roles": {},
2442
+ "policies": {},
2443
+ "views": {},
2444
+ "_meta": {
2445
+ "columns": {},
2446
+ "schemas": {},
2447
+ "tables": {}
2448
+ }
2449
+ }