@nymbalhq/platform 1.4.0 → 1.5.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.
Files changed (29) hide show
  1. package/dist/{chunk-SNNK2OX3.js → chunk-NNDIAIT6.js} +73 -5
  2. package/dist/chunk-NNDIAIT6.js.map +1 -0
  3. package/dist/{chunk-GMV3B3SC.js → chunk-TRLERRUI.js} +424 -137
  4. package/dist/chunk-TRLERRUI.js.map +1 -0
  5. package/dist/db/schema/index.d.ts +795 -105
  6. package/dist/db/schema/index.js +1 -1
  7. package/dist/index.d.ts +218 -85
  8. package/dist/index.js +658 -199
  9. package/dist/index.js.map +1 -1
  10. package/dist/register-SBGUI2L5.js +8 -0
  11. package/migrations/postgres/0016_email_suppressions.sql +7 -0
  12. package/migrations/postgres/0017_order_shipments.sql +14 -0
  13. package/migrations/postgres/0018_order_key_expiry.sql +8 -0
  14. package/migrations/postgres/meta/0016_snapshot.json +2233 -0
  15. package/migrations/postgres/meta/0017_snapshot.json +2300 -0
  16. package/migrations/postgres/meta/0018_snapshot.json +2306 -0
  17. package/migrations/postgres/meta/_journal.json +21 -0
  18. package/migrations/sqlite/0016_email_suppressions.sql +7 -0
  19. package/migrations/sqlite/0017_order_shipments.sql +9 -0
  20. package/migrations/sqlite/0018_order_key_expiry.sql +25 -0
  21. package/migrations/sqlite/meta/0016_snapshot.json +1981 -0
  22. package/migrations/sqlite/meta/0017_snapshot.json +2041 -0
  23. package/migrations/sqlite/meta/0018_snapshot.json +2048 -0
  24. package/migrations/sqlite/meta/_journal.json +21 -0
  25. package/package.json +17 -47
  26. package/dist/chunk-GMV3B3SC.js.map +0 -1
  27. package/dist/chunk-SNNK2OX3.js.map +0 -1
  28. package/dist/register-N2XGSFUF.js +0 -8
  29. /package/dist/{register-N2XGSFUF.js.map → register-SBGUI2L5.js.map} +0 -0
