@devitek/mailsink-cli 0.0.0-stage → 0.3.0

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