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