@@ -0,0 +1,2306 @@
1
+ {
2
+ "id": "6dd7ed14-d3e8-4e4d-8291-539b60efabe5",
3
+ "prevId": "64a606b0-2874-4dde-b885-28e9086b6430",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.alert_subscriptions": {
8
+ "name": "alert_subscriptions",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "email": {
18
+ "name": "email",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "kind": {
24
+ "name": "kind",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "variant_id": {
30
+ "name": "variant_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "product_id": {
36
+ "name": "product_id",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "status": {
42
+ "name": "status",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": true
46
+ },
47
+ "confirm_token": {
48
+ "name": "confirm_token",
49
+ "type": "text",
50
+ "primaryKey": false,
51
+ "notNull": true
52
+ },
53
+ "unsubscribe_token": {
54
+ "name": "unsubscribe_token",
55
+ "type": "text",
56
+ "primaryKey": false,
57
+ "notNull": true
58
+ },
59
+ "origin": {
60
+ "name": "origin",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": true
64
+ },
65
+ "baseline_price_minor": {
66
+ "name": "baseline_price_minor",
67
+ "type": "integer",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "created_at": {
72
+ "name": "created_at",
73
+ "type": "timestamp with time zone",
74
+ "primaryKey": false,
75
+ "notNull": true
76
+ },
77
+ "updated_at": {
78
+ "name": "updated_at",
79
+ "type": "timestamp with time zone",
80
+ "primaryKey": false,
81
+ "notNull": true
82
+ },
83
+ "confirmed_at": {
84
+ "name": "confirmed_at",
85
+ "type": "timestamp with time zone",
86
+ "primaryKey": false,
87
+ "notNull": false
88
+ }
89
+ },
90
+ "indexes": {
91
+ "alert_subscriptions_address_unique": {
92
+ "name": "alert_subscriptions_address_unique",
93
+ "columns": [
94
+ {
95
+ "expression": "email",
96
+ "isExpression": false,
97
+ "asc": true,
98
+ "nulls": "last"
99
+ },
100
+ {
101
+ "expression": "variant_id",
102
+ "isExpression": false,
103
+ "asc": true,
104
+ "nulls": "last"
105
+ },
106
+ {
107
+ "expression": "kind",
108
+ "isExpression": false,
109
+ "asc": true,
110
+ "nulls": "last"
111
+ }
112
+ ],
113
+ "isUnique": true,
114
+ "concurrently": false,
115
+ "method": "btree",
116
+ "with": {}
117
+ },
118
+ "alert_subscriptions_confirm_token_unique": {
119
+ "name": "alert_subscriptions_confirm_token_unique",
120
+ "columns": [
121
+ {
122
+ "expression": "confirm_token",
123
+ "isExpression": false,
124
+ "asc": true,
125
+ "nulls": "last"
126
+ }
127
+ ],
128
+ "isUnique": true,
129
+ "concurrently": false,
130
+ "method": "btree",
131
+ "with": {}
132
+ },
133
+ "alert_subscriptions_unsubscribe_token_unique": {
134
+ "name": "alert_subscriptions_unsubscribe_token_unique",
135
+ "columns": [
136
+ {
137
+ "expression": "unsubscribe_token",
138
+ "isExpression": false,
139
+ "asc": true,
140
+ "nulls": "last"
141
+ }
142
+ ],
143
+ "isUnique": true,
144
+ "concurrently": false,
145
+ "method": "btree",
146
+ "with": {}
147
+ },
148
+ "alert_subscriptions_fan_out_idx": {
149
+ "name": "alert_subscriptions_fan_out_idx",
150
+ "columns": [
151
+ {
152
+ "expression": "variant_id",
153
+ "isExpression": false,
154
+ "asc": true,
155
+ "nulls": "last"
156
+ },
157
+ {
158
+ "expression": "kind",
159
+ "isExpression": false,
160
+ "asc": true,
161
+ "nulls": "last"
162
+ },
163
+ {
164
+ "expression": "status",
165
+ "isExpression": false,
166
+ "asc": true,
167
+ "nulls": "last"
168
+ }
169
+ ],
170
+ "isUnique": false,
171
+ "concurrently": false,
172
+ "method": "btree",
173
+ "with": {}
174
+ }
175
+ },
176
+ "foreignKeys": {},
177
+ "compositePrimaryKeys": {},
178
+ "uniqueConstraints": {},
179
+ "policies": {},
180
+ "checkConstraints": {
181
+ "alert_subscriptions_kind": {
182
+ "name": "alert_subscriptions_kind",
183
+ "value": "\"alert_subscriptions\".\"kind\" IN ('back_in_stock', 'price_drop')"
184
+ },
185
+ "alert_subscriptions_status": {
186
+ "name": "alert_subscriptions_status",
187
+ "value": "\"alert_subscriptions\".\"status\" IN ('pending', 'active', 'fired', 'unsubscribed')"
188
+ }
189
+ },
190
+ "isRLSEnabled": false
191
+ },
192
+ "public.audit_entries": {
193
+ "name": "audit_entries",
194
+ "schema": "",
195
+ "columns": {
196
+ "id": {
197
+ "name": "id",
198
+ "type": "text",
199
+ "primaryKey": true,
200
+ "notNull": true
201
+ },
202
+ "at": {
203
+ "name": "at",
204
+ "type": "timestamp with time zone",
205
+ "primaryKey": false,
206
+ "notNull": true
207
+ },
208
+ "actor_kind": {
209
+ "name": "actor_kind",
210
+ "type": "text",
211
+ "primaryKey": false,
212
+ "notNull": true
213
+ },
214
+ "actor_id": {
215
+ "name": "actor_id",
216
+ "type": "text",
217
+ "primaryKey": false,
218
+ "notNull": true
219
+ },
220
+ "command": {
221
+ "name": "command",
222
+ "type": "text",
223
+ "primaryKey": false,
224
+ "notNull": true
225
+ },
226
+ "subjects": {
227
+ "name": "subjects",
228
+ "type": "jsonb",
229
+ "primaryKey": false,
230
+ "notNull": true
231
+ },
232
+ "correlation_id": {
233
+ "name": "correlation_id",
234
+ "type": "text",
235
+ "primaryKey": false,
236
+ "notNull": false
237
+ },
238
+ "idempotency_key": {
239
+ "name": "idempotency_key",
240
+ "type": "text",
241
+ "primaryKey": false,
242
+ "notNull": false
243
+ },
244
+ "request_hash": {
245
+ "name": "request_hash",
246
+ "type": "text",
247
+ "primaryKey": false,
248
+ "notNull": false
249
+ },
250
+ "outcome": {
251
+ "name": "outcome",
252
+ "type": "text",
253
+ "primaryKey": false,
254
+ "notNull": true
255
+ },
256
+ "response_status": {
257
+ "name": "response_status",
258
+ "type": "integer",
259
+ "primaryKey": false,
260
+ "notNull": false
261
+ },
262
+ "response_body": {
263
+ "name": "response_body",
264
+ "type": "jsonb",
265
+ "primaryKey": false,
266
+ "notNull": false
267
+ }
268
+ },
269
+ "indexes": {
270
+ "audit_entries_applied_key_unique": {
271
+ "name": "audit_entries_applied_key_unique",
272
+ "columns": [
273
+ {
274
+ "expression": "actor_id",
275
+ "isExpression": false,
276
+ "asc": true,
277
+ "nulls": "last"
278
+ },
279
+ {
280
+ "expression": "command",
281
+ "isExpression": false,
282
+ "asc": true,
283
+ "nulls": "last"
284
+ },
285
+ {
286
+ "expression": "idempotency_key",
287
+ "isExpression": false,
288
+ "asc": true,
289
+ "nulls": "last"
290
+ }
291
+ ],
292
+ "isUnique": true,
293
+ "where": "\"audit_entries\".\"outcome\" = 'applied' AND \"audit_entries\".\"idempotency_key\" IS NOT NULL",
294
+ "concurrently": false,
295
+ "method": "btree",
296
+ "with": {}
297
+ },
298
+ "audit_entries_at_idx": {
299
+ "name": "audit_entries_at_idx",
300
+ "columns": [
301
+ {
302
+ "expression": "at",
303
+ "isExpression": false,
304
+ "asc": true,
305
+ "nulls": "last"
306
+ },
307
+ {
308
+ "expression": "id",
309
+ "isExpression": false,
310
+ "asc": true,
311
+ "nulls": "last"
312
+ }
313
+ ],
314
+ "isUnique": false,
315
+ "concurrently": false,
316
+ "method": "btree",
317
+ "with": {}
318
+ },
319
+ "audit_entries_correlation_idx": {
320
+ "name": "audit_entries_correlation_idx",
321
+ "columns": [
322
+ {
323
+ "expression": "correlation_id",
324
+ "isExpression": false,
325
+ "asc": true,
326
+ "nulls": "last"
327
+ }
328
+ ],
329
+ "isUnique": false,
330
+ "concurrently": false,
331
+ "method": "btree",
332
+ "with": {}
333
+ }
334
+ },
335
+ "foreignKeys": {},
336
+ "compositePrimaryKeys": {},
337
+ "uniqueConstraints": {},
338
+ "policies": {},
339
+ "checkConstraints": {
340
+ "audit_entries_outcome": {
341
+ "name": "audit_entries_outcome",
342
+ "value": "\"audit_entries\".\"outcome\" IN ('applied', 'refused', 'replayed')"
343
+ }
344
+ },
345
+ "isRLSEnabled": false
346
+ },
347
+ "public.carts": {
348
+ "name": "carts",
349
+ "schema": "",
350
+ "columns": {
351
+ "token": {
352
+ "name": "token",
353
+ "type": "text",
354
+ "primaryKey": true,
355
+ "notNull": true
356
+ },
357
+ "customer_id": {
358
+ "name": "customer_id",
359
+ "type": "text",
360
+ "primaryKey": false,
361
+ "notNull": false
362
+ },
363
+ "currency": {
364
+ "name": "currency",
365
+ "type": "text",
366
+ "primaryKey": false,
367
+ "notNull": true
368
+ },
369
+ "items": {
370
+ "name": "items",
371
+ "type": "jsonb",
372
+ "primaryKey": false,
373
+ "notNull": true,
374
+ "default": "'[]'::jsonb"
375
+ },
376
+ "line_count": {
377
+ "name": "line_count",
378
+ "type": "integer",
379
+ "primaryKey": false,
380
+ "notNull": true,
381
+ "default": 0
382
+ },
383
+ "subtotal_minor": {
384
+ "name": "subtotal_minor",
385
+ "type": "integer",
386
+ "primaryKey": false,
387
+ "notNull": true,
388
+ "default": 0
389
+ },
390
+ "expires_at": {
391
+ "name": "expires_at",
392
+ "type": "timestamp with time zone",
393
+ "primaryKey": false,
394
+ "notNull": true
395
+ },
396
+ "created_at": {
397
+ "name": "created_at",
398
+ "type": "timestamp with time zone",
399
+ "primaryKey": false,
400
+ "notNull": true
401
+ },
402
+ "updated_at": {
403
+ "name": "updated_at",
404
+ "type": "timestamp with time zone",
405
+ "primaryKey": false,
406
+ "notNull": true
407
+ },
408
+ "abandoned_notified_at": {
409
+ "name": "abandoned_notified_at",
410
+ "type": "timestamp with time zone",
411
+ "primaryKey": false,
412
+ "notNull": false
413
+ }
414
+ },
415
+ "indexes": {
416
+ "carts_expires_idx": {
417
+ "name": "carts_expires_idx",
418
+ "columns": [
419
+ {
420
+ "expression": "expires_at",
421
+ "isExpression": false,
422
+ "asc": true,
423
+ "nulls": "last"
424
+ }
425
+ ],
426
+ "isUnique": false,
427
+ "concurrently": false,
428
+ "method": "btree",
429
+ "with": {}
430
+ },
431
+ "carts_updated_idx": {
432
+ "name": "carts_updated_idx",
433
+ "columns": [
434
+ {
435
+ "expression": "updated_at",
436
+ "isExpression": false,
437
+ "asc": true,
438
+ "nulls": "last"
439
+ }
440
+ ],
441
+ "isUnique": false,
442
+ "concurrently": false,
443
+ "method": "btree",
444
+ "with": {}
445
+ }
446
+ },
447
+ "foreignKeys": {},
448
+ "compositePrimaryKeys": {},
449
+ "uniqueConstraints": {},
450
+ "policies": {},
451
+ "checkConstraints": {},
452
+ "isRLSEnabled": false
453
+ },
454
+ "public.categories": {
455
+ "name": "categories",
456
+ "schema": "",
457
+ "columns": {
458
+ "id": {
459
+ "name": "id",
460
+ "type": "text",
461
+ "primaryKey": true,
462
+ "notNull": true
463
+ },
464
+ "parent_id": {
465
+ "name": "parent_id",
466
+ "type": "text",
467
+ "primaryKey": false,
468
+ "notNull": false
469
+ },
470
+ "slug": {
471
+ "name": "slug",
472
+ "type": "text",
473
+ "primaryKey": false,
474
+ "notNull": true
475
+ },
476
+ "name": {
477
+ "name": "name",
478
+ "type": "text",
479
+ "primaryKey": false,
480
+ "notNull": true
481
+ },
482
+ "description": {
483
+ "name": "description",
484
+ "type": "text",
485
+ "primaryKey": false,
486
+ "notNull": true,
487
+ "default": "''"
488
+ },
489
+ "position": {
490
+ "name": "position",
491
+ "type": "integer",
492
+ "primaryKey": false,
493
+ "notNull": true,
494
+ "default": 0
495
+ },
496
+ "created_at": {
497
+ "name": "created_at",
498
+ "type": "timestamp with time zone",
499
+ "primaryKey": false,
500
+ "notNull": true
501
+ }
502
+ },
503
+ "indexes": {
504
+ "categories_slug_unique": {
505
+ "name": "categories_slug_unique",
506
+ "columns": [
507
+ {
508
+ "expression": "slug",
509
+ "isExpression": false,
510
+ "asc": true,
511
+ "nulls": "last"
512
+ }
513
+ ],
514
+ "isUnique": true,
515
+ "concurrently": false,
516
+ "method": "btree",
517
+ "with": {}
518
+ },
519
+ "categories_parent_idx": {
520
+ "name": "categories_parent_idx",
521
+ "columns": [
522
+ {
523
+ "expression": "parent_id",
524
+ "isExpression": false,
525
+ "asc": true,
526
+ "nulls": "last"
527
+ }
528
+ ],
529
+ "isUnique": false,
530
+ "concurrently": false,
531
+ "method": "btree",
532
+ "with": {}
533
+ }
534
+ },
535
+ "foreignKeys": {},
536
+ "compositePrimaryKeys": {},
537
+ "uniqueConstraints": {},
538
+ "policies": {},
539
+ "checkConstraints": {},
540
+ "isRLSEnabled": false
541
+ },
542
+ "public.customers": {
543
+ "name": "customers",
544
+ "schema": "",
545
+ "columns": {
546
+ "id": {
547
+ "name": "id",
548
+ "type": "text",
549
+ "primaryKey": true,
550
+ "notNull": true
551
+ },
552
+ "email": {
553
+ "name": "email",
554
+ "type": "text",
555
+ "primaryKey": false,
556
+ "notNull": true
557
+ },
558
+ "password_hash": {
559
+ "name": "password_hash",
560
+ "type": "text",
561
+ "primaryKey": false,
562
+ "notNull": true
563
+ },
564
+ "first_name": {
565
+ "name": "first_name",
566
+ "type": "text",
567
+ "primaryKey": false,
568
+ "notNull": true,
569
+ "default": "''"
570
+ },
571
+ "last_name": {
572
+ "name": "last_name",
573
+ "type": "text",
574
+ "primaryKey": false,
575
+ "notNull": true,
576
+ "default": "''"
577
+ },
578
+ "phone": {
579
+ "name": "phone",
580
+ "type": "text",
581
+ "primaryKey": false,
582
+ "notNull": true,
583
+ "default": "''"
584
+ },
585
+ "addresses": {
586
+ "name": "addresses",
587
+ "type": "jsonb",
588
+ "primaryKey": false,
589
+ "notNull": true,
590
+ "default": "'[]'::jsonb"
591
+ },
592
+ "order_count": {
593
+ "name": "order_count",
594
+ "type": "integer",
595
+ "primaryKey": false,
596
+ "notNull": true,
597
+ "default": 0
598
+ },
599
+ "total_spent_minor": {
600
+ "name": "total_spent_minor",
601
+ "type": "integer",
602
+ "primaryKey": false,
603
+ "notNull": true,
604
+ "default": 0
605
+ },
606
+ "metadata": {
607
+ "name": "metadata",
608
+ "type": "jsonb",
609
+ "primaryKey": false,
610
+ "notNull": true,
611
+ "default": "'{}'::jsonb"
612
+ },
613
+ "roles": {
614
+ "name": "roles",
615
+ "type": "jsonb",
616
+ "primaryKey": false,
617
+ "notNull": true,
618
+ "default": "'[\"customer\"]'::jsonb"
619
+ },
620
+ "requires_password_reset": {
621
+ "name": "requires_password_reset",
622
+ "type": "boolean",
623
+ "primaryKey": false,
624
+ "notNull": true,
625
+ "default": false
626
+ },
627
+ "created_at": {
628
+ "name": "created_at",
629
+ "type": "timestamp with time zone",
630
+ "primaryKey": false,
631
+ "notNull": true
632
+ },
633
+ "updated_at": {
634
+ "name": "updated_at",
635
+ "type": "timestamp with time zone",
636
+ "primaryKey": false,
637
+ "notNull": true
638
+ }
639
+ },
640
+ "indexes": {
641
+ "customers_email_unique": {
642
+ "name": "customers_email_unique",
643
+ "columns": [
644
+ {
645
+ "expression": "email",
646
+ "isExpression": false,
647
+ "asc": true,
648
+ "nulls": "last"
649
+ }
650
+ ],
651
+ "isUnique": true,
652
+ "concurrently": false,
653
+ "method": "btree",
654
+ "with": {}
655
+ }
656
+ },
657
+ "foreignKeys": {},
658
+ "compositePrimaryKeys": {},
659
+ "uniqueConstraints": {},
660
+ "policies": {},
661
+ "checkConstraints": {},
662
+ "isRLSEnabled": false
663
+ },
664
+ "public.email_suppressions": {
665
+ "name": "email_suppressions",
666
+ "schema": "",
667
+ "columns": {
668
+ "email": {
669
+ "name": "email",
670
+ "type": "text",
671
+ "primaryKey": true,
672
+ "notNull": true
673
+ },
674
+ "reason": {
675
+ "name": "reason",
676
+ "type": "text",
677
+ "primaryKey": false,
678
+ "notNull": true
679
+ },
680
+ "event_id": {
681
+ "name": "event_id",
682
+ "type": "text",
683
+ "primaryKey": false,
684
+ "notNull": true
685
+ },
686
+ "created_at": {
687
+ "name": "created_at",
688
+ "type": "timestamp with time zone",
689
+ "primaryKey": false,
690
+ "notNull": true
691
+ }
692
+ },
693
+ "indexes": {},
694
+ "foreignKeys": {},
695
+ "compositePrimaryKeys": {},
696
+ "uniqueConstraints": {},
697
+ "policies": {},
698
+ "checkConstraints": {
699
+ "email_suppressions_reason": {
700
+ "name": "email_suppressions_reason",
701
+ "value": "\"email_suppressions\".\"reason\" IN ('hard_bounce', 'complaint')"
702
+ }
703
+ },
704
+ "isRLSEnabled": false
705
+ },
706
+ "public.events": {
707
+ "name": "events",
708
+ "schema": "",
709
+ "columns": {
710
+ "seq": {
711
+ "name": "seq",
712
+ "type": "bigserial",
713
+ "primaryKey": true,
714
+ "notNull": true
715
+ },
716
+ "id": {
717
+ "name": "id",
718
+ "type": "text",
719
+ "primaryKey": false,
720
+ "notNull": true
721
+ },
722
+ "type": {
723
+ "name": "type",
724
+ "type": "text",
725
+ "primaryKey": false,
726
+ "notNull": true
727
+ },
728
+ "envelope": {
729
+ "name": "envelope",
730
+ "type": "jsonb",
731
+ "primaryKey": false,
732
+ "notNull": true
733
+ },
734
+ "correlation_id": {
735
+ "name": "correlation_id",
736
+ "type": "text",
737
+ "primaryKey": false,
738
+ "notNull": true
739
+ },
740
+ "created_at": {
741
+ "name": "created_at",
742
+ "type": "timestamp with time zone",
743
+ "primaryKey": false,
744
+ "notNull": true
745
+ },
746
+ "subject_type": {
747
+ "name": "subject_type",
748
+ "type": "text",
749
+ "primaryKey": false,
750
+ "notNull": false
751
+ },
752
+ "subject_id": {
753
+ "name": "subject_id",
754
+ "type": "text",
755
+ "primaryKey": false,
756
+ "notNull": false
757
+ },
758
+ "delivered_at": {
759
+ "name": "delivered_at",
760
+ "type": "timestamp with time zone",
761
+ "primaryKey": false,
762
+ "notNull": false
763
+ },
764
+ "attempts": {
765
+ "name": "attempts",
766
+ "type": "integer",
767
+ "primaryKey": false,
768
+ "notNull": true,
769
+ "default": 0
770
+ },
771
+ "dead_at": {
772
+ "name": "dead_at",
773
+ "type": "timestamp with time zone",
774
+ "primaryKey": false,
775
+ "notNull": false
776
+ },
777
+ "retry_at": {
778
+ "name": "retry_at",
779
+ "type": "timestamp with time zone",
780
+ "primaryKey": false,
781
+ "notNull": false
782
+ }
783
+ },
784
+ "indexes": {
785
+ "events_id_unique": {
786
+ "name": "events_id_unique",
787
+ "columns": [
788
+ {
789
+ "expression": "id",
790
+ "isExpression": false,
791
+ "asc": true,
792
+ "nulls": "last"
793
+ }
794
+ ],
795
+ "isUnique": true,
796
+ "concurrently": false,
797
+ "method": "btree",
798
+ "with": {}
799
+ },
800
+ "events_undelivered_idx": {
801
+ "name": "events_undelivered_idx",
802
+ "columns": [
803
+ {
804
+ "expression": "delivered_at",
805
+ "isExpression": false,
806
+ "asc": true,
807
+ "nulls": "last"
808
+ },
809
+ {
810
+ "expression": "seq",
811
+ "isExpression": false,
812
+ "asc": true,
813
+ "nulls": "last"
814
+ }
815
+ ],
816
+ "isUnique": false,
817
+ "concurrently": false,
818
+ "method": "btree",
819
+ "with": {}
820
+ },
821
+ "events_correlation_idx": {
822
+ "name": "events_correlation_idx",
823
+ "columns": [
824
+ {
825
+ "expression": "correlation_id",
826
+ "isExpression": false,
827
+ "asc": true,
828
+ "nulls": "last"
829
+ },
830
+ {
831
+ "expression": "seq",
832
+ "isExpression": false,
833
+ "asc": true,
834
+ "nulls": "last"
835
+ }
836
+ ],
837
+ "isUnique": false,
838
+ "concurrently": false,
839
+ "method": "btree",
840
+ "with": {}
841
+ },
842
+ "events_catch_up_idx": {
843
+ "name": "events_catch_up_idx",
844
+ "columns": [
845
+ {
846
+ "expression": "dead_at",
847
+ "isExpression": false,
848
+ "asc": true,
849
+ "nulls": "last"
850
+ },
851
+ {
852
+ "expression": "delivered_at",
853
+ "isExpression": false,
854
+ "asc": true,
855
+ "nulls": "last"
856
+ },
857
+ {
858
+ "expression": "seq",
859
+ "isExpression": false,
860
+ "asc": true,
861
+ "nulls": "last"
862
+ }
863
+ ],
864
+ "isUnique": false,
865
+ "concurrently": false,
866
+ "method": "btree",
867
+ "with": {}
868
+ },
869
+ "events_subject_idx": {
870
+ "name": "events_subject_idx",
871
+ "columns": [
872
+ {
873
+ "expression": "subject_type",
874
+ "isExpression": false,
875
+ "asc": true,
876
+ "nulls": "last"
877
+ },
878
+ {
879
+ "expression": "subject_id",
880
+ "isExpression": false,
881
+ "asc": true,
882
+ "nulls": "last"
883
+ },
884
+ {
885
+ "expression": "seq",
886
+ "isExpression": false,
887
+ "asc": true,
888
+ "nulls": "last"
889
+ }
890
+ ],
891
+ "isUnique": false,
892
+ "concurrently": false,
893
+ "method": "btree",
894
+ "with": {}
895
+ }
896
+ },
897
+ "foreignKeys": {},
898
+ "compositePrimaryKeys": {},
899
+ "uniqueConstraints": {},
900
+ "policies": {},
901
+ "checkConstraints": {},
902
+ "isRLSEnabled": false
903
+ },
904
+ "public.inventory_reservations": {
905
+ "name": "inventory_reservations",
906
+ "schema": "",
907
+ "columns": {
908
+ "reservation_id": {
909
+ "name": "reservation_id",
910
+ "type": "text",
911
+ "primaryKey": true,
912
+ "notNull": true
913
+ },
914
+ "variant_id": {
915
+ "name": "variant_id",
916
+ "type": "text",
917
+ "primaryKey": false,
918
+ "notNull": true
919
+ },
920
+ "qty": {
921
+ "name": "qty",
922
+ "type": "integer",
923
+ "primaryKey": false,
924
+ "notNull": true
925
+ },
926
+ "order_ref": {
927
+ "name": "order_ref",
928
+ "type": "text",
929
+ "primaryKey": false,
930
+ "notNull": false
931
+ },
932
+ "expires_at": {
933
+ "name": "expires_at",
934
+ "type": "timestamp with time zone",
935
+ "primaryKey": false,
936
+ "notNull": true
937
+ },
938
+ "created_at": {
939
+ "name": "created_at",
940
+ "type": "timestamp with time zone",
941
+ "primaryKey": false,
942
+ "notNull": true
943
+ }
944
+ },
945
+ "indexes": {
946
+ "inv_reservations_variant_idx": {
947
+ "name": "inv_reservations_variant_idx",
948
+ "columns": [
949
+ {
950
+ "expression": "variant_id",
951
+ "isExpression": false,
952
+ "asc": true,
953
+ "nulls": "last"
954
+ }
955
+ ],
956
+ "isUnique": false,
957
+ "concurrently": false,
958
+ "method": "btree",
959
+ "with": {}
960
+ },
961
+ "inv_reservations_expires_idx": {
962
+ "name": "inv_reservations_expires_idx",
963
+ "columns": [
964
+ {
965
+ "expression": "expires_at",
966
+ "isExpression": false,
967
+ "asc": true,
968
+ "nulls": "last"
969
+ }
970
+ ],
971
+ "isUnique": false,
972
+ "concurrently": false,
973
+ "method": "btree",
974
+ "with": {}
975
+ }
976
+ },
977
+ "foreignKeys": {},
978
+ "compositePrimaryKeys": {},
979
+ "uniqueConstraints": {},
980
+ "policies": {},
981
+ "checkConstraints": {},
982
+ "isRLSEnabled": false
983
+ },
984
+ "public.order_access_keys": {
985
+ "name": "order_access_keys",
986
+ "schema": "",
987
+ "columns": {
988
+ "id": {
989
+ "name": "id",
990
+ "type": "text",
991
+ "primaryKey": true,
992
+ "notNull": true
993
+ },
994
+ "order_id": {
995
+ "name": "order_id",
996
+ "type": "text",
997
+ "primaryKey": false,
998
+ "notNull": true
999
+ },
1000
+ "key_hash": {
1001
+ "name": "key_hash",
1002
+ "type": "text",
1003
+ "primaryKey": false,
1004
+ "notNull": true
1005
+ },
1006
+ "purpose": {
1007
+ "name": "purpose",
1008
+ "type": "text",
1009
+ "primaryKey": false,
1010
+ "notNull": true
1011
+ },
1012
+ "created_at": {
1013
+ "name": "created_at",
1014
+ "type": "timestamp with time zone",
1015
+ "primaryKey": false,
1016
+ "notNull": true
1017
+ },
1018
+ "expires_at": {
1019
+ "name": "expires_at",
1020
+ "type": "timestamp with time zone",
1021
+ "primaryKey": false,
1022
+ "notNull": true
1023
+ }
1024
+ },
1025
+ "indexes": {
1026
+ "order_access_keys_key_hash_idx": {
1027
+ "name": "order_access_keys_key_hash_idx",
1028
+ "columns": [
1029
+ {
1030
+ "expression": "key_hash",
1031
+ "isExpression": false,
1032
+ "asc": true,
1033
+ "nulls": "last"
1034
+ }
1035
+ ],
1036
+ "isUnique": true,
1037
+ "concurrently": false,
1038
+ "method": "btree",
1039
+ "with": {}
1040
+ },
1041
+ "order_access_keys_order_idx": {
1042
+ "name": "order_access_keys_order_idx",
1043
+ "columns": [
1044
+ {
1045
+ "expression": "order_id",
1046
+ "isExpression": false,
1047
+ "asc": true,
1048
+ "nulls": "last"
1049
+ }
1050
+ ],
1051
+ "isUnique": false,
1052
+ "concurrently": false,
1053
+ "method": "btree",
1054
+ "with": {}
1055
+ }
1056
+ },
1057
+ "foreignKeys": {},
1058
+ "compositePrimaryKeys": {},
1059
+ "uniqueConstraints": {},
1060
+ "policies": {},
1061
+ "checkConstraints": {},
1062
+ "isRLSEnabled": false
1063
+ },
1064
+ "public.order_history": {
1065
+ "name": "order_history",
1066
+ "schema": "",
1067
+ "columns": {
1068
+ "id": {
1069
+ "name": "id",
1070
+ "type": "text",
1071
+ "primaryKey": true,
1072
+ "notNull": true
1073
+ },
1074
+ "order_id": {
1075
+ "name": "order_id",
1076
+ "type": "text",
1077
+ "primaryKey": false,
1078
+ "notNull": true
1079
+ },
1080
+ "from_status": {
1081
+ "name": "from_status",
1082
+ "type": "text",
1083
+ "primaryKey": false,
1084
+ "notNull": false
1085
+ },
1086
+ "to_status": {
1087
+ "name": "to_status",
1088
+ "type": "text",
1089
+ "primaryKey": false,
1090
+ "notNull": true
1091
+ },
1092
+ "actor": {
1093
+ "name": "actor",
1094
+ "type": "text",
1095
+ "primaryKey": false,
1096
+ "notNull": true
1097
+ },
1098
+ "note": {
1099
+ "name": "note",
1100
+ "type": "text",
1101
+ "primaryKey": false,
1102
+ "notNull": true,
1103
+ "default": "''"
1104
+ },
1105
+ "timestamp": {
1106
+ "name": "timestamp",
1107
+ "type": "timestamp with time zone",
1108
+ "primaryKey": false,
1109
+ "notNull": true
1110
+ }
1111
+ },
1112
+ "indexes": {
1113
+ "order_history_order_idx": {
1114
+ "name": "order_history_order_idx",
1115
+ "columns": [
1116
+ {
1117
+ "expression": "order_id",
1118
+ "isExpression": false,
1119
+ "asc": true,
1120
+ "nulls": "last"
1121
+ }
1122
+ ],
1123
+ "isUnique": false,
1124
+ "concurrently": false,
1125
+ "method": "btree",
1126
+ "with": {}
1127
+ }
1128
+ },
1129
+ "foreignKeys": {},
1130
+ "compositePrimaryKeys": {},
1131
+ "uniqueConstraints": {},
1132
+ "policies": {},
1133
+ "checkConstraints": {},
1134
+ "isRLSEnabled": false
1135
+ },
1136
+ "public.order_refunds": {
1137
+ "name": "order_refunds",
1138
+ "schema": "",
1139
+ "columns": {
1140
+ "id": {
1141
+ "name": "id",
1142
+ "type": "text",
1143
+ "primaryKey": true,
1144
+ "notNull": true
1145
+ },
1146
+ "order_id": {
1147
+ "name": "order_id",
1148
+ "type": "text",
1149
+ "primaryKey": false,
1150
+ "notNull": true
1151
+ },
1152
+ "amount_minor": {
1153
+ "name": "amount_minor",
1154
+ "type": "integer",
1155
+ "primaryKey": false,
1156
+ "notNull": true
1157
+ },
1158
+ "currency": {
1159
+ "name": "currency",
1160
+ "type": "text",
1161
+ "primaryKey": false,
1162
+ "notNull": true
1163
+ },
1164
+ "provider_refund_id": {
1165
+ "name": "provider_refund_id",
1166
+ "type": "text",
1167
+ "primaryKey": false,
1168
+ "notNull": false
1169
+ },
1170
+ "status": {
1171
+ "name": "status",
1172
+ "type": "text",
1173
+ "primaryKey": false,
1174
+ "notNull": true,
1175
+ "default": "'pending'"
1176
+ },
1177
+ "reason": {
1178
+ "name": "reason",
1179
+ "type": "text",
1180
+ "primaryKey": false,
1181
+ "notNull": false
1182
+ },
1183
+ "actor": {
1184
+ "name": "actor",
1185
+ "type": "text",
1186
+ "primaryKey": false,
1187
+ "notNull": true
1188
+ },
1189
+ "created_at": {
1190
+ "name": "created_at",
1191
+ "type": "timestamp with time zone",
1192
+ "primaryKey": false,
1193
+ "notNull": true
1194
+ },
1195
+ "request_id": {
1196
+ "name": "request_id",
1197
+ "type": "text",
1198
+ "primaryKey": false,
1199
+ "notNull": false
1200
+ }
1201
+ },
1202
+ "indexes": {
1203
+ "order_refunds_order_idx": {
1204
+ "name": "order_refunds_order_idx",
1205
+ "columns": [
1206
+ {
1207
+ "expression": "order_id",
1208
+ "isExpression": false,
1209
+ "asc": true,
1210
+ "nulls": "last"
1211
+ }
1212
+ ],
1213
+ "isUnique": false,
1214
+ "concurrently": false,
1215
+ "method": "btree",
1216
+ "with": {}
1217
+ },
1218
+ "order_refunds_order_request_idx": {
1219
+ "name": "order_refunds_order_request_idx",
1220
+ "columns": [
1221
+ {
1222
+ "expression": "order_id",
1223
+ "isExpression": false,
1224
+ "asc": true,
1225
+ "nulls": "last"
1226
+ },
1227
+ {
1228
+ "expression": "request_id",
1229
+ "isExpression": false,
1230
+ "asc": true,
1231
+ "nulls": "last"
1232
+ }
1233
+ ],
1234
+ "isUnique": true,
1235
+ "concurrently": false,
1236
+ "method": "btree",
1237
+ "with": {}
1238
+ }
1239
+ },
1240
+ "foreignKeys": {},
1241
+ "compositePrimaryKeys": {},
1242
+ "uniqueConstraints": {},
1243
+ "policies": {},
1244
+ "checkConstraints": {},
1245
+ "isRLSEnabled": false
1246
+ },
1247
+ "public.order_sequences": {
1248
+ "name": "order_sequences",
1249
+ "schema": "",
1250
+ "columns": {
1251
+ "id": {
1252
+ "name": "id",
1253
+ "type": "integer",
1254
+ "primaryKey": true,
1255
+ "notNull": true
1256
+ },
1257
+ "next_value": {
1258
+ "name": "next_value",
1259
+ "type": "integer",
1260
+ "primaryKey": false,
1261
+ "notNull": true
1262
+ }
1263
+ },
1264
+ "indexes": {},
1265
+ "foreignKeys": {},
1266
+ "compositePrimaryKeys": {},
1267
+ "uniqueConstraints": {},
1268
+ "policies": {},
1269
+ "checkConstraints": {},
1270
+ "isRLSEnabled": false
1271
+ },
1272
+ "public.order_shipments": {
1273
+ "name": "order_shipments",
1274
+ "schema": "",
1275
+ "columns": {
1276
+ "order_id": {
1277
+ "name": "order_id",
1278
+ "type": "text",
1279
+ "primaryKey": true,
1280
+ "notNull": true
1281
+ },
1282
+ "carrier": {
1283
+ "name": "carrier",
1284
+ "type": "text",
1285
+ "primaryKey": false,
1286
+ "notNull": true
1287
+ },
1288
+ "tracking_number": {
1289
+ "name": "tracking_number",
1290
+ "type": "text",
1291
+ "primaryKey": false,
1292
+ "notNull": true
1293
+ },
1294
+ "created_at": {
1295
+ "name": "created_at",
1296
+ "type": "timestamp with time zone",
1297
+ "primaryKey": false,
1298
+ "notNull": true
1299
+ }
1300
+ },
1301
+ "indexes": {
1302
+ "order_shipments_tracking_number_idx": {
1303
+ "name": "order_shipments_tracking_number_idx",
1304
+ "columns": [
1305
+ {
1306
+ "expression": "tracking_number",
1307
+ "isExpression": false,
1308
+ "asc": true,
1309
+ "nulls": "last"
1310
+ }
1311
+ ],
1312
+ "isUnique": false,
1313
+ "concurrently": false,
1314
+ "method": "btree",
1315
+ "with": {}
1316
+ }
1317
+ },
1318
+ "foreignKeys": {
1319
+ "order_shipments_order_id_orders_id_fk": {
1320
+ "name": "order_shipments_order_id_orders_id_fk",
1321
+ "tableFrom": "order_shipments",
1322
+ "tableTo": "orders",
1323
+ "columnsFrom": [
1324
+ "order_id"
1325
+ ],
1326
+ "columnsTo": [
1327
+ "id"
1328
+ ],
1329
+ "onDelete": "no action",
1330
+ "onUpdate": "no action"
1331
+ }
1332
+ },
1333
+ "compositePrimaryKeys": {},
1334
+ "uniqueConstraints": {},
1335
+ "policies": {},
1336
+ "checkConstraints": {},
1337
+ "isRLSEnabled": false
1338
+ },
1339
+ "public.orders": {
1340
+ "name": "orders",
1341
+ "schema": "",
1342
+ "columns": {
1343
+ "id": {
1344
+ "name": "id",
1345
+ "type": "text",
1346
+ "primaryKey": true,
1347
+ "notNull": true
1348
+ },
1349
+ "order_number": {
1350
+ "name": "order_number",
1351
+ "type": "text",
1352
+ "primaryKey": false,
1353
+ "notNull": true
1354
+ },
1355
+ "sequence": {
1356
+ "name": "sequence",
1357
+ "type": "integer",
1358
+ "primaryKey": false,
1359
+ "notNull": true
1360
+ },
1361
+ "customer_id": {
1362
+ "name": "customer_id",
1363
+ "type": "text",
1364
+ "primaryKey": false,
1365
+ "notNull": false
1366
+ },
1367
+ "status": {
1368
+ "name": "status",
1369
+ "type": "text",
1370
+ "primaryKey": false,
1371
+ "notNull": true,
1372
+ "default": "'pending'"
1373
+ },
1374
+ "email": {
1375
+ "name": "email",
1376
+ "type": "text",
1377
+ "primaryKey": false,
1378
+ "notNull": true
1379
+ },
1380
+ "billing_address": {
1381
+ "name": "billing_address",
1382
+ "type": "jsonb",
1383
+ "primaryKey": false,
1384
+ "notNull": true
1385
+ },
1386
+ "shipping_address": {
1387
+ "name": "shipping_address",
1388
+ "type": "jsonb",
1389
+ "primaryKey": false,
1390
+ "notNull": true
1391
+ },
1392
+ "line_items": {
1393
+ "name": "line_items",
1394
+ "type": "jsonb",
1395
+ "primaryKey": false,
1396
+ "notNull": true
1397
+ },
1398
+ "subtotal_minor": {
1399
+ "name": "subtotal_minor",
1400
+ "type": "integer",
1401
+ "primaryKey": false,
1402
+ "notNull": true
1403
+ },
1404
+ "tax_total_minor": {
1405
+ "name": "tax_total_minor",
1406
+ "type": "integer",
1407
+ "primaryKey": false,
1408
+ "notNull": true,
1409
+ "default": 0
1410
+ },
1411
+ "shipping_total_minor": {
1412
+ "name": "shipping_total_minor",
1413
+ "type": "integer",
1414
+ "primaryKey": false,
1415
+ "notNull": true,
1416
+ "default": 0
1417
+ },
1418
+ "discount_total_minor": {
1419
+ "name": "discount_total_minor",
1420
+ "type": "integer",
1421
+ "primaryKey": false,
1422
+ "notNull": true,
1423
+ "default": 0
1424
+ },
1425
+ "total_minor": {
1426
+ "name": "total_minor",
1427
+ "type": "integer",
1428
+ "primaryKey": false,
1429
+ "notNull": true
1430
+ },
1431
+ "currency": {
1432
+ "name": "currency",
1433
+ "type": "text",
1434
+ "primaryKey": false,
1435
+ "notNull": true
1436
+ },
1437
+ "notes": {
1438
+ "name": "notes",
1439
+ "type": "text",
1440
+ "primaryKey": false,
1441
+ "notNull": true,
1442
+ "default": "''"
1443
+ },
1444
+ "metadata": {
1445
+ "name": "metadata",
1446
+ "type": "jsonb",
1447
+ "primaryKey": false,
1448
+ "notNull": true,
1449
+ "default": "'{}'::jsonb"
1450
+ },
1451
+ "payment_intent_id": {
1452
+ "name": "payment_intent_id",
1453
+ "type": "text",
1454
+ "primaryKey": false,
1455
+ "notNull": false
1456
+ },
1457
+ "cart_token": {
1458
+ "name": "cart_token",
1459
+ "type": "text",
1460
+ "primaryKey": false,
1461
+ "notNull": false
1462
+ },
1463
+ "captured_minor": {
1464
+ "name": "captured_minor",
1465
+ "type": "integer",
1466
+ "primaryKey": false,
1467
+ "notNull": true,
1468
+ "default": 0
1469
+ },
1470
+ "captured_at": {
1471
+ "name": "captured_at",
1472
+ "type": "timestamp with time zone",
1473
+ "primaryKey": false,
1474
+ "notNull": false
1475
+ },
1476
+ "refunded_minor": {
1477
+ "name": "refunded_minor",
1478
+ "type": "integer",
1479
+ "primaryKey": false,
1480
+ "notNull": true,
1481
+ "default": 0
1482
+ },
1483
+ "capture_method": {
1484
+ "name": "capture_method",
1485
+ "type": "text",
1486
+ "primaryKey": false,
1487
+ "notNull": false
1488
+ },
1489
+ "created_at": {
1490
+ "name": "created_at",
1491
+ "type": "timestamp with time zone",
1492
+ "primaryKey": false,
1493
+ "notNull": true
1494
+ },
1495
+ "updated_at": {
1496
+ "name": "updated_at",
1497
+ "type": "timestamp with time zone",
1498
+ "primaryKey": false,
1499
+ "notNull": true
1500
+ }
1501
+ },
1502
+ "indexes": {
1503
+ "orders_number_unique": {
1504
+ "name": "orders_number_unique",
1505
+ "columns": [
1506
+ {
1507
+ "expression": "order_number",
1508
+ "isExpression": false,
1509
+ "asc": true,
1510
+ "nulls": "last"
1511
+ }
1512
+ ],
1513
+ "isUnique": true,
1514
+ "concurrently": false,
1515
+ "method": "btree",
1516
+ "with": {}
1517
+ },
1518
+ "orders_sequence_unique": {
1519
+ "name": "orders_sequence_unique",
1520
+ "columns": [
1521
+ {
1522
+ "expression": "sequence",
1523
+ "isExpression": false,
1524
+ "asc": true,
1525
+ "nulls": "last"
1526
+ }
1527
+ ],
1528
+ "isUnique": true,
1529
+ "concurrently": false,
1530
+ "method": "btree",
1531
+ "with": {}
1532
+ },
1533
+ "orders_customer_idx": {
1534
+ "name": "orders_customer_idx",
1535
+ "columns": [
1536
+ {
1537
+ "expression": "customer_id",
1538
+ "isExpression": false,
1539
+ "asc": true,
1540
+ "nulls": "last"
1541
+ }
1542
+ ],
1543
+ "isUnique": false,
1544
+ "concurrently": false,
1545
+ "method": "btree",
1546
+ "with": {}
1547
+ },
1548
+ "orders_status_idx": {
1549
+ "name": "orders_status_idx",
1550
+ "columns": [
1551
+ {
1552
+ "expression": "status",
1553
+ "isExpression": false,
1554
+ "asc": true,
1555
+ "nulls": "last"
1556
+ }
1557
+ ],
1558
+ "isUnique": false,
1559
+ "concurrently": false,
1560
+ "method": "btree",
1561
+ "with": {}
1562
+ },
1563
+ "orders_payment_intent_idx": {
1564
+ "name": "orders_payment_intent_idx",
1565
+ "columns": [
1566
+ {
1567
+ "expression": "payment_intent_id",
1568
+ "isExpression": false,
1569
+ "asc": true,
1570
+ "nulls": "last"
1571
+ }
1572
+ ],
1573
+ "isUnique": false,
1574
+ "concurrently": false,
1575
+ "method": "btree",
1576
+ "with": {}
1577
+ },
1578
+ "orders_pending_cart_unique": {
1579
+ "name": "orders_pending_cart_unique",
1580
+ "columns": [
1581
+ {
1582
+ "expression": "cart_token",
1583
+ "isExpression": false,
1584
+ "asc": true,
1585
+ "nulls": "last"
1586
+ }
1587
+ ],
1588
+ "isUnique": true,
1589
+ "where": "status = 'pending'",
1590
+ "concurrently": false,
1591
+ "method": "btree",
1592
+ "with": {}
1593
+ }
1594
+ },
1595
+ "foreignKeys": {},
1596
+ "compositePrimaryKeys": {},
1597
+ "uniqueConstraints": {},
1598
+ "policies": {},
1599
+ "checkConstraints": {},
1600
+ "isRLSEnabled": false
1601
+ },
1602
+ "public.processed_events": {
1603
+ "name": "processed_events",
1604
+ "schema": "",
1605
+ "columns": {
1606
+ "handler_name": {
1607
+ "name": "handler_name",
1608
+ "type": "text",
1609
+ "primaryKey": false,
1610
+ "notNull": true
1611
+ },
1612
+ "event_id": {
1613
+ "name": "event_id",
1614
+ "type": "text",
1615
+ "primaryKey": false,
1616
+ "notNull": true
1617
+ },
1618
+ "processed_at": {
1619
+ "name": "processed_at",
1620
+ "type": "timestamp with time zone",
1621
+ "primaryKey": false,
1622
+ "notNull": true
1623
+ }
1624
+ },
1625
+ "indexes": {},
1626
+ "foreignKeys": {},
1627
+ "compositePrimaryKeys": {
1628
+ "processed_events_handler_name_event_id_pk": {
1629
+ "name": "processed_events_handler_name_event_id_pk",
1630
+ "columns": [
1631
+ "handler_name",
1632
+ "event_id"
1633
+ ]
1634
+ }
1635
+ },
1636
+ "uniqueConstraints": {},
1637
+ "policies": {},
1638
+ "checkConstraints": {},
1639
+ "isRLSEnabled": false
1640
+ },
1641
+ "public.product_categories": {
1642
+ "name": "product_categories",
1643
+ "schema": "",
1644
+ "columns": {
1645
+ "product_id": {
1646
+ "name": "product_id",
1647
+ "type": "text",
1648
+ "primaryKey": false,
1649
+ "notNull": true
1650
+ },
1651
+ "category_id": {
1652
+ "name": "category_id",
1653
+ "type": "text",
1654
+ "primaryKey": false,
1655
+ "notNull": true
1656
+ }
1657
+ },
1658
+ "indexes": {
1659
+ "product_categories_category_idx": {
1660
+ "name": "product_categories_category_idx",
1661
+ "columns": [
1662
+ {
1663
+ "expression": "category_id",
1664
+ "isExpression": false,
1665
+ "asc": true,
1666
+ "nulls": "last"
1667
+ }
1668
+ ],
1669
+ "isUnique": false,
1670
+ "concurrently": false,
1671
+ "method": "btree",
1672
+ "with": {}
1673
+ }
1674
+ },
1675
+ "foreignKeys": {},
1676
+ "compositePrimaryKeys": {
1677
+ "product_categories_product_id_category_id_pk": {
1678
+ "name": "product_categories_product_id_category_id_pk",
1679
+ "columns": [
1680
+ "product_id",
1681
+ "category_id"
1682
+ ]
1683
+ }
1684
+ },
1685
+ "uniqueConstraints": {},
1686
+ "policies": {},
1687
+ "checkConstraints": {},
1688
+ "isRLSEnabled": false
1689
+ },
1690
+ "public.products": {
1691
+ "name": "products",
1692
+ "schema": "",
1693
+ "columns": {
1694
+ "id": {
1695
+ "name": "id",
1696
+ "type": "text",
1697
+ "primaryKey": true,
1698
+ "notNull": true
1699
+ },
1700
+ "slug": {
1701
+ "name": "slug",
1702
+ "type": "text",
1703
+ "primaryKey": false,
1704
+ "notNull": true
1705
+ },
1706
+ "name": {
1707
+ "name": "name",
1708
+ "type": "text",
1709
+ "primaryKey": false,
1710
+ "notNull": true
1711
+ },
1712
+ "description": {
1713
+ "name": "description",
1714
+ "type": "text",
1715
+ "primaryKey": false,
1716
+ "notNull": true,
1717
+ "default": "''"
1718
+ },
1719
+ "short_description": {
1720
+ "name": "short_description",
1721
+ "type": "text",
1722
+ "primaryKey": false,
1723
+ "notNull": true,
1724
+ "default": "''"
1725
+ },
1726
+ "status": {
1727
+ "name": "status",
1728
+ "type": "text",
1729
+ "primaryKey": false,
1730
+ "notNull": true,
1731
+ "default": "'draft'"
1732
+ },
1733
+ "type": {
1734
+ "name": "type",
1735
+ "type": "text",
1736
+ "primaryKey": false,
1737
+ "notNull": true,
1738
+ "default": "'simple'"
1739
+ },
1740
+ "seo_title": {
1741
+ "name": "seo_title",
1742
+ "type": "text",
1743
+ "primaryKey": false,
1744
+ "notNull": true,
1745
+ "default": "''"
1746
+ },
1747
+ "seo_description": {
1748
+ "name": "seo_description",
1749
+ "type": "text",
1750
+ "primaryKey": false,
1751
+ "notNull": true,
1752
+ "default": "''"
1753
+ },
1754
+ "media": {
1755
+ "name": "media",
1756
+ "type": "jsonb",
1757
+ "primaryKey": false,
1758
+ "notNull": true,
1759
+ "default": "'[]'::jsonb"
1760
+ },
1761
+ "metadata": {
1762
+ "name": "metadata",
1763
+ "type": "jsonb",
1764
+ "primaryKey": false,
1765
+ "notNull": true,
1766
+ "default": "'{}'::jsonb"
1767
+ },
1768
+ "created_at": {
1769
+ "name": "created_at",
1770
+ "type": "timestamp with time zone",
1771
+ "primaryKey": false,
1772
+ "notNull": true
1773
+ },
1774
+ "updated_at": {
1775
+ "name": "updated_at",
1776
+ "type": "timestamp with time zone",
1777
+ "primaryKey": false,
1778
+ "notNull": true
1779
+ }
1780
+ },
1781
+ "indexes": {
1782
+ "products_slug_unique": {
1783
+ "name": "products_slug_unique",
1784
+ "columns": [
1785
+ {
1786
+ "expression": "slug",
1787
+ "isExpression": false,
1788
+ "asc": true,
1789
+ "nulls": "last"
1790
+ }
1791
+ ],
1792
+ "isUnique": true,
1793
+ "concurrently": false,
1794
+ "method": "btree",
1795
+ "with": {}
1796
+ },
1797
+ "products_status_idx": {
1798
+ "name": "products_status_idx",
1799
+ "columns": [
1800
+ {
1801
+ "expression": "status",
1802
+ "isExpression": false,
1803
+ "asc": true,
1804
+ "nulls": "last"
1805
+ }
1806
+ ],
1807
+ "isUnique": false,
1808
+ "concurrently": false,
1809
+ "method": "btree",
1810
+ "with": {}
1811
+ }
1812
+ },
1813
+ "foreignKeys": {},
1814
+ "compositePrimaryKeys": {},
1815
+ "uniqueConstraints": {},
1816
+ "policies": {},
1817
+ "checkConstraints": {},
1818
+ "isRLSEnabled": false
1819
+ },
1820
+ "public.refresh_tokens": {
1821
+ "name": "refresh_tokens",
1822
+ "schema": "",
1823
+ "columns": {
1824
+ "id": {
1825
+ "name": "id",
1826
+ "type": "text",
1827
+ "primaryKey": true,
1828
+ "notNull": true
1829
+ },
1830
+ "customer_id": {
1831
+ "name": "customer_id",
1832
+ "type": "text",
1833
+ "primaryKey": false,
1834
+ "notNull": true
1835
+ },
1836
+ "token_hash": {
1837
+ "name": "token_hash",
1838
+ "type": "text",
1839
+ "primaryKey": false,
1840
+ "notNull": true
1841
+ },
1842
+ "revoked_at": {
1843
+ "name": "revoked_at",
1844
+ "type": "timestamp with time zone",
1845
+ "primaryKey": false,
1846
+ "notNull": false
1847
+ },
1848
+ "replaced_by_jti": {
1849
+ "name": "replaced_by_jti",
1850
+ "type": "text",
1851
+ "primaryKey": false,
1852
+ "notNull": false
1853
+ },
1854
+ "expires_at": {
1855
+ "name": "expires_at",
1856
+ "type": "timestamp with time zone",
1857
+ "primaryKey": false,
1858
+ "notNull": true
1859
+ },
1860
+ "created_at": {
1861
+ "name": "created_at",
1862
+ "type": "timestamp with time zone",
1863
+ "primaryKey": false,
1864
+ "notNull": true
1865
+ }
1866
+ },
1867
+ "indexes": {
1868
+ "refresh_tokens_customer_idx": {
1869
+ "name": "refresh_tokens_customer_idx",
1870
+ "columns": [
1871
+ {
1872
+ "expression": "customer_id",
1873
+ "isExpression": false,
1874
+ "asc": true,
1875
+ "nulls": "last"
1876
+ }
1877
+ ],
1878
+ "isUnique": false,
1879
+ "concurrently": false,
1880
+ "method": "btree",
1881
+ "with": {}
1882
+ }
1883
+ },
1884
+ "foreignKeys": {},
1885
+ "compositePrimaryKeys": {},
1886
+ "uniqueConstraints": {},
1887
+ "policies": {},
1888
+ "checkConstraints": {},
1889
+ "isRLSEnabled": false
1890
+ },
1891
+ "public.reviews": {
1892
+ "name": "reviews",
1893
+ "schema": "",
1894
+ "columns": {
1895
+ "id": {
1896
+ "name": "id",
1897
+ "type": "text",
1898
+ "primaryKey": true,
1899
+ "notNull": true
1900
+ },
1901
+ "product_id": {
1902
+ "name": "product_id",
1903
+ "type": "text",
1904
+ "primaryKey": false,
1905
+ "notNull": true
1906
+ },
1907
+ "customer_id": {
1908
+ "name": "customer_id",
1909
+ "type": "text",
1910
+ "primaryKey": false,
1911
+ "notNull": false
1912
+ },
1913
+ "order_id": {
1914
+ "name": "order_id",
1915
+ "type": "text",
1916
+ "primaryKey": false,
1917
+ "notNull": false
1918
+ },
1919
+ "rating": {
1920
+ "name": "rating",
1921
+ "type": "integer",
1922
+ "primaryKey": false,
1923
+ "notNull": true
1924
+ },
1925
+ "title": {
1926
+ "name": "title",
1927
+ "type": "text",
1928
+ "primaryKey": false,
1929
+ "notNull": true,
1930
+ "default": "''"
1931
+ },
1932
+ "body": {
1933
+ "name": "body",
1934
+ "type": "text",
1935
+ "primaryKey": false,
1936
+ "notNull": true,
1937
+ "default": "''"
1938
+ },
1939
+ "moderation_status": {
1940
+ "name": "moderation_status",
1941
+ "type": "text",
1942
+ "primaryKey": false,
1943
+ "notNull": true,
1944
+ "default": "'pending'"
1945
+ },
1946
+ "submitted_at": {
1947
+ "name": "submitted_at",
1948
+ "type": "timestamp with time zone",
1949
+ "primaryKey": false,
1950
+ "notNull": true
1951
+ },
1952
+ "moderated_at": {
1953
+ "name": "moderated_at",
1954
+ "type": "timestamp with time zone",
1955
+ "primaryKey": false,
1956
+ "notNull": false
1957
+ },
1958
+ "moderated_by": {
1959
+ "name": "moderated_by",
1960
+ "type": "text",
1961
+ "primaryKey": false,
1962
+ "notNull": false
1963
+ }
1964
+ },
1965
+ "indexes": {
1966
+ "reviews_product_idx": {
1967
+ "name": "reviews_product_idx",
1968
+ "columns": [
1969
+ {
1970
+ "expression": "product_id",
1971
+ "isExpression": false,
1972
+ "asc": true,
1973
+ "nulls": "last"
1974
+ }
1975
+ ],
1976
+ "isUnique": false,
1977
+ "concurrently": false,
1978
+ "method": "btree",
1979
+ "with": {}
1980
+ },
1981
+ "reviews_status_idx": {
1982
+ "name": "reviews_status_idx",
1983
+ "columns": [
1984
+ {
1985
+ "expression": "moderation_status",
1986
+ "isExpression": false,
1987
+ "asc": true,
1988
+ "nulls": "last"
1989
+ }
1990
+ ],
1991
+ "isUnique": false,
1992
+ "concurrently": false,
1993
+ "method": "btree",
1994
+ "with": {}
1995
+ }
1996
+ },
1997
+ "foreignKeys": {},
1998
+ "compositePrimaryKeys": {},
1999
+ "uniqueConstraints": {},
2000
+ "policies": {},
2001
+ "checkConstraints": {},
2002
+ "isRLSEnabled": false
2003
+ },
2004
+ "public.settings": {
2005
+ "name": "settings",
2006
+ "schema": "",
2007
+ "columns": {
2008
+ "slot": {
2009
+ "name": "slot",
2010
+ "type": "text",
2011
+ "primaryKey": false,
2012
+ "notNull": true
2013
+ },
2014
+ "path": {
2015
+ "name": "path",
2016
+ "type": "text",
2017
+ "primaryKey": false,
2018
+ "notNull": true
2019
+ },
2020
+ "ciphertext": {
2021
+ "name": "ciphertext",
2022
+ "type": "bytea",
2023
+ "primaryKey": false,
2024
+ "notNull": false
2025
+ },
2026
+ "plain": {
2027
+ "name": "plain",
2028
+ "type": "text",
2029
+ "primaryKey": false,
2030
+ "notNull": false
2031
+ },
2032
+ "iv": {
2033
+ "name": "iv",
2034
+ "type": "bytea",
2035
+ "primaryKey": false,
2036
+ "notNull": false
2037
+ },
2038
+ "tag": {
2039
+ "name": "tag",
2040
+ "type": "bytea",
2041
+ "primaryKey": false,
2042
+ "notNull": false
2043
+ },
2044
+ "key_id": {
2045
+ "name": "key_id",
2046
+ "type": "text",
2047
+ "primaryKey": false,
2048
+ "notNull": false
2049
+ },
2050
+ "updated_at": {
2051
+ "name": "updated_at",
2052
+ "type": "timestamp with time zone",
2053
+ "primaryKey": false,
2054
+ "notNull": true
2055
+ },
2056
+ "updated_by": {
2057
+ "name": "updated_by",
2058
+ "type": "text",
2059
+ "primaryKey": false,
2060
+ "notNull": false
2061
+ }
2062
+ },
2063
+ "indexes": {},
2064
+ "foreignKeys": {},
2065
+ "compositePrimaryKeys": {
2066
+ "settings_slot_path_pk": {
2067
+ "name": "settings_slot_path_pk",
2068
+ "columns": [
2069
+ "slot",
2070
+ "path"
2071
+ ]
2072
+ }
2073
+ },
2074
+ "uniqueConstraints": {},
2075
+ "policies": {},
2076
+ "checkConstraints": {
2077
+ "settings_one_value": {
2078
+ "name": "settings_one_value",
2079
+ "value": "(\"settings\".\"ciphertext\" IS NULL) <> (\"settings\".\"plain\" IS NULL) AND (\"settings\".\"ciphertext\" IS NULL OR (\"settings\".\"iv\" IS NOT NULL AND \"settings\".\"tag\" IS NOT NULL AND \"settings\".\"key_id\" IS NOT NULL))"
2080
+ }
2081
+ },
2082
+ "isRLSEnabled": false
2083
+ },
2084
+ "public.stock_adjustments": {
2085
+ "name": "stock_adjustments",
2086
+ "schema": "",
2087
+ "columns": {
2088
+ "id": {
2089
+ "name": "id",
2090
+ "type": "text",
2091
+ "primaryKey": true,
2092
+ "notNull": true
2093
+ },
2094
+ "variant_id": {
2095
+ "name": "variant_id",
2096
+ "type": "text",
2097
+ "primaryKey": false,
2098
+ "notNull": true
2099
+ },
2100
+ "adjustment": {
2101
+ "name": "adjustment",
2102
+ "type": "integer",
2103
+ "primaryKey": false,
2104
+ "notNull": true
2105
+ },
2106
+ "reason": {
2107
+ "name": "reason",
2108
+ "type": "text",
2109
+ "primaryKey": false,
2110
+ "notNull": true
2111
+ },
2112
+ "actor": {
2113
+ "name": "actor",
2114
+ "type": "text",
2115
+ "primaryKey": false,
2116
+ "notNull": true
2117
+ },
2118
+ "previous_qty": {
2119
+ "name": "previous_qty",
2120
+ "type": "integer",
2121
+ "primaryKey": false,
2122
+ "notNull": true
2123
+ },
2124
+ "new_qty": {
2125
+ "name": "new_qty",
2126
+ "type": "integer",
2127
+ "primaryKey": false,
2128
+ "notNull": true
2129
+ },
2130
+ "timestamp": {
2131
+ "name": "timestamp",
2132
+ "type": "timestamp with time zone",
2133
+ "primaryKey": false,
2134
+ "notNull": true
2135
+ }
2136
+ },
2137
+ "indexes": {
2138
+ "stock_adjustments_variant_idx": {
2139
+ "name": "stock_adjustments_variant_idx",
2140
+ "columns": [
2141
+ {
2142
+ "expression": "variant_id",
2143
+ "isExpression": false,
2144
+ "asc": true,
2145
+ "nulls": "last"
2146
+ }
2147
+ ],
2148
+ "isUnique": false,
2149
+ "concurrently": false,
2150
+ "method": "btree",
2151
+ "with": {}
2152
+ }
2153
+ },
2154
+ "foreignKeys": {},
2155
+ "compositePrimaryKeys": {},
2156
+ "uniqueConstraints": {},
2157
+ "policies": {},
2158
+ "checkConstraints": {},
2159
+ "isRLSEnabled": false
2160
+ },
2161
+ "public.variants": {
2162
+ "name": "variants",
2163
+ "schema": "",
2164
+ "columns": {
2165
+ "id": {
2166
+ "name": "id",
2167
+ "type": "text",
2168
+ "primaryKey": true,
2169
+ "notNull": true
2170
+ },
2171
+ "product_id": {
2172
+ "name": "product_id",
2173
+ "type": "text",
2174
+ "primaryKey": false,
2175
+ "notNull": true
2176
+ },
2177
+ "sku": {
2178
+ "name": "sku",
2179
+ "type": "text",
2180
+ "primaryKey": false,
2181
+ "notNull": true
2182
+ },
2183
+ "name": {
2184
+ "name": "name",
2185
+ "type": "text",
2186
+ "primaryKey": false,
2187
+ "notNull": true,
2188
+ "default": "''"
2189
+ },
2190
+ "price_minor": {
2191
+ "name": "price_minor",
2192
+ "type": "integer",
2193
+ "primaryKey": false,
2194
+ "notNull": true
2195
+ },
2196
+ "compare_at_price_minor": {
2197
+ "name": "compare_at_price_minor",
2198
+ "type": "integer",
2199
+ "primaryKey": false,
2200
+ "notNull": false
2201
+ },
2202
+ "weight_grams": {
2203
+ "name": "weight_grams",
2204
+ "type": "integer",
2205
+ "primaryKey": false,
2206
+ "notNull": false
2207
+ },
2208
+ "dimensions": {
2209
+ "name": "dimensions",
2210
+ "type": "jsonb",
2211
+ "primaryKey": false,
2212
+ "notNull": false
2213
+ },
2214
+ "stock": {
2215
+ "name": "stock",
2216
+ "type": "integer",
2217
+ "primaryKey": false,
2218
+ "notNull": true,
2219
+ "default": 0
2220
+ },
2221
+ "low_stock_threshold": {
2222
+ "name": "low_stock_threshold",
2223
+ "type": "integer",
2224
+ "primaryKey": false,
2225
+ "notNull": true,
2226
+ "default": 0
2227
+ },
2228
+ "options": {
2229
+ "name": "options",
2230
+ "type": "jsonb",
2231
+ "primaryKey": false,
2232
+ "notNull": true,
2233
+ "default": "'[]'::jsonb"
2234
+ },
2235
+ "status": {
2236
+ "name": "status",
2237
+ "type": "text",
2238
+ "primaryKey": false,
2239
+ "notNull": true,
2240
+ "default": "'active'"
2241
+ },
2242
+ "created_at": {
2243
+ "name": "created_at",
2244
+ "type": "timestamp with time zone",
2245
+ "primaryKey": false,
2246
+ "notNull": true
2247
+ },
2248
+ "updated_at": {
2249
+ "name": "updated_at",
2250
+ "type": "timestamp with time zone",
2251
+ "primaryKey": false,
2252
+ "notNull": true
2253
+ }
2254
+ },
2255
+ "indexes": {
2256
+ "variants_sku_unique": {
2257
+ "name": "variants_sku_unique",
2258
+ "columns": [
2259
+ {
2260
+ "expression": "sku",
2261
+ "isExpression": false,
2262
+ "asc": true,
2263
+ "nulls": "last"
2264
+ }
2265
+ ],
2266
+ "isUnique": true,
2267
+ "concurrently": false,
2268
+ "method": "btree",
2269
+ "with": {}
2270
+ },
2271
+ "variants_product_idx": {
2272
+ "name": "variants_product_idx",
2273
+ "columns": [
2274
+ {
2275
+ "expression": "product_id",
2276
+ "isExpression": false,
2277
+ "asc": true,
2278
+ "nulls": "last"
2279
+ }
2280
+ ],
2281
+ "isUnique": false,
2282
+ "concurrently": false,
2283
+ "method": "btree",
2284
+ "with": {}
2285
+ }
2286
+ },
2287
+ "foreignKeys": {},
2288
+ "compositePrimaryKeys": {},
2289
+ "uniqueConstraints": {},
2290
+ "policies": {},
2291
+ "checkConstraints": {},
2292
+ "isRLSEnabled": false
2293
+ }
2294
+ },
2295
+ "enums": {},
2296
+ "schemas": {},
2297
+ "sequences": {},
2298
+ "roles": {},
2299
+ "policies": {},
2300
+ "views": {},
2301
+ "_meta": {
2302
+ "columns": {},
2303
+ "schemas": {},
2304
+ "tables": {}
2305
+ }
2306
+ }