notifkit 0.1.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,1314 @@
1
+ {
2
+ "id": "4758cb06-bdf3-4c4f-883a-0cabdade32ae",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.contact_topic_preferences": {
8
+ "name": "contact_topic_preferences",
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
+ "contact_id": {
19
+ "name": "contact_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "topic": {
25
+ "name": "topic",
26
+ "type": "varchar",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "enabled": {
31
+ "name": "enabled",
32
+ "type": "boolean",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ }
36
+ },
37
+ "indexes": {},
38
+ "foreignKeys": {
39
+ "contact_topic_preferences_contact_id_user_contacts_id_fk": {
40
+ "name": "contact_topic_preferences_contact_id_user_contacts_id_fk",
41
+ "tableFrom": "contact_topic_preferences",
42
+ "tableTo": "user_contacts",
43
+ "columnsFrom": ["contact_id"],
44
+ "columnsTo": ["id"],
45
+ "onDelete": "cascade",
46
+ "onUpdate": "no action"
47
+ }
48
+ },
49
+ "compositePrimaryKeys": {},
50
+ "uniqueConstraints": {
51
+ "contact_topic_preferences_contact_id_topic_unique": {
52
+ "name": "contact_topic_preferences_contact_id_topic_unique",
53
+ "nullsNotDistinct": false,
54
+ "columns": ["contact_id", "topic"]
55
+ }
56
+ },
57
+ "policies": {},
58
+ "checkConstraints": {},
59
+ "isRLSEnabled": false
60
+ },
61
+ "public.delivery_outbox": {
62
+ "name": "delivery_outbox",
63
+ "schema": "",
64
+ "columns": {
65
+ "task_id": {
66
+ "name": "task_id",
67
+ "type": "varchar",
68
+ "primaryKey": false,
69
+ "notNull": true
70
+ },
71
+ "channel": {
72
+ "name": "channel",
73
+ "type": "channel",
74
+ "typeSchema": "public",
75
+ "primaryKey": false,
76
+ "notNull": true
77
+ },
78
+ "destination": {
79
+ "name": "destination",
80
+ "type": "text",
81
+ "primaryKey": false,
82
+ "notNull": true
83
+ },
84
+ "provider_message_id": {
85
+ "name": "provider_message_id",
86
+ "type": "varchar",
87
+ "primaryKey": false,
88
+ "notNull": false
89
+ },
90
+ "created_at": {
91
+ "name": "created_at",
92
+ "type": "timestamp with time zone",
93
+ "primaryKey": false,
94
+ "notNull": true,
95
+ "default": "now()"
96
+ }
97
+ },
98
+ "indexes": {},
99
+ "foreignKeys": {},
100
+ "compositePrimaryKeys": {
101
+ "delivery_outbox_task_id_channel_destination_pk": {
102
+ "name": "delivery_outbox_task_id_channel_destination_pk",
103
+ "columns": ["task_id", "channel", "destination"]
104
+ }
105
+ },
106
+ "uniqueConstraints": {},
107
+ "policies": {},
108
+ "checkConstraints": {},
109
+ "isRLSEnabled": false
110
+ },
111
+ "public.message_logs": {
112
+ "name": "message_logs",
113
+ "schema": "",
114
+ "columns": {
115
+ "id": {
116
+ "name": "id",
117
+ "type": "uuid",
118
+ "primaryKey": true,
119
+ "notNull": true,
120
+ "default": "gen_random_uuid()"
121
+ },
122
+ "project_id": {
123
+ "name": "project_id",
124
+ "type": "uuid",
125
+ "primaryKey": false,
126
+ "notNull": true
127
+ },
128
+ "task_id": {
129
+ "name": "task_id",
130
+ "type": "varchar",
131
+ "primaryKey": false,
132
+ "notNull": true
133
+ },
134
+ "provider_message_id": {
135
+ "name": "provider_message_id",
136
+ "type": "varchar",
137
+ "primaryKey": false,
138
+ "notNull": false
139
+ },
140
+ "template_id": {
141
+ "name": "template_id",
142
+ "type": "varchar",
143
+ "primaryKey": false,
144
+ "notNull": false
145
+ },
146
+ "workflow_instance_id": {
147
+ "name": "workflow_instance_id",
148
+ "type": "uuid",
149
+ "primaryKey": false,
150
+ "notNull": false
151
+ },
152
+ "channel": {
153
+ "name": "channel",
154
+ "type": "channel",
155
+ "typeSchema": "public",
156
+ "primaryKey": false,
157
+ "notNull": true
158
+ },
159
+ "attempt": {
160
+ "name": "attempt",
161
+ "type": "integer",
162
+ "primaryKey": false,
163
+ "notNull": true,
164
+ "default": 1
165
+ },
166
+ "kind": {
167
+ "name": "kind",
168
+ "type": "varchar",
169
+ "primaryKey": false,
170
+ "notNull": true,
171
+ "default": "'attempt'"
172
+ },
173
+ "status": {
174
+ "name": "status",
175
+ "type": "varchar",
176
+ "primaryKey": false,
177
+ "notNull": true
178
+ },
179
+ "timestamp": {
180
+ "name": "timestamp",
181
+ "type": "timestamp with time zone",
182
+ "primaryKey": false,
183
+ "notNull": true,
184
+ "default": "now()"
185
+ }
186
+ },
187
+ "indexes": {
188
+ "message_logs_project_idx": {
189
+ "name": "message_logs_project_idx",
190
+ "columns": [
191
+ {
192
+ "expression": "project_id",
193
+ "isExpression": false,
194
+ "asc": true,
195
+ "nulls": "last"
196
+ }
197
+ ],
198
+ "isUnique": false,
199
+ "concurrently": false,
200
+ "method": "btree",
201
+ "with": {}
202
+ },
203
+ "task_idx": {
204
+ "name": "task_idx",
205
+ "columns": [
206
+ {
207
+ "expression": "task_id",
208
+ "isExpression": false,
209
+ "asc": true,
210
+ "nulls": "last"
211
+ }
212
+ ],
213
+ "isUnique": false,
214
+ "concurrently": false,
215
+ "method": "btree",
216
+ "with": {}
217
+ },
218
+ "message_logs_project_task_idx": {
219
+ "name": "message_logs_project_task_idx",
220
+ "columns": [
221
+ {
222
+ "expression": "project_id",
223
+ "isExpression": false,
224
+ "asc": true,
225
+ "nulls": "last"
226
+ },
227
+ {
228
+ "expression": "task_id",
229
+ "isExpression": false,
230
+ "asc": true,
231
+ "nulls": "last"
232
+ }
233
+ ],
234
+ "isUnique": false,
235
+ "concurrently": false,
236
+ "method": "btree",
237
+ "with": {}
238
+ },
239
+ "provider_msg_idx": {
240
+ "name": "provider_msg_idx",
241
+ "columns": [
242
+ {
243
+ "expression": "provider_message_id",
244
+ "isExpression": false,
245
+ "asc": true,
246
+ "nulls": "last"
247
+ }
248
+ ],
249
+ "isUnique": false,
250
+ "concurrently": false,
251
+ "method": "btree",
252
+ "with": {}
253
+ },
254
+ "msg_log_proj_time_idx": {
255
+ "name": "msg_log_proj_time_idx",
256
+ "columns": [
257
+ {
258
+ "expression": "project_id",
259
+ "isExpression": false,
260
+ "asc": true,
261
+ "nulls": "last"
262
+ },
263
+ {
264
+ "expression": "timestamp",
265
+ "isExpression": false,
266
+ "asc": true,
267
+ "nulls": "last"
268
+ }
269
+ ],
270
+ "isUnique": false,
271
+ "concurrently": false,
272
+ "method": "btree",
273
+ "with": {}
274
+ },
275
+ "msg_log_template_idx": {
276
+ "name": "msg_log_template_idx",
277
+ "columns": [
278
+ {
279
+ "expression": "project_id",
280
+ "isExpression": false,
281
+ "asc": true,
282
+ "nulls": "last"
283
+ },
284
+ {
285
+ "expression": "template_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
+ "msg_log_workflow_idx": {
297
+ "name": "msg_log_workflow_idx",
298
+ "columns": [
299
+ {
300
+ "expression": "project_id",
301
+ "isExpression": false,
302
+ "asc": true,
303
+ "nulls": "last"
304
+ },
305
+ {
306
+ "expression": "workflow_instance_id",
307
+ "isExpression": false,
308
+ "asc": true,
309
+ "nulls": "last"
310
+ }
311
+ ],
312
+ "isUnique": false,
313
+ "concurrently": false,
314
+ "method": "btree",
315
+ "with": {}
316
+ }
317
+ },
318
+ "foreignKeys": {},
319
+ "compositePrimaryKeys": {},
320
+ "uniqueConstraints": {
321
+ "task_channel_attempt_uidx": {
322
+ "name": "task_channel_attempt_uidx",
323
+ "nullsNotDistinct": false,
324
+ "columns": ["task_id", "channel", "attempt", "kind"]
325
+ }
326
+ },
327
+ "policies": {},
328
+ "checkConstraints": {},
329
+ "isRLSEnabled": false
330
+ },
331
+ "public.project_api_keys": {
332
+ "name": "project_api_keys",
333
+ "schema": "",
334
+ "columns": {
335
+ "id": {
336
+ "name": "id",
337
+ "type": "uuid",
338
+ "primaryKey": true,
339
+ "notNull": true,
340
+ "default": "gen_random_uuid()"
341
+ },
342
+ "project_id": {
343
+ "name": "project_id",
344
+ "type": "uuid",
345
+ "primaryKey": false,
346
+ "notNull": true
347
+ },
348
+ "key_hash": {
349
+ "name": "key_hash",
350
+ "type": "varchar",
351
+ "primaryKey": false,
352
+ "notNull": true
353
+ },
354
+ "role": {
355
+ "name": "role",
356
+ "type": "api_key_role",
357
+ "typeSchema": "public",
358
+ "primaryKey": false,
359
+ "notNull": true,
360
+ "default": "'admin'"
361
+ },
362
+ "created_at": {
363
+ "name": "created_at",
364
+ "type": "timestamp with time zone",
365
+ "primaryKey": false,
366
+ "notNull": true,
367
+ "default": "now()"
368
+ }
369
+ },
370
+ "indexes": {},
371
+ "foreignKeys": {
372
+ "project_api_keys_project_id_projects_id_fk": {
373
+ "name": "project_api_keys_project_id_projects_id_fk",
374
+ "tableFrom": "project_api_keys",
375
+ "tableTo": "projects",
376
+ "columnsFrom": ["project_id"],
377
+ "columnsTo": ["id"],
378
+ "onDelete": "cascade",
379
+ "onUpdate": "no action"
380
+ }
381
+ },
382
+ "compositePrimaryKeys": {},
383
+ "uniqueConstraints": {
384
+ "project_api_keys_key_hash_unique": {
385
+ "name": "project_api_keys_key_hash_unique",
386
+ "nullsNotDistinct": false,
387
+ "columns": ["key_hash"]
388
+ }
389
+ },
390
+ "policies": {},
391
+ "checkConstraints": {},
392
+ "isRLSEnabled": false
393
+ },
394
+ "public.projects": {
395
+ "name": "projects",
396
+ "schema": "",
397
+ "columns": {
398
+ "id": {
399
+ "name": "id",
400
+ "type": "uuid",
401
+ "primaryKey": true,
402
+ "notNull": true,
403
+ "default": "gen_random_uuid()"
404
+ },
405
+ "name": {
406
+ "name": "name",
407
+ "type": "varchar",
408
+ "primaryKey": false,
409
+ "notNull": true
410
+ },
411
+ "rate_limit_rpm": {
412
+ "name": "rate_limit_rpm",
413
+ "type": "integer",
414
+ "primaryKey": false,
415
+ "notNull": false
416
+ },
417
+ "throttle_limit": {
418
+ "name": "throttle_limit",
419
+ "type": "integer",
420
+ "primaryKey": false,
421
+ "notNull": false
422
+ },
423
+ "throttle_window_hours": {
424
+ "name": "throttle_window_hours",
425
+ "type": "integer",
426
+ "primaryKey": false,
427
+ "notNull": false
428
+ },
429
+ "created_at": {
430
+ "name": "created_at",
431
+ "type": "timestamp with time zone",
432
+ "primaryKey": false,
433
+ "notNull": true,
434
+ "default": "now()"
435
+ }
436
+ },
437
+ "indexes": {},
438
+ "foreignKeys": {},
439
+ "compositePrimaryKeys": {},
440
+ "uniqueConstraints": {},
441
+ "policies": {},
442
+ "checkConstraints": {},
443
+ "isRLSEnabled": false
444
+ },
445
+ "public.quiet_hours": {
446
+ "name": "quiet_hours",
447
+ "schema": "",
448
+ "columns": {
449
+ "id": {
450
+ "name": "id",
451
+ "type": "uuid",
452
+ "primaryKey": true,
453
+ "notNull": true,
454
+ "default": "gen_random_uuid()"
455
+ },
456
+ "user_id": {
457
+ "name": "user_id",
458
+ "type": "uuid",
459
+ "primaryKey": false,
460
+ "notNull": false
461
+ },
462
+ "contact_id": {
463
+ "name": "contact_id",
464
+ "type": "uuid",
465
+ "primaryKey": false,
466
+ "notNull": false
467
+ },
468
+ "start_time": {
469
+ "name": "start_time",
470
+ "type": "time",
471
+ "primaryKey": false,
472
+ "notNull": true
473
+ },
474
+ "end_time": {
475
+ "name": "end_time",
476
+ "type": "time",
477
+ "primaryKey": false,
478
+ "notNull": true
479
+ }
480
+ },
481
+ "indexes": {
482
+ "quiet_hours_user_idx": {
483
+ "name": "quiet_hours_user_idx",
484
+ "columns": [
485
+ {
486
+ "expression": "user_id",
487
+ "isExpression": false,
488
+ "asc": true,
489
+ "nulls": "last"
490
+ }
491
+ ],
492
+ "isUnique": false,
493
+ "concurrently": false,
494
+ "method": "btree",
495
+ "with": {}
496
+ }
497
+ },
498
+ "foreignKeys": {
499
+ "quiet_hours_user_id_users_id_fk": {
500
+ "name": "quiet_hours_user_id_users_id_fk",
501
+ "tableFrom": "quiet_hours",
502
+ "tableTo": "users",
503
+ "columnsFrom": ["user_id"],
504
+ "columnsTo": ["id"],
505
+ "onDelete": "cascade",
506
+ "onUpdate": "no action"
507
+ },
508
+ "quiet_hours_contact_id_user_contacts_id_fk": {
509
+ "name": "quiet_hours_contact_id_user_contacts_id_fk",
510
+ "tableFrom": "quiet_hours",
511
+ "tableTo": "user_contacts",
512
+ "columnsFrom": ["contact_id"],
513
+ "columnsTo": ["id"],
514
+ "onDelete": "cascade",
515
+ "onUpdate": "no action"
516
+ }
517
+ },
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {},
520
+ "policies": {},
521
+ "checkConstraints": {
522
+ "check_owner": {
523
+ "name": "check_owner",
524
+ "value": "num_nonnulls(user_id, contact_id) = 1"
525
+ }
526
+ },
527
+ "isRLSEnabled": false
528
+ },
529
+ "public.scheduled_payloads": {
530
+ "name": "scheduled_payloads",
531
+ "schema": "",
532
+ "columns": {
533
+ "task_id": {
534
+ "name": "task_id",
535
+ "type": "varchar",
536
+ "primaryKey": true,
537
+ "notNull": true
538
+ },
539
+ "payload": {
540
+ "name": "payload",
541
+ "type": "jsonb",
542
+ "primaryKey": false,
543
+ "notNull": true
544
+ },
545
+ "created_at": {
546
+ "name": "created_at",
547
+ "type": "timestamp with time zone",
548
+ "primaryKey": false,
549
+ "notNull": true,
550
+ "default": "now()"
551
+ }
552
+ },
553
+ "indexes": {},
554
+ "foreignKeys": {},
555
+ "compositePrimaryKeys": {},
556
+ "uniqueConstraints": {},
557
+ "policies": {},
558
+ "checkConstraints": {},
559
+ "isRLSEnabled": false
560
+ },
561
+ "public.templates": {
562
+ "name": "templates",
563
+ "schema": "",
564
+ "columns": {
565
+ "project_id": {
566
+ "name": "project_id",
567
+ "type": "uuid",
568
+ "primaryKey": false,
569
+ "notNull": true
570
+ },
571
+ "id": {
572
+ "name": "id",
573
+ "type": "varchar",
574
+ "primaryKey": false,
575
+ "notNull": true
576
+ },
577
+ "channel": {
578
+ "name": "channel",
579
+ "type": "channel",
580
+ "typeSchema": "public",
581
+ "primaryKey": false,
582
+ "notNull": true
583
+ },
584
+ "topics": {
585
+ "name": "topics",
586
+ "type": "text[]",
587
+ "primaryKey": false,
588
+ "notNull": true
589
+ },
590
+ "content": {
591
+ "name": "content",
592
+ "type": "jsonb",
593
+ "primaryKey": false,
594
+ "notNull": true
595
+ },
596
+ "ai_prompts": {
597
+ "name": "ai_prompts",
598
+ "type": "jsonb",
599
+ "primaryKey": false,
600
+ "notNull": false
601
+ },
602
+ "updated_at": {
603
+ "name": "updated_at",
604
+ "type": "timestamp with time zone",
605
+ "primaryKey": false,
606
+ "notNull": true,
607
+ "default": "now()"
608
+ }
609
+ },
610
+ "indexes": {},
611
+ "foreignKeys": {
612
+ "templates_project_id_projects_id_fk": {
613
+ "name": "templates_project_id_projects_id_fk",
614
+ "tableFrom": "templates",
615
+ "tableTo": "projects",
616
+ "columnsFrom": ["project_id"],
617
+ "columnsTo": ["id"],
618
+ "onDelete": "cascade",
619
+ "onUpdate": "no action"
620
+ }
621
+ },
622
+ "compositePrimaryKeys": {
623
+ "templates_project_id_id_pk": {
624
+ "name": "templates_project_id_id_pk",
625
+ "columns": ["project_id", "id"]
626
+ }
627
+ },
628
+ "uniqueConstraints": {},
629
+ "policies": {},
630
+ "checkConstraints": {},
631
+ "isRLSEnabled": false
632
+ },
633
+ "public.user_channel_preferences": {
634
+ "name": "user_channel_preferences",
635
+ "schema": "",
636
+ "columns": {
637
+ "user_id": {
638
+ "name": "user_id",
639
+ "type": "uuid",
640
+ "primaryKey": false,
641
+ "notNull": true
642
+ },
643
+ "channel": {
644
+ "name": "channel",
645
+ "type": "channel",
646
+ "typeSchema": "public",
647
+ "primaryKey": false,
648
+ "notNull": true
649
+ },
650
+ "enabled": {
651
+ "name": "enabled",
652
+ "type": "boolean",
653
+ "primaryKey": false,
654
+ "notNull": true
655
+ }
656
+ },
657
+ "indexes": {},
658
+ "foreignKeys": {
659
+ "user_channel_preferences_user_id_users_id_fk": {
660
+ "name": "user_channel_preferences_user_id_users_id_fk",
661
+ "tableFrom": "user_channel_preferences",
662
+ "tableTo": "users",
663
+ "columnsFrom": ["user_id"],
664
+ "columnsTo": ["id"],
665
+ "onDelete": "cascade",
666
+ "onUpdate": "no action"
667
+ }
668
+ },
669
+ "compositePrimaryKeys": {
670
+ "user_channel_preferences_user_id_channel_pk": {
671
+ "name": "user_channel_preferences_user_id_channel_pk",
672
+ "columns": ["user_id", "channel"]
673
+ }
674
+ },
675
+ "uniqueConstraints": {},
676
+ "policies": {},
677
+ "checkConstraints": {},
678
+ "isRLSEnabled": false
679
+ },
680
+ "public.user_contacts": {
681
+ "name": "user_contacts",
682
+ "schema": "",
683
+ "columns": {
684
+ "id": {
685
+ "name": "id",
686
+ "type": "uuid",
687
+ "primaryKey": true,
688
+ "notNull": true,
689
+ "default": "gen_random_uuid()"
690
+ },
691
+ "user_id": {
692
+ "name": "user_id",
693
+ "type": "uuid",
694
+ "primaryKey": false,
695
+ "notNull": true
696
+ },
697
+ "channel": {
698
+ "name": "channel",
699
+ "type": "channel",
700
+ "typeSchema": "public",
701
+ "primaryKey": false,
702
+ "notNull": true
703
+ },
704
+ "target": {
705
+ "name": "target",
706
+ "type": "text",
707
+ "primaryKey": false,
708
+ "notNull": true
709
+ },
710
+ "label": {
711
+ "name": "label",
712
+ "type": "text",
713
+ "primaryKey": false,
714
+ "notNull": false
715
+ },
716
+ "is_primary": {
717
+ "name": "is_primary",
718
+ "type": "boolean",
719
+ "primaryKey": false,
720
+ "notNull": true,
721
+ "default": false
722
+ },
723
+ "enabled": {
724
+ "name": "enabled",
725
+ "type": "boolean",
726
+ "primaryKey": false,
727
+ "notNull": true,
728
+ "default": true
729
+ },
730
+ "created_at": {
731
+ "name": "created_at",
732
+ "type": "timestamp with time zone",
733
+ "primaryKey": false,
734
+ "notNull": true,
735
+ "default": "now()"
736
+ }
737
+ },
738
+ "indexes": {},
739
+ "foreignKeys": {
740
+ "user_contacts_user_id_users_id_fk": {
741
+ "name": "user_contacts_user_id_users_id_fk",
742
+ "tableFrom": "user_contacts",
743
+ "tableTo": "users",
744
+ "columnsFrom": ["user_id"],
745
+ "columnsTo": ["id"],
746
+ "onDelete": "cascade",
747
+ "onUpdate": "no action"
748
+ }
749
+ },
750
+ "compositePrimaryKeys": {},
751
+ "uniqueConstraints": {
752
+ "user_contacts_user_id_channel_target_unique": {
753
+ "name": "user_contacts_user_id_channel_target_unique",
754
+ "nullsNotDistinct": false,
755
+ "columns": ["user_id", "channel", "target"]
756
+ }
757
+ },
758
+ "policies": {},
759
+ "checkConstraints": {},
760
+ "isRLSEnabled": false
761
+ },
762
+ "public.user_segments": {
763
+ "name": "user_segments",
764
+ "schema": "",
765
+ "columns": {
766
+ "id": {
767
+ "name": "id",
768
+ "type": "uuid",
769
+ "primaryKey": true,
770
+ "notNull": true,
771
+ "default": "gen_random_uuid()"
772
+ },
773
+ "user_id": {
774
+ "name": "user_id",
775
+ "type": "uuid",
776
+ "primaryKey": false,
777
+ "notNull": true
778
+ },
779
+ "segment": {
780
+ "name": "segment",
781
+ "type": "varchar",
782
+ "primaryKey": false,
783
+ "notNull": true
784
+ }
785
+ },
786
+ "indexes": {
787
+ "segment_idx": {
788
+ "name": "segment_idx",
789
+ "columns": [
790
+ {
791
+ "expression": "segment",
792
+ "isExpression": false,
793
+ "asc": true,
794
+ "nulls": "last"
795
+ }
796
+ ],
797
+ "isUnique": false,
798
+ "concurrently": false,
799
+ "method": "btree",
800
+ "with": {}
801
+ }
802
+ },
803
+ "foreignKeys": {
804
+ "user_segments_user_id_users_id_fk": {
805
+ "name": "user_segments_user_id_users_id_fk",
806
+ "tableFrom": "user_segments",
807
+ "tableTo": "users",
808
+ "columnsFrom": ["user_id"],
809
+ "columnsTo": ["id"],
810
+ "onDelete": "cascade",
811
+ "onUpdate": "no action"
812
+ }
813
+ },
814
+ "compositePrimaryKeys": {},
815
+ "uniqueConstraints": {
816
+ "user_segments_user_id_segment_unique": {
817
+ "name": "user_segments_user_id_segment_unique",
818
+ "nullsNotDistinct": false,
819
+ "columns": ["user_id", "segment"]
820
+ }
821
+ },
822
+ "policies": {},
823
+ "checkConstraints": {},
824
+ "isRLSEnabled": false
825
+ },
826
+ "public.user_topic_preferences": {
827
+ "name": "user_topic_preferences",
828
+ "schema": "",
829
+ "columns": {
830
+ "id": {
831
+ "name": "id",
832
+ "type": "uuid",
833
+ "primaryKey": true,
834
+ "notNull": true,
835
+ "default": "gen_random_uuid()"
836
+ },
837
+ "user_id": {
838
+ "name": "user_id",
839
+ "type": "uuid",
840
+ "primaryKey": false,
841
+ "notNull": true
842
+ },
843
+ "topic": {
844
+ "name": "topic",
845
+ "type": "varchar",
846
+ "primaryKey": false,
847
+ "notNull": true
848
+ },
849
+ "enabled": {
850
+ "name": "enabled",
851
+ "type": "boolean",
852
+ "primaryKey": false,
853
+ "notNull": true
854
+ }
855
+ },
856
+ "indexes": {},
857
+ "foreignKeys": {
858
+ "user_topic_preferences_user_id_users_id_fk": {
859
+ "name": "user_topic_preferences_user_id_users_id_fk",
860
+ "tableFrom": "user_topic_preferences",
861
+ "tableTo": "users",
862
+ "columnsFrom": ["user_id"],
863
+ "columnsTo": ["id"],
864
+ "onDelete": "cascade",
865
+ "onUpdate": "no action"
866
+ }
867
+ },
868
+ "compositePrimaryKeys": {},
869
+ "uniqueConstraints": {
870
+ "user_topic_preferences_user_id_topic_unique": {
871
+ "name": "user_topic_preferences_user_id_topic_unique",
872
+ "nullsNotDistinct": false,
873
+ "columns": ["user_id", "topic"]
874
+ }
875
+ },
876
+ "policies": {},
877
+ "checkConstraints": {},
878
+ "isRLSEnabled": false
879
+ },
880
+ "public.users": {
881
+ "name": "users",
882
+ "schema": "",
883
+ "columns": {
884
+ "id": {
885
+ "name": "id",
886
+ "type": "uuid",
887
+ "primaryKey": true,
888
+ "notNull": true,
889
+ "default": "gen_random_uuid()"
890
+ },
891
+ "project_id": {
892
+ "name": "project_id",
893
+ "type": "uuid",
894
+ "primaryKey": false,
895
+ "notNull": true
896
+ },
897
+ "external_id": {
898
+ "name": "external_id",
899
+ "type": "text",
900
+ "primaryKey": false,
901
+ "notNull": true
902
+ },
903
+ "attributes": {
904
+ "name": "attributes",
905
+ "type": "jsonb",
906
+ "primaryKey": false,
907
+ "notNull": true,
908
+ "default": "'{}'::jsonb"
909
+ },
910
+ "created_at": {
911
+ "name": "created_at",
912
+ "type": "timestamp with time zone",
913
+ "primaryKey": false,
914
+ "notNull": true,
915
+ "default": "now()"
916
+ },
917
+ "updated_at": {
918
+ "name": "updated_at",
919
+ "type": "timestamp with time zone",
920
+ "primaryKey": false,
921
+ "notNull": true,
922
+ "default": "now()"
923
+ }
924
+ },
925
+ "indexes": {},
926
+ "foreignKeys": {},
927
+ "compositePrimaryKeys": {},
928
+ "uniqueConstraints": {
929
+ "users_project_id_external_id_unique": {
930
+ "name": "users_project_id_external_id_unique",
931
+ "nullsNotDistinct": false,
932
+ "columns": ["project_id", "external_id"]
933
+ }
934
+ },
935
+ "policies": {},
936
+ "checkConstraints": {},
937
+ "isRLSEnabled": false
938
+ },
939
+ "public.workflow_definitions": {
940
+ "name": "workflow_definitions",
941
+ "schema": "",
942
+ "columns": {
943
+ "id": {
944
+ "name": "id",
945
+ "type": "uuid",
946
+ "primaryKey": true,
947
+ "notNull": true,
948
+ "default": "gen_random_uuid()"
949
+ },
950
+ "project_id": {
951
+ "name": "project_id",
952
+ "type": "uuid",
953
+ "primaryKey": false,
954
+ "notNull": true
955
+ },
956
+ "name": {
957
+ "name": "name",
958
+ "type": "varchar",
959
+ "primaryKey": false,
960
+ "notNull": true
961
+ },
962
+ "steps": {
963
+ "name": "steps",
964
+ "type": "jsonb",
965
+ "primaryKey": false,
966
+ "notNull": true
967
+ },
968
+ "created_at": {
969
+ "name": "created_at",
970
+ "type": "timestamp with time zone",
971
+ "primaryKey": false,
972
+ "notNull": true,
973
+ "default": "now()"
974
+ }
975
+ },
976
+ "indexes": {},
977
+ "foreignKeys": {},
978
+ "compositePrimaryKeys": {},
979
+ "uniqueConstraints": {
980
+ "workflow_definitions_project_id_name_unique": {
981
+ "name": "workflow_definitions_project_id_name_unique",
982
+ "nullsNotDistinct": false,
983
+ "columns": ["project_id", "name"]
984
+ }
985
+ },
986
+ "policies": {},
987
+ "checkConstraints": {},
988
+ "isRLSEnabled": false
989
+ },
990
+ "public.workflow_instances": {
991
+ "name": "workflow_instances",
992
+ "schema": "",
993
+ "columns": {
994
+ "id": {
995
+ "name": "id",
996
+ "type": "uuid",
997
+ "primaryKey": true,
998
+ "notNull": true,
999
+ "default": "gen_random_uuid()"
1000
+ },
1001
+ "project_id": {
1002
+ "name": "project_id",
1003
+ "type": "uuid",
1004
+ "primaryKey": false,
1005
+ "notNull": true
1006
+ },
1007
+ "name": {
1008
+ "name": "name",
1009
+ "type": "varchar",
1010
+ "primaryKey": false,
1011
+ "notNull": true
1012
+ },
1013
+ "status": {
1014
+ "name": "status",
1015
+ "type": "workflow_status",
1016
+ "typeSchema": "public",
1017
+ "primaryKey": false,
1018
+ "notNull": true,
1019
+ "default": "'pending'"
1020
+ },
1021
+ "input": {
1022
+ "name": "input",
1023
+ "type": "jsonb",
1024
+ "primaryKey": false,
1025
+ "notNull": false,
1026
+ "default": "'{}'::jsonb"
1027
+ },
1028
+ "created_at": {
1029
+ "name": "created_at",
1030
+ "type": "timestamp with time zone",
1031
+ "primaryKey": false,
1032
+ "notNull": true,
1033
+ "default": "now()"
1034
+ },
1035
+ "updated_at": {
1036
+ "name": "updated_at",
1037
+ "type": "timestamp with time zone",
1038
+ "primaryKey": false,
1039
+ "notNull": true,
1040
+ "default": "now()"
1041
+ }
1042
+ },
1043
+ "indexes": {
1044
+ "workflow_name_idx": {
1045
+ "name": "workflow_name_idx",
1046
+ "columns": [
1047
+ {
1048
+ "expression": "name",
1049
+ "isExpression": false,
1050
+ "asc": true,
1051
+ "nulls": "last"
1052
+ }
1053
+ ],
1054
+ "isUnique": false,
1055
+ "concurrently": false,
1056
+ "method": "btree",
1057
+ "with": {}
1058
+ }
1059
+ },
1060
+ "foreignKeys": {},
1061
+ "compositePrimaryKeys": {},
1062
+ "uniqueConstraints": {},
1063
+ "policies": {},
1064
+ "checkConstraints": {},
1065
+ "isRLSEnabled": false
1066
+ },
1067
+ "public.workflow_steps": {
1068
+ "name": "workflow_steps",
1069
+ "schema": "",
1070
+ "columns": {
1071
+ "id": {
1072
+ "name": "id",
1073
+ "type": "uuid",
1074
+ "primaryKey": true,
1075
+ "notNull": true,
1076
+ "default": "gen_random_uuid()"
1077
+ },
1078
+ "project_id": {
1079
+ "name": "project_id",
1080
+ "type": "uuid",
1081
+ "primaryKey": false,
1082
+ "notNull": true
1083
+ },
1084
+ "instance_id": {
1085
+ "name": "instance_id",
1086
+ "type": "uuid",
1087
+ "primaryKey": false,
1088
+ "notNull": true
1089
+ },
1090
+ "step_index": {
1091
+ "name": "step_index",
1092
+ "type": "varchar",
1093
+ "primaryKey": false,
1094
+ "notNull": true
1095
+ },
1096
+ "action": {
1097
+ "name": "action",
1098
+ "type": "varchar",
1099
+ "primaryKey": false,
1100
+ "notNull": true
1101
+ },
1102
+ "output": {
1103
+ "name": "output",
1104
+ "type": "jsonb",
1105
+ "primaryKey": false,
1106
+ "notNull": false
1107
+ },
1108
+ "error": {
1109
+ "name": "error",
1110
+ "type": "text",
1111
+ "primaryKey": false,
1112
+ "notNull": false
1113
+ },
1114
+ "created_at": {
1115
+ "name": "created_at",
1116
+ "type": "timestamp with time zone",
1117
+ "primaryKey": false,
1118
+ "notNull": true,
1119
+ "default": "now()"
1120
+ }
1121
+ },
1122
+ "indexes": {},
1123
+ "foreignKeys": {
1124
+ "workflow_steps_instance_id_workflow_instances_id_fk": {
1125
+ "name": "workflow_steps_instance_id_workflow_instances_id_fk",
1126
+ "tableFrom": "workflow_steps",
1127
+ "tableTo": "workflow_instances",
1128
+ "columnsFrom": ["instance_id"],
1129
+ "columnsTo": ["id"],
1130
+ "onDelete": "cascade",
1131
+ "onUpdate": "no action"
1132
+ }
1133
+ },
1134
+ "compositePrimaryKeys": {},
1135
+ "uniqueConstraints": {
1136
+ "workflow_steps_instance_id_step_index_unique": {
1137
+ "name": "workflow_steps_instance_id_step_index_unique",
1138
+ "nullsNotDistinct": false,
1139
+ "columns": ["instance_id", "step_index"]
1140
+ }
1141
+ },
1142
+ "policies": {},
1143
+ "checkConstraints": {},
1144
+ "isRLSEnabled": false
1145
+ },
1146
+ "public.workflow_waiters": {
1147
+ "name": "workflow_waiters",
1148
+ "schema": "",
1149
+ "columns": {
1150
+ "id": {
1151
+ "name": "id",
1152
+ "type": "uuid",
1153
+ "primaryKey": true,
1154
+ "notNull": true,
1155
+ "default": "gen_random_uuid()"
1156
+ },
1157
+ "project_id": {
1158
+ "name": "project_id",
1159
+ "type": "uuid",
1160
+ "primaryKey": false,
1161
+ "notNull": true
1162
+ },
1163
+ "instance_id": {
1164
+ "name": "instance_id",
1165
+ "type": "uuid",
1166
+ "primaryKey": false,
1167
+ "notNull": true
1168
+ },
1169
+ "event_name": {
1170
+ "name": "event_name",
1171
+ "type": "varchar",
1172
+ "primaryKey": false,
1173
+ "notNull": true
1174
+ },
1175
+ "match_criteria": {
1176
+ "name": "match_criteria",
1177
+ "type": "jsonb",
1178
+ "primaryKey": false,
1179
+ "notNull": true
1180
+ },
1181
+ "expires_at": {
1182
+ "name": "expires_at",
1183
+ "type": "timestamp with time zone",
1184
+ "primaryKey": false,
1185
+ "notNull": true
1186
+ },
1187
+ "created_at": {
1188
+ "name": "created_at",
1189
+ "type": "timestamp with time zone",
1190
+ "primaryKey": false,
1191
+ "notNull": true,
1192
+ "default": "now()"
1193
+ }
1194
+ },
1195
+ "indexes": {
1196
+ "waiter_event_idx": {
1197
+ "name": "waiter_event_idx",
1198
+ "columns": [
1199
+ {
1200
+ "expression": "event_name",
1201
+ "isExpression": false,
1202
+ "asc": true,
1203
+ "nulls": "last"
1204
+ }
1205
+ ],
1206
+ "isUnique": false,
1207
+ "concurrently": false,
1208
+ "method": "btree",
1209
+ "with": {}
1210
+ },
1211
+ "waiter_instance_idx": {
1212
+ "name": "waiter_instance_idx",
1213
+ "columns": [
1214
+ {
1215
+ "expression": "instance_id",
1216
+ "isExpression": false,
1217
+ "asc": true,
1218
+ "nulls": "last"
1219
+ }
1220
+ ],
1221
+ "isUnique": false,
1222
+ "concurrently": false,
1223
+ "method": "btree",
1224
+ "with": {}
1225
+ },
1226
+ "waiter_comp_idx": {
1227
+ "name": "waiter_comp_idx",
1228
+ "columns": [
1229
+ {
1230
+ "expression": "event_name",
1231
+ "isExpression": false,
1232
+ "asc": true,
1233
+ "nulls": "last"
1234
+ },
1235
+ {
1236
+ "expression": "project_id",
1237
+ "isExpression": false,
1238
+ "asc": true,
1239
+ "nulls": "last"
1240
+ },
1241
+ {
1242
+ "expression": "expires_at",
1243
+ "isExpression": false,
1244
+ "asc": true,
1245
+ "nulls": "last"
1246
+ }
1247
+ ],
1248
+ "isUnique": false,
1249
+ "concurrently": false,
1250
+ "method": "btree",
1251
+ "with": {}
1252
+ },
1253
+ "waiter_match_idx": {
1254
+ "name": "waiter_match_idx",
1255
+ "columns": [
1256
+ {
1257
+ "expression": "match_criteria",
1258
+ "isExpression": false,
1259
+ "asc": true,
1260
+ "nulls": "last"
1261
+ }
1262
+ ],
1263
+ "isUnique": false,
1264
+ "concurrently": false,
1265
+ "method": "gin",
1266
+ "with": {}
1267
+ }
1268
+ },
1269
+ "foreignKeys": {
1270
+ "workflow_waiters_instance_id_workflow_instances_id_fk": {
1271
+ "name": "workflow_waiters_instance_id_workflow_instances_id_fk",
1272
+ "tableFrom": "workflow_waiters",
1273
+ "tableTo": "workflow_instances",
1274
+ "columnsFrom": ["instance_id"],
1275
+ "columnsTo": ["id"],
1276
+ "onDelete": "cascade",
1277
+ "onUpdate": "no action"
1278
+ }
1279
+ },
1280
+ "compositePrimaryKeys": {},
1281
+ "uniqueConstraints": {},
1282
+ "policies": {},
1283
+ "checkConstraints": {},
1284
+ "isRLSEnabled": false
1285
+ }
1286
+ },
1287
+ "enums": {
1288
+ "public.api_key_role": {
1289
+ "name": "api_key_role",
1290
+ "schema": "public",
1291
+ "values": ["admin", "read_only"]
1292
+ },
1293
+ "public.channel": {
1294
+ "name": "channel",
1295
+ "schema": "public",
1296
+ "values": ["email", "sms", "push", "webhook", "in-app"]
1297
+ },
1298
+ "public.workflow_status": {
1299
+ "name": "workflow_status",
1300
+ "schema": "public",
1301
+ "values": ["pending", "running", "completed", "failed"]
1302
+ }
1303
+ },
1304
+ "schemas": {},
1305
+ "sequences": {},
1306
+ "roles": {},
1307
+ "policies": {},
1308
+ "views": {},
1309
+ "_meta": {
1310
+ "columns": {},
1311
+ "schemas": {},
1312
+ "tables": {}
1313
+ }
1314
+ }