@haatlabs-core/templates 0.15.1 → 0.17.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,1902 @@
1
+ {
2
+ "id": "59cd1aa2-e149-4de9-b5bc-e09ce39adbd8",
3
+ "prevId": "70846fe0-3369-4525-ba97-1a74bb8d687d",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.api_keys": {
8
+ "name": "api_keys",
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
+ "organization_id": {
19
+ "name": "organization_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "name": {
25
+ "name": "name",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "key_hash": {
31
+ "name": "key_hash",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "prefix": {
37
+ "name": "prefix",
38
+ "type": "text",
39
+ "primaryKey": false,
40
+ "notNull": true
41
+ },
42
+ "last_used_at": {
43
+ "name": "last_used_at",
44
+ "type": "timestamp with time zone",
45
+ "primaryKey": false,
46
+ "notNull": false
47
+ },
48
+ "revoked_at": {
49
+ "name": "revoked_at",
50
+ "type": "timestamp with time zone",
51
+ "primaryKey": false,
52
+ "notNull": false
53
+ },
54
+ "created_at": {
55
+ "name": "created_at",
56
+ "type": "timestamp with time zone",
57
+ "primaryKey": false,
58
+ "notNull": true,
59
+ "default": "now()"
60
+ },
61
+ "updated_at": {
62
+ "name": "updated_at",
63
+ "type": "timestamp with time zone",
64
+ "primaryKey": false,
65
+ "notNull": true,
66
+ "default": "now()"
67
+ }
68
+ },
69
+ "indexes": {},
70
+ "foreignKeys": {
71
+ "api_keys_organization_id_organizations_id_fk": {
72
+ "name": "api_keys_organization_id_organizations_id_fk",
73
+ "tableFrom": "api_keys",
74
+ "tableTo": "organizations",
75
+ "columnsFrom": [
76
+ "organization_id"
77
+ ],
78
+ "columnsTo": [
79
+ "id"
80
+ ],
81
+ "onDelete": "cascade",
82
+ "onUpdate": "no action"
83
+ }
84
+ },
85
+ "compositePrimaryKeys": {},
86
+ "uniqueConstraints": {
87
+ "api_keys_key_hash_unique": {
88
+ "name": "api_keys_key_hash_unique",
89
+ "nullsNotDistinct": false,
90
+ "columns": [
91
+ "key_hash"
92
+ ]
93
+ }
94
+ },
95
+ "policies": {},
96
+ "checkConstraints": {},
97
+ "isRLSEnabled": false
98
+ },
99
+ "public.extension_keys": {
100
+ "name": "extension_keys",
101
+ "schema": "",
102
+ "columns": {
103
+ "id": {
104
+ "name": "id",
105
+ "type": "uuid",
106
+ "primaryKey": true,
107
+ "notNull": true,
108
+ "default": "gen_random_uuid()"
109
+ },
110
+ "organization_id": {
111
+ "name": "organization_id",
112
+ "type": "uuid",
113
+ "primaryKey": false,
114
+ "notNull": true
115
+ },
116
+ "user_id": {
117
+ "name": "user_id",
118
+ "type": "uuid",
119
+ "primaryKey": false,
120
+ "notNull": true
121
+ },
122
+ "name": {
123
+ "name": "name",
124
+ "type": "text",
125
+ "primaryKey": false,
126
+ "notNull": true
127
+ },
128
+ "extension_id": {
129
+ "name": "extension_id",
130
+ "type": "text",
131
+ "primaryKey": false,
132
+ "notNull": true
133
+ },
134
+ "key_hash": {
135
+ "name": "key_hash",
136
+ "type": "text",
137
+ "primaryKey": false,
138
+ "notNull": true
139
+ },
140
+ "prefix": {
141
+ "name": "prefix",
142
+ "type": "text",
143
+ "primaryKey": false,
144
+ "notNull": true
145
+ },
146
+ "last_used_at": {
147
+ "name": "last_used_at",
148
+ "type": "timestamp with time zone",
149
+ "primaryKey": false,
150
+ "notNull": false
151
+ },
152
+ "revoked_at": {
153
+ "name": "revoked_at",
154
+ "type": "timestamp with time zone",
155
+ "primaryKey": false,
156
+ "notNull": false
157
+ },
158
+ "created_at": {
159
+ "name": "created_at",
160
+ "type": "timestamp with time zone",
161
+ "primaryKey": false,
162
+ "notNull": true,
163
+ "default": "now()"
164
+ },
165
+ "updated_at": {
166
+ "name": "updated_at",
167
+ "type": "timestamp with time zone",
168
+ "primaryKey": false,
169
+ "notNull": true,
170
+ "default": "now()"
171
+ }
172
+ },
173
+ "indexes": {
174
+ "extension_keys_org_user_idx": {
175
+ "name": "extension_keys_org_user_idx",
176
+ "columns": [
177
+ {
178
+ "expression": "organization_id",
179
+ "isExpression": false,
180
+ "asc": true,
181
+ "nulls": "last"
182
+ },
183
+ {
184
+ "expression": "user_id",
185
+ "isExpression": false,
186
+ "asc": true,
187
+ "nulls": "last"
188
+ }
189
+ ],
190
+ "isUnique": false,
191
+ "concurrently": false,
192
+ "method": "btree",
193
+ "with": {}
194
+ }
195
+ },
196
+ "foreignKeys": {
197
+ "extension_keys_organization_id_organizations_id_fk": {
198
+ "name": "extension_keys_organization_id_organizations_id_fk",
199
+ "tableFrom": "extension_keys",
200
+ "tableTo": "organizations",
201
+ "columnsFrom": [
202
+ "organization_id"
203
+ ],
204
+ "columnsTo": [
205
+ "id"
206
+ ],
207
+ "onDelete": "cascade",
208
+ "onUpdate": "no action"
209
+ },
210
+ "extension_keys_user_id_users_id_fk": {
211
+ "name": "extension_keys_user_id_users_id_fk",
212
+ "tableFrom": "extension_keys",
213
+ "tableTo": "users",
214
+ "columnsFrom": [
215
+ "user_id"
216
+ ],
217
+ "columnsTo": [
218
+ "id"
219
+ ],
220
+ "onDelete": "cascade",
221
+ "onUpdate": "no action"
222
+ }
223
+ },
224
+ "compositePrimaryKeys": {},
225
+ "uniqueConstraints": {
226
+ "extension_keys_key_hash_unique": {
227
+ "name": "extension_keys_key_hash_unique",
228
+ "nullsNotDistinct": false,
229
+ "columns": [
230
+ "key_hash"
231
+ ]
232
+ }
233
+ },
234
+ "policies": {},
235
+ "checkConstraints": {},
236
+ "isRLSEnabled": false
237
+ },
238
+ "public.memberships": {
239
+ "name": "memberships",
240
+ "schema": "",
241
+ "columns": {
242
+ "id": {
243
+ "name": "id",
244
+ "type": "uuid",
245
+ "primaryKey": true,
246
+ "notNull": true,
247
+ "default": "gen_random_uuid()"
248
+ },
249
+ "user_id": {
250
+ "name": "user_id",
251
+ "type": "uuid",
252
+ "primaryKey": false,
253
+ "notNull": true
254
+ },
255
+ "organization_id": {
256
+ "name": "organization_id",
257
+ "type": "uuid",
258
+ "primaryKey": false,
259
+ "notNull": true
260
+ },
261
+ "role": {
262
+ "name": "role",
263
+ "type": "role",
264
+ "typeSchema": "public",
265
+ "primaryKey": false,
266
+ "notNull": true
267
+ },
268
+ "created_at": {
269
+ "name": "created_at",
270
+ "type": "timestamp with time zone",
271
+ "primaryKey": false,
272
+ "notNull": true,
273
+ "default": "now()"
274
+ },
275
+ "updated_at": {
276
+ "name": "updated_at",
277
+ "type": "timestamp with time zone",
278
+ "primaryKey": false,
279
+ "notNull": true,
280
+ "default": "now()"
281
+ }
282
+ },
283
+ "indexes": {},
284
+ "foreignKeys": {
285
+ "memberships_user_id_users_id_fk": {
286
+ "name": "memberships_user_id_users_id_fk",
287
+ "tableFrom": "memberships",
288
+ "tableTo": "users",
289
+ "columnsFrom": [
290
+ "user_id"
291
+ ],
292
+ "columnsTo": [
293
+ "id"
294
+ ],
295
+ "onDelete": "cascade",
296
+ "onUpdate": "no action"
297
+ },
298
+ "memberships_organization_id_organizations_id_fk": {
299
+ "name": "memberships_organization_id_organizations_id_fk",
300
+ "tableFrom": "memberships",
301
+ "tableTo": "organizations",
302
+ "columnsFrom": [
303
+ "organization_id"
304
+ ],
305
+ "columnsTo": [
306
+ "id"
307
+ ],
308
+ "onDelete": "cascade",
309
+ "onUpdate": "no action"
310
+ }
311
+ },
312
+ "compositePrimaryKeys": {},
313
+ "uniqueConstraints": {
314
+ "memberships_user_org_unique": {
315
+ "name": "memberships_user_org_unique",
316
+ "nullsNotDistinct": false,
317
+ "columns": [
318
+ "user_id",
319
+ "organization_id"
320
+ ]
321
+ }
322
+ },
323
+ "policies": {},
324
+ "checkConstraints": {},
325
+ "isRLSEnabled": false
326
+ },
327
+ "public.organizations": {
328
+ "name": "organizations",
329
+ "schema": "",
330
+ "columns": {
331
+ "id": {
332
+ "name": "id",
333
+ "type": "uuid",
334
+ "primaryKey": true,
335
+ "notNull": true,
336
+ "default": "gen_random_uuid()"
337
+ },
338
+ "name": {
339
+ "name": "name",
340
+ "type": "text",
341
+ "primaryKey": false,
342
+ "notNull": true
343
+ },
344
+ "origin": {
345
+ "name": "origin",
346
+ "type": "organization_origin",
347
+ "typeSchema": "public",
348
+ "primaryKey": false,
349
+ "notNull": true,
350
+ "default": "'dashboard'"
351
+ },
352
+ "store_limit": {
353
+ "name": "store_limit",
354
+ "type": "integer",
355
+ "primaryKey": false,
356
+ "notNull": false
357
+ },
358
+ "suspended_at": {
359
+ "name": "suspended_at",
360
+ "type": "timestamp with time zone",
361
+ "primaryKey": false,
362
+ "notNull": false
363
+ },
364
+ "suspended_reason": {
365
+ "name": "suspended_reason",
366
+ "type": "text",
367
+ "primaryKey": false,
368
+ "notNull": false
369
+ },
370
+ "created_at": {
371
+ "name": "created_at",
372
+ "type": "timestamp with time zone",
373
+ "primaryKey": false,
374
+ "notNull": true,
375
+ "default": "now()"
376
+ },
377
+ "updated_at": {
378
+ "name": "updated_at",
379
+ "type": "timestamp with time zone",
380
+ "primaryKey": false,
381
+ "notNull": true,
382
+ "default": "now()"
383
+ }
384
+ },
385
+ "indexes": {},
386
+ "foreignKeys": {},
387
+ "compositePrimaryKeys": {},
388
+ "uniqueConstraints": {},
389
+ "policies": {},
390
+ "checkConstraints": {},
391
+ "isRLSEnabled": false
392
+ },
393
+ "public.platform_admins": {
394
+ "name": "platform_admins",
395
+ "schema": "",
396
+ "columns": {
397
+ "id": {
398
+ "name": "id",
399
+ "type": "uuid",
400
+ "primaryKey": true,
401
+ "notNull": true,
402
+ "default": "gen_random_uuid()"
403
+ },
404
+ "email": {
405
+ "name": "email",
406
+ "type": "text",
407
+ "primaryKey": false,
408
+ "notNull": true
409
+ },
410
+ "password_hash": {
411
+ "name": "password_hash",
412
+ "type": "text",
413
+ "primaryKey": false,
414
+ "notNull": true
415
+ },
416
+ "disabled_at": {
417
+ "name": "disabled_at",
418
+ "type": "timestamp with time zone",
419
+ "primaryKey": false,
420
+ "notNull": false
421
+ },
422
+ "last_login_at": {
423
+ "name": "last_login_at",
424
+ "type": "timestamp with time zone",
425
+ "primaryKey": false,
426
+ "notNull": false
427
+ },
428
+ "created_at": {
429
+ "name": "created_at",
430
+ "type": "timestamp with time zone",
431
+ "primaryKey": false,
432
+ "notNull": true,
433
+ "default": "now()"
434
+ },
435
+ "updated_at": {
436
+ "name": "updated_at",
437
+ "type": "timestamp with time zone",
438
+ "primaryKey": false,
439
+ "notNull": true,
440
+ "default": "now()"
441
+ }
442
+ },
443
+ "indexes": {},
444
+ "foreignKeys": {},
445
+ "compositePrimaryKeys": {},
446
+ "uniqueConstraints": {
447
+ "platform_admins_email_unique": {
448
+ "name": "platform_admins_email_unique",
449
+ "nullsNotDistinct": false,
450
+ "columns": [
451
+ "email"
452
+ ]
453
+ }
454
+ },
455
+ "policies": {},
456
+ "checkConstraints": {},
457
+ "isRLSEnabled": false
458
+ },
459
+ "public.user_identities": {
460
+ "name": "user_identities",
461
+ "schema": "",
462
+ "columns": {
463
+ "id": {
464
+ "name": "id",
465
+ "type": "uuid",
466
+ "primaryKey": true,
467
+ "notNull": true,
468
+ "default": "gen_random_uuid()"
469
+ },
470
+ "user_id": {
471
+ "name": "user_id",
472
+ "type": "uuid",
473
+ "primaryKey": false,
474
+ "notNull": true
475
+ },
476
+ "provider": {
477
+ "name": "provider",
478
+ "type": "text",
479
+ "primaryKey": false,
480
+ "notNull": true
481
+ },
482
+ "provider_user_id": {
483
+ "name": "provider_user_id",
484
+ "type": "text",
485
+ "primaryKey": false,
486
+ "notNull": true
487
+ },
488
+ "email_at_link": {
489
+ "name": "email_at_link",
490
+ "type": "text",
491
+ "primaryKey": false,
492
+ "notNull": true
493
+ },
494
+ "created_at": {
495
+ "name": "created_at",
496
+ "type": "timestamp with time zone",
497
+ "primaryKey": false,
498
+ "notNull": true,
499
+ "default": "now()"
500
+ },
501
+ "updated_at": {
502
+ "name": "updated_at",
503
+ "type": "timestamp with time zone",
504
+ "primaryKey": false,
505
+ "notNull": true,
506
+ "default": "now()"
507
+ }
508
+ },
509
+ "indexes": {
510
+ "user_identities_user_idx": {
511
+ "name": "user_identities_user_idx",
512
+ "columns": [
513
+ {
514
+ "expression": "user_id",
515
+ "isExpression": false,
516
+ "asc": true,
517
+ "nulls": "last"
518
+ }
519
+ ],
520
+ "isUnique": false,
521
+ "concurrently": false,
522
+ "method": "btree",
523
+ "with": {}
524
+ }
525
+ },
526
+ "foreignKeys": {
527
+ "user_identities_user_id_users_id_fk": {
528
+ "name": "user_identities_user_id_users_id_fk",
529
+ "tableFrom": "user_identities",
530
+ "tableTo": "users",
531
+ "columnsFrom": [
532
+ "user_id"
533
+ ],
534
+ "columnsTo": [
535
+ "id"
536
+ ],
537
+ "onDelete": "cascade",
538
+ "onUpdate": "no action"
539
+ }
540
+ },
541
+ "compositePrimaryKeys": {},
542
+ "uniqueConstraints": {
543
+ "user_identities_provider_user_unique": {
544
+ "name": "user_identities_provider_user_unique",
545
+ "nullsNotDistinct": false,
546
+ "columns": [
547
+ "provider",
548
+ "provider_user_id"
549
+ ]
550
+ }
551
+ },
552
+ "policies": {},
553
+ "checkConstraints": {},
554
+ "isRLSEnabled": false
555
+ },
556
+ "public.users": {
557
+ "name": "users",
558
+ "schema": "",
559
+ "columns": {
560
+ "id": {
561
+ "name": "id",
562
+ "type": "uuid",
563
+ "primaryKey": true,
564
+ "notNull": true,
565
+ "default": "gen_random_uuid()"
566
+ },
567
+ "email": {
568
+ "name": "email",
569
+ "type": "text",
570
+ "primaryKey": false,
571
+ "notNull": false
572
+ },
573
+ "password_hash": {
574
+ "name": "password_hash",
575
+ "type": "text",
576
+ "primaryKey": false,
577
+ "notNull": false
578
+ },
579
+ "created_at": {
580
+ "name": "created_at",
581
+ "type": "timestamp with time zone",
582
+ "primaryKey": false,
583
+ "notNull": true,
584
+ "default": "now()"
585
+ },
586
+ "updated_at": {
587
+ "name": "updated_at",
588
+ "type": "timestamp with time zone",
589
+ "primaryKey": false,
590
+ "notNull": true,
591
+ "default": "now()"
592
+ }
593
+ },
594
+ "indexes": {},
595
+ "foreignKeys": {},
596
+ "compositePrimaryKeys": {},
597
+ "uniqueConstraints": {
598
+ "users_email_unique": {
599
+ "name": "users_email_unique",
600
+ "nullsNotDistinct": false,
601
+ "columns": [
602
+ "email"
603
+ ]
604
+ }
605
+ },
606
+ "policies": {},
607
+ "checkConstraints": {},
608
+ "isRLSEnabled": false
609
+ },
610
+ "public.shopify_installations": {
611
+ "name": "shopify_installations",
612
+ "schema": "",
613
+ "columns": {
614
+ "id": {
615
+ "name": "id",
616
+ "type": "uuid",
617
+ "primaryKey": true,
618
+ "notNull": true,
619
+ "default": "gen_random_uuid()"
620
+ },
621
+ "organization_id": {
622
+ "name": "organization_id",
623
+ "type": "uuid",
624
+ "primaryKey": false,
625
+ "notNull": true
626
+ },
627
+ "store_id": {
628
+ "name": "store_id",
629
+ "type": "uuid",
630
+ "primaryKey": false,
631
+ "notNull": true
632
+ },
633
+ "access_token_encrypted": {
634
+ "name": "access_token_encrypted",
635
+ "type": "text",
636
+ "primaryKey": false,
637
+ "notNull": true
638
+ },
639
+ "key_version": {
640
+ "name": "key_version",
641
+ "type": "integer",
642
+ "primaryKey": false,
643
+ "notNull": true
644
+ },
645
+ "access_token_expires_at": {
646
+ "name": "access_token_expires_at",
647
+ "type": "timestamp with time zone",
648
+ "primaryKey": false,
649
+ "notNull": false
650
+ },
651
+ "refresh_token_encrypted": {
652
+ "name": "refresh_token_encrypted",
653
+ "type": "text",
654
+ "primaryKey": false,
655
+ "notNull": false
656
+ },
657
+ "refresh_token_expires_at": {
658
+ "name": "refresh_token_expires_at",
659
+ "type": "timestamp with time zone",
660
+ "primaryKey": false,
661
+ "notNull": false
662
+ },
663
+ "scopes": {
664
+ "name": "scopes",
665
+ "type": "text",
666
+ "primaryKey": false,
667
+ "notNull": true
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
+ "updated_at": {
677
+ "name": "updated_at",
678
+ "type": "timestamp with time zone",
679
+ "primaryKey": false,
680
+ "notNull": true,
681
+ "default": "now()"
682
+ }
683
+ },
684
+ "indexes": {},
685
+ "foreignKeys": {
686
+ "shopify_installations_organization_id_organizations_id_fk": {
687
+ "name": "shopify_installations_organization_id_organizations_id_fk",
688
+ "tableFrom": "shopify_installations",
689
+ "tableTo": "organizations",
690
+ "columnsFrom": [
691
+ "organization_id"
692
+ ],
693
+ "columnsTo": [
694
+ "id"
695
+ ],
696
+ "onDelete": "cascade",
697
+ "onUpdate": "no action"
698
+ },
699
+ "shopify_installations_store_id_stores_id_fk": {
700
+ "name": "shopify_installations_store_id_stores_id_fk",
701
+ "tableFrom": "shopify_installations",
702
+ "tableTo": "stores",
703
+ "columnsFrom": [
704
+ "store_id"
705
+ ],
706
+ "columnsTo": [
707
+ "id"
708
+ ],
709
+ "onDelete": "cascade",
710
+ "onUpdate": "no action"
711
+ }
712
+ },
713
+ "compositePrimaryKeys": {},
714
+ "uniqueConstraints": {
715
+ "shopify_installations_store_id_unique": {
716
+ "name": "shopify_installations_store_id_unique",
717
+ "nullsNotDistinct": false,
718
+ "columns": [
719
+ "store_id"
720
+ ]
721
+ }
722
+ },
723
+ "policies": {},
724
+ "checkConstraints": {},
725
+ "isRLSEnabled": false
726
+ },
727
+ "public.stores": {
728
+ "name": "stores",
729
+ "schema": "",
730
+ "columns": {
731
+ "id": {
732
+ "name": "id",
733
+ "type": "uuid",
734
+ "primaryKey": true,
735
+ "notNull": true,
736
+ "default": "gen_random_uuid()"
737
+ },
738
+ "organization_id": {
739
+ "name": "organization_id",
740
+ "type": "uuid",
741
+ "primaryKey": false,
742
+ "notNull": true
743
+ },
744
+ "shop_domain": {
745
+ "name": "shop_domain",
746
+ "type": "text",
747
+ "primaryKey": false,
748
+ "notNull": true
749
+ },
750
+ "status": {
751
+ "name": "status",
752
+ "type": "store_status",
753
+ "typeSchema": "public",
754
+ "primaryKey": false,
755
+ "notNull": true,
756
+ "default": "'ACTIVE'"
757
+ },
758
+ "installed_at": {
759
+ "name": "installed_at",
760
+ "type": "timestamp with time zone",
761
+ "primaryKey": false,
762
+ "notNull": true,
763
+ "default": "now()"
764
+ },
765
+ "uninstalled_at": {
766
+ "name": "uninstalled_at",
767
+ "type": "timestamp with time zone",
768
+ "primaryKey": false,
769
+ "notNull": false
770
+ },
771
+ "last_synced_at": {
772
+ "name": "last_synced_at",
773
+ "type": "timestamp with time zone",
774
+ "primaryKey": false,
775
+ "notNull": false
776
+ },
777
+ "deleted_at": {
778
+ "name": "deleted_at",
779
+ "type": "timestamp with time zone",
780
+ "primaryKey": false,
781
+ "notNull": false
782
+ },
783
+ "created_at": {
784
+ "name": "created_at",
785
+ "type": "timestamp with time zone",
786
+ "primaryKey": false,
787
+ "notNull": true,
788
+ "default": "now()"
789
+ },
790
+ "updated_at": {
791
+ "name": "updated_at",
792
+ "type": "timestamp with time zone",
793
+ "primaryKey": false,
794
+ "notNull": true,
795
+ "default": "now()"
796
+ }
797
+ },
798
+ "indexes": {},
799
+ "foreignKeys": {
800
+ "stores_organization_id_organizations_id_fk": {
801
+ "name": "stores_organization_id_organizations_id_fk",
802
+ "tableFrom": "stores",
803
+ "tableTo": "organizations",
804
+ "columnsFrom": [
805
+ "organization_id"
806
+ ],
807
+ "columnsTo": [
808
+ "id"
809
+ ],
810
+ "onDelete": "cascade",
811
+ "onUpdate": "no action"
812
+ }
813
+ },
814
+ "compositePrimaryKeys": {},
815
+ "uniqueConstraints": {
816
+ "stores_shop_domain_unique": {
817
+ "name": "stores_shop_domain_unique",
818
+ "nullsNotDistinct": false,
819
+ "columns": [
820
+ "shop_domain"
821
+ ]
822
+ },
823
+ "stores_id_org_unique": {
824
+ "name": "stores_id_org_unique",
825
+ "nullsNotDistinct": false,
826
+ "columns": [
827
+ "id",
828
+ "organization_id"
829
+ ]
830
+ }
831
+ },
832
+ "policies": {},
833
+ "checkConstraints": {},
834
+ "isRLSEnabled": false
835
+ },
836
+ "public.audit_logs": {
837
+ "name": "audit_logs",
838
+ "schema": "",
839
+ "columns": {
840
+ "id": {
841
+ "name": "id",
842
+ "type": "uuid",
843
+ "primaryKey": true,
844
+ "notNull": true,
845
+ "default": "gen_random_uuid()"
846
+ },
847
+ "organization_id": {
848
+ "name": "organization_id",
849
+ "type": "uuid",
850
+ "primaryKey": false,
851
+ "notNull": false
852
+ },
853
+ "actor": {
854
+ "name": "actor",
855
+ "type": "text",
856
+ "primaryKey": false,
857
+ "notNull": true
858
+ },
859
+ "action": {
860
+ "name": "action",
861
+ "type": "text",
862
+ "primaryKey": false,
863
+ "notNull": true
864
+ },
865
+ "entity_type": {
866
+ "name": "entity_type",
867
+ "type": "text",
868
+ "primaryKey": false,
869
+ "notNull": true
870
+ },
871
+ "entity_id": {
872
+ "name": "entity_id",
873
+ "type": "text",
874
+ "primaryKey": false,
875
+ "notNull": true
876
+ },
877
+ "request_id": {
878
+ "name": "request_id",
879
+ "type": "text",
880
+ "primaryKey": false,
881
+ "notNull": false
882
+ },
883
+ "metadata": {
884
+ "name": "metadata",
885
+ "type": "jsonb",
886
+ "primaryKey": false,
887
+ "notNull": true,
888
+ "default": "'{}'::jsonb"
889
+ },
890
+ "created_at": {
891
+ "name": "created_at",
892
+ "type": "timestamp with time zone",
893
+ "primaryKey": false,
894
+ "notNull": true,
895
+ "default": "now()"
896
+ }
897
+ },
898
+ "indexes": {
899
+ "audit_logs_org_created_idx": {
900
+ "name": "audit_logs_org_created_idx",
901
+ "columns": [
902
+ {
903
+ "expression": "organization_id",
904
+ "isExpression": false,
905
+ "asc": true,
906
+ "nulls": "last"
907
+ },
908
+ {
909
+ "expression": "created_at",
910
+ "isExpression": false,
911
+ "asc": true,
912
+ "nulls": "last"
913
+ }
914
+ ],
915
+ "isUnique": false,
916
+ "concurrently": false,
917
+ "method": "btree",
918
+ "with": {}
919
+ }
920
+ },
921
+ "foreignKeys": {
922
+ "audit_logs_organization_id_organizations_id_fk": {
923
+ "name": "audit_logs_organization_id_organizations_id_fk",
924
+ "tableFrom": "audit_logs",
925
+ "tableTo": "organizations",
926
+ "columnsFrom": [
927
+ "organization_id"
928
+ ],
929
+ "columnsTo": [
930
+ "id"
931
+ ],
932
+ "onDelete": "cascade",
933
+ "onUpdate": "no action"
934
+ }
935
+ },
936
+ "compositePrimaryKeys": {},
937
+ "uniqueConstraints": {},
938
+ "policies": {},
939
+ "checkConstraints": {},
940
+ "isRLSEnabled": false
941
+ },
942
+ "public.outbox_messages": {
943
+ "name": "outbox_messages",
944
+ "schema": "",
945
+ "columns": {
946
+ "id": {
947
+ "name": "id",
948
+ "type": "uuid",
949
+ "primaryKey": true,
950
+ "notNull": true,
951
+ "default": "gen_random_uuid()"
952
+ },
953
+ "routing_key": {
954
+ "name": "routing_key",
955
+ "type": "text",
956
+ "primaryKey": false,
957
+ "notNull": true
958
+ },
959
+ "payload": {
960
+ "name": "payload",
961
+ "type": "jsonb",
962
+ "primaryKey": false,
963
+ "notNull": true
964
+ },
965
+ "trace_context": {
966
+ "name": "trace_context",
967
+ "type": "text",
968
+ "primaryKey": false,
969
+ "notNull": false
970
+ },
971
+ "created_at": {
972
+ "name": "created_at",
973
+ "type": "timestamp with time zone",
974
+ "primaryKey": false,
975
+ "notNull": true,
976
+ "default": "now()"
977
+ },
978
+ "published_at": {
979
+ "name": "published_at",
980
+ "type": "timestamp with time zone",
981
+ "primaryKey": false,
982
+ "notNull": false
983
+ },
984
+ "priority": {
985
+ "name": "priority",
986
+ "type": "boolean",
987
+ "primaryKey": false,
988
+ "notNull": true,
989
+ "default": "organization_goes_first()"
990
+ }
991
+ },
992
+ "indexes": {
993
+ "outbox_unpublished_idx": {
994
+ "name": "outbox_unpublished_idx",
995
+ "columns": [
996
+ {
997
+ "expression": "published_at",
998
+ "isExpression": false,
999
+ "asc": true,
1000
+ "nulls": "last"
1001
+ },
1002
+ {
1003
+ "expression": "created_at",
1004
+ "isExpression": false,
1005
+ "asc": true,
1006
+ "nulls": "last"
1007
+ }
1008
+ ],
1009
+ "isUnique": false,
1010
+ "concurrently": false,
1011
+ "method": "btree",
1012
+ "with": {}
1013
+ }
1014
+ },
1015
+ "foreignKeys": {},
1016
+ "compositePrimaryKeys": {},
1017
+ "uniqueConstraints": {},
1018
+ "policies": {},
1019
+ "checkConstraints": {},
1020
+ "isRLSEnabled": false
1021
+ },
1022
+ "public.webhook_events": {
1023
+ "name": "webhook_events",
1024
+ "schema": "",
1025
+ "columns": {
1026
+ "id": {
1027
+ "name": "id",
1028
+ "type": "uuid",
1029
+ "primaryKey": true,
1030
+ "notNull": true,
1031
+ "default": "gen_random_uuid()"
1032
+ },
1033
+ "organization_id": {
1034
+ "name": "organization_id",
1035
+ "type": "uuid",
1036
+ "primaryKey": false,
1037
+ "notNull": true
1038
+ },
1039
+ "store_id": {
1040
+ "name": "store_id",
1041
+ "type": "uuid",
1042
+ "primaryKey": false,
1043
+ "notNull": true
1044
+ },
1045
+ "shopify_webhook_id": {
1046
+ "name": "shopify_webhook_id",
1047
+ "type": "text",
1048
+ "primaryKey": false,
1049
+ "notNull": true
1050
+ },
1051
+ "topic": {
1052
+ "name": "topic",
1053
+ "type": "text",
1054
+ "primaryKey": false,
1055
+ "notNull": true
1056
+ },
1057
+ "received_at": {
1058
+ "name": "received_at",
1059
+ "type": "timestamp with time zone",
1060
+ "primaryKey": false,
1061
+ "notNull": true,
1062
+ "default": "now()"
1063
+ }
1064
+ },
1065
+ "indexes": {},
1066
+ "foreignKeys": {
1067
+ "webhook_events_organization_id_organizations_id_fk": {
1068
+ "name": "webhook_events_organization_id_organizations_id_fk",
1069
+ "tableFrom": "webhook_events",
1070
+ "tableTo": "organizations",
1071
+ "columnsFrom": [
1072
+ "organization_id"
1073
+ ],
1074
+ "columnsTo": [
1075
+ "id"
1076
+ ],
1077
+ "onDelete": "cascade",
1078
+ "onUpdate": "no action"
1079
+ },
1080
+ "webhook_events_store_id_stores_id_fk": {
1081
+ "name": "webhook_events_store_id_stores_id_fk",
1082
+ "tableFrom": "webhook_events",
1083
+ "tableTo": "stores",
1084
+ "columnsFrom": [
1085
+ "store_id"
1086
+ ],
1087
+ "columnsTo": [
1088
+ "id"
1089
+ ],
1090
+ "onDelete": "cascade",
1091
+ "onUpdate": "no action"
1092
+ }
1093
+ },
1094
+ "compositePrimaryKeys": {},
1095
+ "uniqueConstraints": {
1096
+ "webhook_events_shopify_webhook_id_unique": {
1097
+ "name": "webhook_events_shopify_webhook_id_unique",
1098
+ "nullsNotDistinct": false,
1099
+ "columns": [
1100
+ "shopify_webhook_id"
1101
+ ]
1102
+ }
1103
+ },
1104
+ "policies": {},
1105
+ "checkConstraints": {},
1106
+ "isRLSEnabled": false
1107
+ },
1108
+ "public.allowance_grants": {
1109
+ "name": "allowance_grants",
1110
+ "schema": "",
1111
+ "columns": {
1112
+ "id": {
1113
+ "name": "id",
1114
+ "type": "uuid",
1115
+ "primaryKey": true,
1116
+ "notNull": true,
1117
+ "default": "gen_random_uuid()"
1118
+ },
1119
+ "organization_id": {
1120
+ "name": "organization_id",
1121
+ "type": "uuid",
1122
+ "primaryKey": false,
1123
+ "notNull": true
1124
+ },
1125
+ "metric": {
1126
+ "name": "metric",
1127
+ "type": "text",
1128
+ "primaryKey": false,
1129
+ "notNull": true
1130
+ },
1131
+ "quantity": {
1132
+ "name": "quantity",
1133
+ "type": "integer",
1134
+ "primaryKey": false,
1135
+ "notNull": true
1136
+ },
1137
+ "period": {
1138
+ "name": "period",
1139
+ "type": "date",
1140
+ "primaryKey": false,
1141
+ "notNull": true
1142
+ },
1143
+ "reason": {
1144
+ "name": "reason",
1145
+ "type": "text",
1146
+ "primaryKey": false,
1147
+ "notNull": true
1148
+ },
1149
+ "granted_by": {
1150
+ "name": "granted_by",
1151
+ "type": "text",
1152
+ "primaryKey": false,
1153
+ "notNull": true
1154
+ },
1155
+ "created_at": {
1156
+ "name": "created_at",
1157
+ "type": "timestamp with time zone",
1158
+ "primaryKey": false,
1159
+ "notNull": true,
1160
+ "default": "now()"
1161
+ }
1162
+ },
1163
+ "indexes": {
1164
+ "allowance_grants_period_idx": {
1165
+ "name": "allowance_grants_period_idx",
1166
+ "columns": [
1167
+ {
1168
+ "expression": "organization_id",
1169
+ "isExpression": false,
1170
+ "asc": true,
1171
+ "nulls": "last"
1172
+ },
1173
+ {
1174
+ "expression": "period",
1175
+ "isExpression": false,
1176
+ "asc": true,
1177
+ "nulls": "last"
1178
+ },
1179
+ {
1180
+ "expression": "metric",
1181
+ "isExpression": false,
1182
+ "asc": true,
1183
+ "nulls": "last"
1184
+ }
1185
+ ],
1186
+ "isUnique": false,
1187
+ "concurrently": false,
1188
+ "method": "btree",
1189
+ "with": {}
1190
+ }
1191
+ },
1192
+ "foreignKeys": {
1193
+ "allowance_grants_organization_id_organizations_id_fk": {
1194
+ "name": "allowance_grants_organization_id_organizations_id_fk",
1195
+ "tableFrom": "allowance_grants",
1196
+ "tableTo": "organizations",
1197
+ "columnsFrom": [
1198
+ "organization_id"
1199
+ ],
1200
+ "columnsTo": [
1201
+ "id"
1202
+ ],
1203
+ "onDelete": "cascade",
1204
+ "onUpdate": "no action"
1205
+ }
1206
+ },
1207
+ "compositePrimaryKeys": {},
1208
+ "uniqueConstraints": {},
1209
+ "policies": {},
1210
+ "checkConstraints": {
1211
+ "allowance_grants_quantity_positive": {
1212
+ "name": "allowance_grants_quantity_positive",
1213
+ "value": "\"allowance_grants\".\"quantity\" > 0"
1214
+ }
1215
+ },
1216
+ "isRLSEnabled": false
1217
+ },
1218
+ "public.organization_features": {
1219
+ "name": "organization_features",
1220
+ "schema": "",
1221
+ "columns": {
1222
+ "organization_id": {
1223
+ "name": "organization_id",
1224
+ "type": "uuid",
1225
+ "primaryKey": false,
1226
+ "notNull": true
1227
+ },
1228
+ "feature": {
1229
+ "name": "feature",
1230
+ "type": "text",
1231
+ "primaryKey": false,
1232
+ "notNull": true
1233
+ },
1234
+ "enabled": {
1235
+ "name": "enabled",
1236
+ "type": "boolean",
1237
+ "primaryKey": false,
1238
+ "notNull": true
1239
+ },
1240
+ "changed_by": {
1241
+ "name": "changed_by",
1242
+ "type": "text",
1243
+ "primaryKey": false,
1244
+ "notNull": true
1245
+ },
1246
+ "updated_at": {
1247
+ "name": "updated_at",
1248
+ "type": "timestamp with time zone",
1249
+ "primaryKey": false,
1250
+ "notNull": true,
1251
+ "default": "now()"
1252
+ }
1253
+ },
1254
+ "indexes": {},
1255
+ "foreignKeys": {
1256
+ "organization_features_organization_id_organizations_id_fk": {
1257
+ "name": "organization_features_organization_id_organizations_id_fk",
1258
+ "tableFrom": "organization_features",
1259
+ "tableTo": "organizations",
1260
+ "columnsFrom": [
1261
+ "organization_id"
1262
+ ],
1263
+ "columnsTo": [
1264
+ "id"
1265
+ ],
1266
+ "onDelete": "cascade",
1267
+ "onUpdate": "no action"
1268
+ }
1269
+ },
1270
+ "compositePrimaryKeys": {
1271
+ "organization_features_organization_id_feature_pk": {
1272
+ "name": "organization_features_organization_id_feature_pk",
1273
+ "columns": [
1274
+ "organization_id",
1275
+ "feature"
1276
+ ]
1277
+ }
1278
+ },
1279
+ "uniqueConstraints": {},
1280
+ "policies": {},
1281
+ "checkConstraints": {},
1282
+ "isRLSEnabled": false
1283
+ },
1284
+ "public.payment_events": {
1285
+ "name": "payment_events",
1286
+ "schema": "",
1287
+ "columns": {
1288
+ "provider": {
1289
+ "name": "provider",
1290
+ "type": "text",
1291
+ "primaryKey": false,
1292
+ "notNull": true
1293
+ },
1294
+ "event_id": {
1295
+ "name": "event_id",
1296
+ "type": "text",
1297
+ "primaryKey": false,
1298
+ "notNull": true
1299
+ },
1300
+ "received_at": {
1301
+ "name": "received_at",
1302
+ "type": "timestamp with time zone",
1303
+ "primaryKey": false,
1304
+ "notNull": true,
1305
+ "default": "now()"
1306
+ }
1307
+ },
1308
+ "indexes": {},
1309
+ "foreignKeys": {},
1310
+ "compositePrimaryKeys": {
1311
+ "payment_events_provider_event_id_pk": {
1312
+ "name": "payment_events_provider_event_id_pk",
1313
+ "columns": [
1314
+ "provider",
1315
+ "event_id"
1316
+ ]
1317
+ }
1318
+ },
1319
+ "uniqueConstraints": {},
1320
+ "policies": {},
1321
+ "checkConstraints": {},
1322
+ "isRLSEnabled": false
1323
+ },
1324
+ "public.plan_features": {
1325
+ "name": "plan_features",
1326
+ "schema": "",
1327
+ "columns": {
1328
+ "id": {
1329
+ "name": "id",
1330
+ "type": "uuid",
1331
+ "primaryKey": true,
1332
+ "notNull": true,
1333
+ "default": "gen_random_uuid()"
1334
+ },
1335
+ "plan_id": {
1336
+ "name": "plan_id",
1337
+ "type": "uuid",
1338
+ "primaryKey": false,
1339
+ "notNull": true
1340
+ },
1341
+ "feature_key": {
1342
+ "name": "feature_key",
1343
+ "type": "text",
1344
+ "primaryKey": false,
1345
+ "notNull": true
1346
+ },
1347
+ "limit_value": {
1348
+ "name": "limit_value",
1349
+ "type": "bigint",
1350
+ "primaryKey": false,
1351
+ "notNull": false
1352
+ },
1353
+ "created_at": {
1354
+ "name": "created_at",
1355
+ "type": "timestamp with time zone",
1356
+ "primaryKey": false,
1357
+ "notNull": true,
1358
+ "default": "now()"
1359
+ },
1360
+ "updated_at": {
1361
+ "name": "updated_at",
1362
+ "type": "timestamp with time zone",
1363
+ "primaryKey": false,
1364
+ "notNull": true,
1365
+ "default": "now()"
1366
+ }
1367
+ },
1368
+ "indexes": {},
1369
+ "foreignKeys": {
1370
+ "plan_features_plan_id_plans_id_fk": {
1371
+ "name": "plan_features_plan_id_plans_id_fk",
1372
+ "tableFrom": "plan_features",
1373
+ "tableTo": "plans",
1374
+ "columnsFrom": [
1375
+ "plan_id"
1376
+ ],
1377
+ "columnsTo": [
1378
+ "id"
1379
+ ],
1380
+ "onDelete": "cascade",
1381
+ "onUpdate": "no action"
1382
+ }
1383
+ },
1384
+ "compositePrimaryKeys": {},
1385
+ "uniqueConstraints": {
1386
+ "plan_features_plan_key_unique": {
1387
+ "name": "plan_features_plan_key_unique",
1388
+ "nullsNotDistinct": false,
1389
+ "columns": [
1390
+ "plan_id",
1391
+ "feature_key"
1392
+ ]
1393
+ }
1394
+ },
1395
+ "policies": {},
1396
+ "checkConstraints": {},
1397
+ "isRLSEnabled": false
1398
+ },
1399
+ "public.plan_prices": {
1400
+ "name": "plan_prices",
1401
+ "schema": "",
1402
+ "columns": {
1403
+ "id": {
1404
+ "name": "id",
1405
+ "type": "uuid",
1406
+ "primaryKey": true,
1407
+ "notNull": true,
1408
+ "default": "gen_random_uuid()"
1409
+ },
1410
+ "plan_id": {
1411
+ "name": "plan_id",
1412
+ "type": "uuid",
1413
+ "primaryKey": false,
1414
+ "notNull": true
1415
+ },
1416
+ "provider": {
1417
+ "name": "provider",
1418
+ "type": "text",
1419
+ "primaryKey": false,
1420
+ "notNull": true
1421
+ },
1422
+ "price_ref": {
1423
+ "name": "price_ref",
1424
+ "type": "text",
1425
+ "primaryKey": false,
1426
+ "notNull": true
1427
+ },
1428
+ "currency": {
1429
+ "name": "currency",
1430
+ "type": "text",
1431
+ "primaryKey": false,
1432
+ "notNull": true
1433
+ },
1434
+ "amount_minor": {
1435
+ "name": "amount_minor",
1436
+ "type": "integer",
1437
+ "primaryKey": false,
1438
+ "notNull": true
1439
+ },
1440
+ "created_at": {
1441
+ "name": "created_at",
1442
+ "type": "timestamp with time zone",
1443
+ "primaryKey": false,
1444
+ "notNull": true,
1445
+ "default": "now()"
1446
+ },
1447
+ "updated_at": {
1448
+ "name": "updated_at",
1449
+ "type": "timestamp with time zone",
1450
+ "primaryKey": false,
1451
+ "notNull": true,
1452
+ "default": "now()"
1453
+ }
1454
+ },
1455
+ "indexes": {},
1456
+ "foreignKeys": {
1457
+ "plan_prices_plan_id_plans_id_fk": {
1458
+ "name": "plan_prices_plan_id_plans_id_fk",
1459
+ "tableFrom": "plan_prices",
1460
+ "tableTo": "plans",
1461
+ "columnsFrom": [
1462
+ "plan_id"
1463
+ ],
1464
+ "columnsTo": [
1465
+ "id"
1466
+ ],
1467
+ "onDelete": "cascade",
1468
+ "onUpdate": "no action"
1469
+ }
1470
+ },
1471
+ "compositePrimaryKeys": {},
1472
+ "uniqueConstraints": {
1473
+ "plan_prices_plan_provider_currency_unique": {
1474
+ "name": "plan_prices_plan_provider_currency_unique",
1475
+ "nullsNotDistinct": false,
1476
+ "columns": [
1477
+ "plan_id",
1478
+ "provider",
1479
+ "currency"
1480
+ ]
1481
+ },
1482
+ "plan_prices_provider_ref_unique": {
1483
+ "name": "plan_prices_provider_ref_unique",
1484
+ "nullsNotDistinct": false,
1485
+ "columns": [
1486
+ "provider",
1487
+ "price_ref"
1488
+ ]
1489
+ }
1490
+ },
1491
+ "policies": {},
1492
+ "checkConstraints": {},
1493
+ "isRLSEnabled": false
1494
+ },
1495
+ "public.plans": {
1496
+ "name": "plans",
1497
+ "schema": "",
1498
+ "columns": {
1499
+ "id": {
1500
+ "name": "id",
1501
+ "type": "uuid",
1502
+ "primaryKey": true,
1503
+ "notNull": true,
1504
+ "default": "gen_random_uuid()"
1505
+ },
1506
+ "code": {
1507
+ "name": "code",
1508
+ "type": "text",
1509
+ "primaryKey": false,
1510
+ "notNull": true
1511
+ },
1512
+ "name": {
1513
+ "name": "name",
1514
+ "type": "text",
1515
+ "primaryKey": false,
1516
+ "notNull": true
1517
+ },
1518
+ "is_default": {
1519
+ "name": "is_default",
1520
+ "type": "boolean",
1521
+ "primaryKey": false,
1522
+ "notNull": true,
1523
+ "default": false
1524
+ },
1525
+ "position": {
1526
+ "name": "position",
1527
+ "type": "integer",
1528
+ "primaryKey": false,
1529
+ "notNull": true
1530
+ },
1531
+ "created_at": {
1532
+ "name": "created_at",
1533
+ "type": "timestamp with time zone",
1534
+ "primaryKey": false,
1535
+ "notNull": true,
1536
+ "default": "now()"
1537
+ },
1538
+ "updated_at": {
1539
+ "name": "updated_at",
1540
+ "type": "timestamp with time zone",
1541
+ "primaryKey": false,
1542
+ "notNull": true,
1543
+ "default": "now()"
1544
+ }
1545
+ },
1546
+ "indexes": {
1547
+ "plans_one_default_idx": {
1548
+ "name": "plans_one_default_idx",
1549
+ "columns": [
1550
+ {
1551
+ "expression": "is_default",
1552
+ "isExpression": false,
1553
+ "asc": true,
1554
+ "nulls": "last"
1555
+ }
1556
+ ],
1557
+ "isUnique": true,
1558
+ "where": "\"plans\".\"is_default\"",
1559
+ "concurrently": false,
1560
+ "method": "btree",
1561
+ "with": {}
1562
+ }
1563
+ },
1564
+ "foreignKeys": {},
1565
+ "compositePrimaryKeys": {},
1566
+ "uniqueConstraints": {
1567
+ "plans_code_unique": {
1568
+ "name": "plans_code_unique",
1569
+ "nullsNotDistinct": false,
1570
+ "columns": [
1571
+ "code"
1572
+ ]
1573
+ }
1574
+ },
1575
+ "policies": {},
1576
+ "checkConstraints": {},
1577
+ "isRLSEnabled": false
1578
+ },
1579
+ "public.subscriptions": {
1580
+ "name": "subscriptions",
1581
+ "schema": "",
1582
+ "columns": {
1583
+ "id": {
1584
+ "name": "id",
1585
+ "type": "uuid",
1586
+ "primaryKey": true,
1587
+ "notNull": true,
1588
+ "default": "gen_random_uuid()"
1589
+ },
1590
+ "organization_id": {
1591
+ "name": "organization_id",
1592
+ "type": "uuid",
1593
+ "primaryKey": false,
1594
+ "notNull": true
1595
+ },
1596
+ "plan_id": {
1597
+ "name": "plan_id",
1598
+ "type": "uuid",
1599
+ "primaryKey": false,
1600
+ "notNull": true
1601
+ },
1602
+ "status": {
1603
+ "name": "status",
1604
+ "type": "subscription_status",
1605
+ "typeSchema": "public",
1606
+ "primaryKey": false,
1607
+ "notNull": true,
1608
+ "default": "'ACTIVE'"
1609
+ },
1610
+ "period_start": {
1611
+ "name": "period_start",
1612
+ "type": "timestamp with time zone",
1613
+ "primaryKey": false,
1614
+ "notNull": true
1615
+ },
1616
+ "period_end": {
1617
+ "name": "period_end",
1618
+ "type": "timestamp with time zone",
1619
+ "primaryKey": false,
1620
+ "notNull": true
1621
+ },
1622
+ "assigned_by": {
1623
+ "name": "assigned_by",
1624
+ "type": "text",
1625
+ "primaryKey": false,
1626
+ "notNull": true
1627
+ },
1628
+ "provider": {
1629
+ "name": "provider",
1630
+ "type": "text",
1631
+ "primaryKey": false,
1632
+ "notNull": false
1633
+ },
1634
+ "provider_subscription_ref": {
1635
+ "name": "provider_subscription_ref",
1636
+ "type": "text",
1637
+ "primaryKey": false,
1638
+ "notNull": false
1639
+ },
1640
+ "provider_customer_ref": {
1641
+ "name": "provider_customer_ref",
1642
+ "type": "text",
1643
+ "primaryKey": false,
1644
+ "notNull": false
1645
+ },
1646
+ "provider_event_at": {
1647
+ "name": "provider_event_at",
1648
+ "type": "timestamp with time zone",
1649
+ "primaryKey": false,
1650
+ "notNull": false
1651
+ },
1652
+ "provider_ended_at": {
1653
+ "name": "provider_ended_at",
1654
+ "type": "timestamp with time zone",
1655
+ "primaryKey": false,
1656
+ "notNull": false
1657
+ },
1658
+ "price_amount_minor": {
1659
+ "name": "price_amount_minor",
1660
+ "type": "bigint",
1661
+ "primaryKey": false,
1662
+ "notNull": false
1663
+ },
1664
+ "price_currency": {
1665
+ "name": "price_currency",
1666
+ "type": "text",
1667
+ "primaryKey": false,
1668
+ "notNull": false
1669
+ },
1670
+ "created_at": {
1671
+ "name": "created_at",
1672
+ "type": "timestamp with time zone",
1673
+ "primaryKey": false,
1674
+ "notNull": true,
1675
+ "default": "now()"
1676
+ },
1677
+ "updated_at": {
1678
+ "name": "updated_at",
1679
+ "type": "timestamp with time zone",
1680
+ "primaryKey": false,
1681
+ "notNull": true,
1682
+ "default": "now()"
1683
+ }
1684
+ },
1685
+ "indexes": {},
1686
+ "foreignKeys": {
1687
+ "subscriptions_organization_id_organizations_id_fk": {
1688
+ "name": "subscriptions_organization_id_organizations_id_fk",
1689
+ "tableFrom": "subscriptions",
1690
+ "tableTo": "organizations",
1691
+ "columnsFrom": [
1692
+ "organization_id"
1693
+ ],
1694
+ "columnsTo": [
1695
+ "id"
1696
+ ],
1697
+ "onDelete": "cascade",
1698
+ "onUpdate": "no action"
1699
+ },
1700
+ "subscriptions_plan_id_plans_id_fk": {
1701
+ "name": "subscriptions_plan_id_plans_id_fk",
1702
+ "tableFrom": "subscriptions",
1703
+ "tableTo": "plans",
1704
+ "columnsFrom": [
1705
+ "plan_id"
1706
+ ],
1707
+ "columnsTo": [
1708
+ "id"
1709
+ ],
1710
+ "onDelete": "no action",
1711
+ "onUpdate": "no action"
1712
+ }
1713
+ },
1714
+ "compositePrimaryKeys": {},
1715
+ "uniqueConstraints": {
1716
+ "subscriptions_organization_id_unique": {
1717
+ "name": "subscriptions_organization_id_unique",
1718
+ "nullsNotDistinct": false,
1719
+ "columns": [
1720
+ "organization_id"
1721
+ ]
1722
+ }
1723
+ },
1724
+ "policies": {},
1725
+ "checkConstraints": {},
1726
+ "isRLSEnabled": false
1727
+ },
1728
+ "public.usage_records": {
1729
+ "name": "usage_records",
1730
+ "schema": "",
1731
+ "columns": {
1732
+ "id": {
1733
+ "name": "id",
1734
+ "type": "uuid",
1735
+ "primaryKey": true,
1736
+ "notNull": true,
1737
+ "default": "gen_random_uuid()"
1738
+ },
1739
+ "organization_id": {
1740
+ "name": "organization_id",
1741
+ "type": "uuid",
1742
+ "primaryKey": false,
1743
+ "notNull": true
1744
+ },
1745
+ "store_id": {
1746
+ "name": "store_id",
1747
+ "type": "uuid",
1748
+ "primaryKey": false,
1749
+ "notNull": false
1750
+ },
1751
+ "metric": {
1752
+ "name": "metric",
1753
+ "type": "text",
1754
+ "primaryKey": false,
1755
+ "notNull": true
1756
+ },
1757
+ "quantity": {
1758
+ "name": "quantity",
1759
+ "type": "integer",
1760
+ "primaryKey": false,
1761
+ "notNull": true
1762
+ },
1763
+ "period": {
1764
+ "name": "period",
1765
+ "type": "date",
1766
+ "primaryKey": false,
1767
+ "notNull": true
1768
+ },
1769
+ "idempotency_key": {
1770
+ "name": "idempotency_key",
1771
+ "type": "text",
1772
+ "primaryKey": false,
1773
+ "notNull": true
1774
+ },
1775
+ "created_at": {
1776
+ "name": "created_at",
1777
+ "type": "timestamp with time zone",
1778
+ "primaryKey": false,
1779
+ "notNull": true,
1780
+ "default": "now()"
1781
+ }
1782
+ },
1783
+ "indexes": {
1784
+ "usage_records_period_idx": {
1785
+ "name": "usage_records_period_idx",
1786
+ "columns": [
1787
+ {
1788
+ "expression": "organization_id",
1789
+ "isExpression": false,
1790
+ "asc": true,
1791
+ "nulls": "last"
1792
+ },
1793
+ {
1794
+ "expression": "period",
1795
+ "isExpression": false,
1796
+ "asc": true,
1797
+ "nulls": "last"
1798
+ },
1799
+ {
1800
+ "expression": "metric",
1801
+ "isExpression": false,
1802
+ "asc": true,
1803
+ "nulls": "last"
1804
+ }
1805
+ ],
1806
+ "isUnique": false,
1807
+ "concurrently": false,
1808
+ "method": "btree",
1809
+ "with": {}
1810
+ }
1811
+ },
1812
+ "foreignKeys": {
1813
+ "usage_records_organization_id_organizations_id_fk": {
1814
+ "name": "usage_records_organization_id_organizations_id_fk",
1815
+ "tableFrom": "usage_records",
1816
+ "tableTo": "organizations",
1817
+ "columnsFrom": [
1818
+ "organization_id"
1819
+ ],
1820
+ "columnsTo": [
1821
+ "id"
1822
+ ],
1823
+ "onDelete": "cascade",
1824
+ "onUpdate": "no action"
1825
+ },
1826
+ "usage_records_store_id_stores_id_fk": {
1827
+ "name": "usage_records_store_id_stores_id_fk",
1828
+ "tableFrom": "usage_records",
1829
+ "tableTo": "stores",
1830
+ "columnsFrom": [
1831
+ "store_id"
1832
+ ],
1833
+ "columnsTo": [
1834
+ "id"
1835
+ ],
1836
+ "onDelete": "set null",
1837
+ "onUpdate": "no action"
1838
+ }
1839
+ },
1840
+ "compositePrimaryKeys": {},
1841
+ "uniqueConstraints": {
1842
+ "usage_records_org_key_unique": {
1843
+ "name": "usage_records_org_key_unique",
1844
+ "nullsNotDistinct": false,
1845
+ "columns": [
1846
+ "organization_id",
1847
+ "idempotency_key"
1848
+ ]
1849
+ }
1850
+ },
1851
+ "policies": {},
1852
+ "checkConstraints": {},
1853
+ "isRLSEnabled": false
1854
+ }
1855
+ },
1856
+ "enums": {
1857
+ "public.organization_origin": {
1858
+ "name": "organization_origin",
1859
+ "schema": "public",
1860
+ "values": [
1861
+ "dashboard",
1862
+ "shopify"
1863
+ ]
1864
+ },
1865
+ "public.role": {
1866
+ "name": "role",
1867
+ "schema": "public",
1868
+ "values": [
1869
+ "OWNER",
1870
+ "ADMIN",
1871
+ "MEMBER",
1872
+ "VIEWER"
1873
+ ]
1874
+ },
1875
+ "public.store_status": {
1876
+ "name": "store_status",
1877
+ "schema": "public",
1878
+ "values": [
1879
+ "ACTIVE",
1880
+ "UNINSTALLED"
1881
+ ]
1882
+ },
1883
+ "public.subscription_status": {
1884
+ "name": "subscription_status",
1885
+ "schema": "public",
1886
+ "values": [
1887
+ "ACTIVE",
1888
+ "CANCELLED"
1889
+ ]
1890
+ }
1891
+ },
1892
+ "schemas": {},
1893
+ "sequences": {},
1894
+ "roles": {},
1895
+ "policies": {},
1896
+ "views": {},
1897
+ "_meta": {
1898
+ "columns": {},
1899
+ "schemas": {},
1900
+ "tables": {}
1901
+ }
1902
+ }