@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,2300 @@
1
+ {
2
+ "id": "64a606b0-2874-4dde-b885-28e9086b6430",
3
+ "prevId": "17bd36ef-f02f-4d5a-a97c-c439c1a8ebb4",
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
+ },
1019
+ "indexes": {
1020
+ "order_access_keys_key_hash_idx": {
1021
+ "name": "order_access_keys_key_hash_idx",
1022
+ "columns": [
1023
+ {
1024
+ "expression": "key_hash",
1025
+ "isExpression": false,
1026
+ "asc": true,
1027
+ "nulls": "last"
1028
+ }
1029
+ ],
1030
+ "isUnique": true,
1031
+ "concurrently": false,
1032
+ "method": "btree",
1033
+ "with": {}
1034
+ },
1035
+ "order_access_keys_order_idx": {
1036
+ "name": "order_access_keys_order_idx",
1037
+ "columns": [
1038
+ {
1039
+ "expression": "order_id",
1040
+ "isExpression": false,
1041
+ "asc": true,
1042
+ "nulls": "last"
1043
+ }
1044
+ ],
1045
+ "isUnique": false,
1046
+ "concurrently": false,
1047
+ "method": "btree",
1048
+ "with": {}
1049
+ }
1050
+ },
1051
+ "foreignKeys": {},
1052
+ "compositePrimaryKeys": {},
1053
+ "uniqueConstraints": {},
1054
+ "policies": {},
1055
+ "checkConstraints": {},
1056
+ "isRLSEnabled": false
1057
+ },
1058
+ "public.order_history": {
1059
+ "name": "order_history",
1060
+ "schema": "",
1061
+ "columns": {
1062
+ "id": {
1063
+ "name": "id",
1064
+ "type": "text",
1065
+ "primaryKey": true,
1066
+ "notNull": true
1067
+ },
1068
+ "order_id": {
1069
+ "name": "order_id",
1070
+ "type": "text",
1071
+ "primaryKey": false,
1072
+ "notNull": true
1073
+ },
1074
+ "from_status": {
1075
+ "name": "from_status",
1076
+ "type": "text",
1077
+ "primaryKey": false,
1078
+ "notNull": false
1079
+ },
1080
+ "to_status": {
1081
+ "name": "to_status",
1082
+ "type": "text",
1083
+ "primaryKey": false,
1084
+ "notNull": true
1085
+ },
1086
+ "actor": {
1087
+ "name": "actor",
1088
+ "type": "text",
1089
+ "primaryKey": false,
1090
+ "notNull": true
1091
+ },
1092
+ "note": {
1093
+ "name": "note",
1094
+ "type": "text",
1095
+ "primaryKey": false,
1096
+ "notNull": true,
1097
+ "default": "''"
1098
+ },
1099
+ "timestamp": {
1100
+ "name": "timestamp",
1101
+ "type": "timestamp with time zone",
1102
+ "primaryKey": false,
1103
+ "notNull": true
1104
+ }
1105
+ },
1106
+ "indexes": {
1107
+ "order_history_order_idx": {
1108
+ "name": "order_history_order_idx",
1109
+ "columns": [
1110
+ {
1111
+ "expression": "order_id",
1112
+ "isExpression": false,
1113
+ "asc": true,
1114
+ "nulls": "last"
1115
+ }
1116
+ ],
1117
+ "isUnique": false,
1118
+ "concurrently": false,
1119
+ "method": "btree",
1120
+ "with": {}
1121
+ }
1122
+ },
1123
+ "foreignKeys": {},
1124
+ "compositePrimaryKeys": {},
1125
+ "uniqueConstraints": {},
1126
+ "policies": {},
1127
+ "checkConstraints": {},
1128
+ "isRLSEnabled": false
1129
+ },
1130
+ "public.order_refunds": {
1131
+ "name": "order_refunds",
1132
+ "schema": "",
1133
+ "columns": {
1134
+ "id": {
1135
+ "name": "id",
1136
+ "type": "text",
1137
+ "primaryKey": true,
1138
+ "notNull": true
1139
+ },
1140
+ "order_id": {
1141
+ "name": "order_id",
1142
+ "type": "text",
1143
+ "primaryKey": false,
1144
+ "notNull": true
1145
+ },
1146
+ "amount_minor": {
1147
+ "name": "amount_minor",
1148
+ "type": "integer",
1149
+ "primaryKey": false,
1150
+ "notNull": true
1151
+ },
1152
+ "currency": {
1153
+ "name": "currency",
1154
+ "type": "text",
1155
+ "primaryKey": false,
1156
+ "notNull": true
1157
+ },
1158
+ "provider_refund_id": {
1159
+ "name": "provider_refund_id",
1160
+ "type": "text",
1161
+ "primaryKey": false,
1162
+ "notNull": false
1163
+ },
1164
+ "status": {
1165
+ "name": "status",
1166
+ "type": "text",
1167
+ "primaryKey": false,
1168
+ "notNull": true,
1169
+ "default": "'pending'"
1170
+ },
1171
+ "reason": {
1172
+ "name": "reason",
1173
+ "type": "text",
1174
+ "primaryKey": false,
1175
+ "notNull": false
1176
+ },
1177
+ "actor": {
1178
+ "name": "actor",
1179
+ "type": "text",
1180
+ "primaryKey": false,
1181
+ "notNull": true
1182
+ },
1183
+ "created_at": {
1184
+ "name": "created_at",
1185
+ "type": "timestamp with time zone",
1186
+ "primaryKey": false,
1187
+ "notNull": true
1188
+ },
1189
+ "request_id": {
1190
+ "name": "request_id",
1191
+ "type": "text",
1192
+ "primaryKey": false,
1193
+ "notNull": false
1194
+ }
1195
+ },
1196
+ "indexes": {
1197
+ "order_refunds_order_idx": {
1198
+ "name": "order_refunds_order_idx",
1199
+ "columns": [
1200
+ {
1201
+ "expression": "order_id",
1202
+ "isExpression": false,
1203
+ "asc": true,
1204
+ "nulls": "last"
1205
+ }
1206
+ ],
1207
+ "isUnique": false,
1208
+ "concurrently": false,
1209
+ "method": "btree",
1210
+ "with": {}
1211
+ },
1212
+ "order_refunds_order_request_idx": {
1213
+ "name": "order_refunds_order_request_idx",
1214
+ "columns": [
1215
+ {
1216
+ "expression": "order_id",
1217
+ "isExpression": false,
1218
+ "asc": true,
1219
+ "nulls": "last"
1220
+ },
1221
+ {
1222
+ "expression": "request_id",
1223
+ "isExpression": false,
1224
+ "asc": true,
1225
+ "nulls": "last"
1226
+ }
1227
+ ],
1228
+ "isUnique": true,
1229
+ "concurrently": false,
1230
+ "method": "btree",
1231
+ "with": {}
1232
+ }
1233
+ },
1234
+ "foreignKeys": {},
1235
+ "compositePrimaryKeys": {},
1236
+ "uniqueConstraints": {},
1237
+ "policies": {},
1238
+ "checkConstraints": {},
1239
+ "isRLSEnabled": false
1240
+ },
1241
+ "public.order_sequences": {
1242
+ "name": "order_sequences",
1243
+ "schema": "",
1244
+ "columns": {
1245
+ "id": {
1246
+ "name": "id",
1247
+ "type": "integer",
1248
+ "primaryKey": true,
1249
+ "notNull": true
1250
+ },
1251
+ "next_value": {
1252
+ "name": "next_value",
1253
+ "type": "integer",
1254
+ "primaryKey": false,
1255
+ "notNull": true
1256
+ }
1257
+ },
1258
+ "indexes": {},
1259
+ "foreignKeys": {},
1260
+ "compositePrimaryKeys": {},
1261
+ "uniqueConstraints": {},
1262
+ "policies": {},
1263
+ "checkConstraints": {},
1264
+ "isRLSEnabled": false
1265
+ },
1266
+ "public.order_shipments": {
1267
+ "name": "order_shipments",
1268
+ "schema": "",
1269
+ "columns": {
1270
+ "order_id": {
1271
+ "name": "order_id",
1272
+ "type": "text",
1273
+ "primaryKey": true,
1274
+ "notNull": true
1275
+ },
1276
+ "carrier": {
1277
+ "name": "carrier",
1278
+ "type": "text",
1279
+ "primaryKey": false,
1280
+ "notNull": true
1281
+ },
1282
+ "tracking_number": {
1283
+ "name": "tracking_number",
1284
+ "type": "text",
1285
+ "primaryKey": false,
1286
+ "notNull": true
1287
+ },
1288
+ "created_at": {
1289
+ "name": "created_at",
1290
+ "type": "timestamp with time zone",
1291
+ "primaryKey": false,
1292
+ "notNull": true
1293
+ }
1294
+ },
1295
+ "indexes": {
1296
+ "order_shipments_tracking_number_idx": {
1297
+ "name": "order_shipments_tracking_number_idx",
1298
+ "columns": [
1299
+ {
1300
+ "expression": "tracking_number",
1301
+ "isExpression": false,
1302
+ "asc": true,
1303
+ "nulls": "last"
1304
+ }
1305
+ ],
1306
+ "isUnique": false,
1307
+ "concurrently": false,
1308
+ "method": "btree",
1309
+ "with": {}
1310
+ }
1311
+ },
1312
+ "foreignKeys": {
1313
+ "order_shipments_order_id_orders_id_fk": {
1314
+ "name": "order_shipments_order_id_orders_id_fk",
1315
+ "tableFrom": "order_shipments",
1316
+ "tableTo": "orders",
1317
+ "columnsFrom": [
1318
+ "order_id"
1319
+ ],
1320
+ "columnsTo": [
1321
+ "id"
1322
+ ],
1323
+ "onDelete": "no action",
1324
+ "onUpdate": "no action"
1325
+ }
1326
+ },
1327
+ "compositePrimaryKeys": {},
1328
+ "uniqueConstraints": {},
1329
+ "policies": {},
1330
+ "checkConstraints": {},
1331
+ "isRLSEnabled": false
1332
+ },
1333
+ "public.orders": {
1334
+ "name": "orders",
1335
+ "schema": "",
1336
+ "columns": {
1337
+ "id": {
1338
+ "name": "id",
1339
+ "type": "text",
1340
+ "primaryKey": true,
1341
+ "notNull": true
1342
+ },
1343
+ "order_number": {
1344
+ "name": "order_number",
1345
+ "type": "text",
1346
+ "primaryKey": false,
1347
+ "notNull": true
1348
+ },
1349
+ "sequence": {
1350
+ "name": "sequence",
1351
+ "type": "integer",
1352
+ "primaryKey": false,
1353
+ "notNull": true
1354
+ },
1355
+ "customer_id": {
1356
+ "name": "customer_id",
1357
+ "type": "text",
1358
+ "primaryKey": false,
1359
+ "notNull": false
1360
+ },
1361
+ "status": {
1362
+ "name": "status",
1363
+ "type": "text",
1364
+ "primaryKey": false,
1365
+ "notNull": true,
1366
+ "default": "'pending'"
1367
+ },
1368
+ "email": {
1369
+ "name": "email",
1370
+ "type": "text",
1371
+ "primaryKey": false,
1372
+ "notNull": true
1373
+ },
1374
+ "billing_address": {
1375
+ "name": "billing_address",
1376
+ "type": "jsonb",
1377
+ "primaryKey": false,
1378
+ "notNull": true
1379
+ },
1380
+ "shipping_address": {
1381
+ "name": "shipping_address",
1382
+ "type": "jsonb",
1383
+ "primaryKey": false,
1384
+ "notNull": true
1385
+ },
1386
+ "line_items": {
1387
+ "name": "line_items",
1388
+ "type": "jsonb",
1389
+ "primaryKey": false,
1390
+ "notNull": true
1391
+ },
1392
+ "subtotal_minor": {
1393
+ "name": "subtotal_minor",
1394
+ "type": "integer",
1395
+ "primaryKey": false,
1396
+ "notNull": true
1397
+ },
1398
+ "tax_total_minor": {
1399
+ "name": "tax_total_minor",
1400
+ "type": "integer",
1401
+ "primaryKey": false,
1402
+ "notNull": true,
1403
+ "default": 0
1404
+ },
1405
+ "shipping_total_minor": {
1406
+ "name": "shipping_total_minor",
1407
+ "type": "integer",
1408
+ "primaryKey": false,
1409
+ "notNull": true,
1410
+ "default": 0
1411
+ },
1412
+ "discount_total_minor": {
1413
+ "name": "discount_total_minor",
1414
+ "type": "integer",
1415
+ "primaryKey": false,
1416
+ "notNull": true,
1417
+ "default": 0
1418
+ },
1419
+ "total_minor": {
1420
+ "name": "total_minor",
1421
+ "type": "integer",
1422
+ "primaryKey": false,
1423
+ "notNull": true
1424
+ },
1425
+ "currency": {
1426
+ "name": "currency",
1427
+ "type": "text",
1428
+ "primaryKey": false,
1429
+ "notNull": true
1430
+ },
1431
+ "notes": {
1432
+ "name": "notes",
1433
+ "type": "text",
1434
+ "primaryKey": false,
1435
+ "notNull": true,
1436
+ "default": "''"
1437
+ },
1438
+ "metadata": {
1439
+ "name": "metadata",
1440
+ "type": "jsonb",
1441
+ "primaryKey": false,
1442
+ "notNull": true,
1443
+ "default": "'{}'::jsonb"
1444
+ },
1445
+ "payment_intent_id": {
1446
+ "name": "payment_intent_id",
1447
+ "type": "text",
1448
+ "primaryKey": false,
1449
+ "notNull": false
1450
+ },
1451
+ "cart_token": {
1452
+ "name": "cart_token",
1453
+ "type": "text",
1454
+ "primaryKey": false,
1455
+ "notNull": false
1456
+ },
1457
+ "captured_minor": {
1458
+ "name": "captured_minor",
1459
+ "type": "integer",
1460
+ "primaryKey": false,
1461
+ "notNull": true,
1462
+ "default": 0
1463
+ },
1464
+ "captured_at": {
1465
+ "name": "captured_at",
1466
+ "type": "timestamp with time zone",
1467
+ "primaryKey": false,
1468
+ "notNull": false
1469
+ },
1470
+ "refunded_minor": {
1471
+ "name": "refunded_minor",
1472
+ "type": "integer",
1473
+ "primaryKey": false,
1474
+ "notNull": true,
1475
+ "default": 0
1476
+ },
1477
+ "capture_method": {
1478
+ "name": "capture_method",
1479
+ "type": "text",
1480
+ "primaryKey": false,
1481
+ "notNull": false
1482
+ },
1483
+ "created_at": {
1484
+ "name": "created_at",
1485
+ "type": "timestamp with time zone",
1486
+ "primaryKey": false,
1487
+ "notNull": true
1488
+ },
1489
+ "updated_at": {
1490
+ "name": "updated_at",
1491
+ "type": "timestamp with time zone",
1492
+ "primaryKey": false,
1493
+ "notNull": true
1494
+ }
1495
+ },
1496
+ "indexes": {
1497
+ "orders_number_unique": {
1498
+ "name": "orders_number_unique",
1499
+ "columns": [
1500
+ {
1501
+ "expression": "order_number",
1502
+ "isExpression": false,
1503
+ "asc": true,
1504
+ "nulls": "last"
1505
+ }
1506
+ ],
1507
+ "isUnique": true,
1508
+ "concurrently": false,
1509
+ "method": "btree",
1510
+ "with": {}
1511
+ },
1512
+ "orders_sequence_unique": {
1513
+ "name": "orders_sequence_unique",
1514
+ "columns": [
1515
+ {
1516
+ "expression": "sequence",
1517
+ "isExpression": false,
1518
+ "asc": true,
1519
+ "nulls": "last"
1520
+ }
1521
+ ],
1522
+ "isUnique": true,
1523
+ "concurrently": false,
1524
+ "method": "btree",
1525
+ "with": {}
1526
+ },
1527
+ "orders_customer_idx": {
1528
+ "name": "orders_customer_idx",
1529
+ "columns": [
1530
+ {
1531
+ "expression": "customer_id",
1532
+ "isExpression": false,
1533
+ "asc": true,
1534
+ "nulls": "last"
1535
+ }
1536
+ ],
1537
+ "isUnique": false,
1538
+ "concurrently": false,
1539
+ "method": "btree",
1540
+ "with": {}
1541
+ },
1542
+ "orders_status_idx": {
1543
+ "name": "orders_status_idx",
1544
+ "columns": [
1545
+ {
1546
+ "expression": "status",
1547
+ "isExpression": false,
1548
+ "asc": true,
1549
+ "nulls": "last"
1550
+ }
1551
+ ],
1552
+ "isUnique": false,
1553
+ "concurrently": false,
1554
+ "method": "btree",
1555
+ "with": {}
1556
+ },
1557
+ "orders_payment_intent_idx": {
1558
+ "name": "orders_payment_intent_idx",
1559
+ "columns": [
1560
+ {
1561
+ "expression": "payment_intent_id",
1562
+ "isExpression": false,
1563
+ "asc": true,
1564
+ "nulls": "last"
1565
+ }
1566
+ ],
1567
+ "isUnique": false,
1568
+ "concurrently": false,
1569
+ "method": "btree",
1570
+ "with": {}
1571
+ },
1572
+ "orders_pending_cart_unique": {
1573
+ "name": "orders_pending_cart_unique",
1574
+ "columns": [
1575
+ {
1576
+ "expression": "cart_token",
1577
+ "isExpression": false,
1578
+ "asc": true,
1579
+ "nulls": "last"
1580
+ }
1581
+ ],
1582
+ "isUnique": true,
1583
+ "where": "status = 'pending'",
1584
+ "concurrently": false,
1585
+ "method": "btree",
1586
+ "with": {}
1587
+ }
1588
+ },
1589
+ "foreignKeys": {},
1590
+ "compositePrimaryKeys": {},
1591
+ "uniqueConstraints": {},
1592
+ "policies": {},
1593
+ "checkConstraints": {},
1594
+ "isRLSEnabled": false
1595
+ },
1596
+ "public.processed_events": {
1597
+ "name": "processed_events",
1598
+ "schema": "",
1599
+ "columns": {
1600
+ "handler_name": {
1601
+ "name": "handler_name",
1602
+ "type": "text",
1603
+ "primaryKey": false,
1604
+ "notNull": true
1605
+ },
1606
+ "event_id": {
1607
+ "name": "event_id",
1608
+ "type": "text",
1609
+ "primaryKey": false,
1610
+ "notNull": true
1611
+ },
1612
+ "processed_at": {
1613
+ "name": "processed_at",
1614
+ "type": "timestamp with time zone",
1615
+ "primaryKey": false,
1616
+ "notNull": true
1617
+ }
1618
+ },
1619
+ "indexes": {},
1620
+ "foreignKeys": {},
1621
+ "compositePrimaryKeys": {
1622
+ "processed_events_handler_name_event_id_pk": {
1623
+ "name": "processed_events_handler_name_event_id_pk",
1624
+ "columns": [
1625
+ "handler_name",
1626
+ "event_id"
1627
+ ]
1628
+ }
1629
+ },
1630
+ "uniqueConstraints": {},
1631
+ "policies": {},
1632
+ "checkConstraints": {},
1633
+ "isRLSEnabled": false
1634
+ },
1635
+ "public.product_categories": {
1636
+ "name": "product_categories",
1637
+ "schema": "",
1638
+ "columns": {
1639
+ "product_id": {
1640
+ "name": "product_id",
1641
+ "type": "text",
1642
+ "primaryKey": false,
1643
+ "notNull": true
1644
+ },
1645
+ "category_id": {
1646
+ "name": "category_id",
1647
+ "type": "text",
1648
+ "primaryKey": false,
1649
+ "notNull": true
1650
+ }
1651
+ },
1652
+ "indexes": {
1653
+ "product_categories_category_idx": {
1654
+ "name": "product_categories_category_idx",
1655
+ "columns": [
1656
+ {
1657
+ "expression": "category_id",
1658
+ "isExpression": false,
1659
+ "asc": true,
1660
+ "nulls": "last"
1661
+ }
1662
+ ],
1663
+ "isUnique": false,
1664
+ "concurrently": false,
1665
+ "method": "btree",
1666
+ "with": {}
1667
+ }
1668
+ },
1669
+ "foreignKeys": {},
1670
+ "compositePrimaryKeys": {
1671
+ "product_categories_product_id_category_id_pk": {
1672
+ "name": "product_categories_product_id_category_id_pk",
1673
+ "columns": [
1674
+ "product_id",
1675
+ "category_id"
1676
+ ]
1677
+ }
1678
+ },
1679
+ "uniqueConstraints": {},
1680
+ "policies": {},
1681
+ "checkConstraints": {},
1682
+ "isRLSEnabled": false
1683
+ },
1684
+ "public.products": {
1685
+ "name": "products",
1686
+ "schema": "",
1687
+ "columns": {
1688
+ "id": {
1689
+ "name": "id",
1690
+ "type": "text",
1691
+ "primaryKey": true,
1692
+ "notNull": true
1693
+ },
1694
+ "slug": {
1695
+ "name": "slug",
1696
+ "type": "text",
1697
+ "primaryKey": false,
1698
+ "notNull": true
1699
+ },
1700
+ "name": {
1701
+ "name": "name",
1702
+ "type": "text",
1703
+ "primaryKey": false,
1704
+ "notNull": true
1705
+ },
1706
+ "description": {
1707
+ "name": "description",
1708
+ "type": "text",
1709
+ "primaryKey": false,
1710
+ "notNull": true,
1711
+ "default": "''"
1712
+ },
1713
+ "short_description": {
1714
+ "name": "short_description",
1715
+ "type": "text",
1716
+ "primaryKey": false,
1717
+ "notNull": true,
1718
+ "default": "''"
1719
+ },
1720
+ "status": {
1721
+ "name": "status",
1722
+ "type": "text",
1723
+ "primaryKey": false,
1724
+ "notNull": true,
1725
+ "default": "'draft'"
1726
+ },
1727
+ "type": {
1728
+ "name": "type",
1729
+ "type": "text",
1730
+ "primaryKey": false,
1731
+ "notNull": true,
1732
+ "default": "'simple'"
1733
+ },
1734
+ "seo_title": {
1735
+ "name": "seo_title",
1736
+ "type": "text",
1737
+ "primaryKey": false,
1738
+ "notNull": true,
1739
+ "default": "''"
1740
+ },
1741
+ "seo_description": {
1742
+ "name": "seo_description",
1743
+ "type": "text",
1744
+ "primaryKey": false,
1745
+ "notNull": true,
1746
+ "default": "''"
1747
+ },
1748
+ "media": {
1749
+ "name": "media",
1750
+ "type": "jsonb",
1751
+ "primaryKey": false,
1752
+ "notNull": true,
1753
+ "default": "'[]'::jsonb"
1754
+ },
1755
+ "metadata": {
1756
+ "name": "metadata",
1757
+ "type": "jsonb",
1758
+ "primaryKey": false,
1759
+ "notNull": true,
1760
+ "default": "'{}'::jsonb"
1761
+ },
1762
+ "created_at": {
1763
+ "name": "created_at",
1764
+ "type": "timestamp with time zone",
1765
+ "primaryKey": false,
1766
+ "notNull": true
1767
+ },
1768
+ "updated_at": {
1769
+ "name": "updated_at",
1770
+ "type": "timestamp with time zone",
1771
+ "primaryKey": false,
1772
+ "notNull": true
1773
+ }
1774
+ },
1775
+ "indexes": {
1776
+ "products_slug_unique": {
1777
+ "name": "products_slug_unique",
1778
+ "columns": [
1779
+ {
1780
+ "expression": "slug",
1781
+ "isExpression": false,
1782
+ "asc": true,
1783
+ "nulls": "last"
1784
+ }
1785
+ ],
1786
+ "isUnique": true,
1787
+ "concurrently": false,
1788
+ "method": "btree",
1789
+ "with": {}
1790
+ },
1791
+ "products_status_idx": {
1792
+ "name": "products_status_idx",
1793
+ "columns": [
1794
+ {
1795
+ "expression": "status",
1796
+ "isExpression": false,
1797
+ "asc": true,
1798
+ "nulls": "last"
1799
+ }
1800
+ ],
1801
+ "isUnique": false,
1802
+ "concurrently": false,
1803
+ "method": "btree",
1804
+ "with": {}
1805
+ }
1806
+ },
1807
+ "foreignKeys": {},
1808
+ "compositePrimaryKeys": {},
1809
+ "uniqueConstraints": {},
1810
+ "policies": {},
1811
+ "checkConstraints": {},
1812
+ "isRLSEnabled": false
1813
+ },
1814
+ "public.refresh_tokens": {
1815
+ "name": "refresh_tokens",
1816
+ "schema": "",
1817
+ "columns": {
1818
+ "id": {
1819
+ "name": "id",
1820
+ "type": "text",
1821
+ "primaryKey": true,
1822
+ "notNull": true
1823
+ },
1824
+ "customer_id": {
1825
+ "name": "customer_id",
1826
+ "type": "text",
1827
+ "primaryKey": false,
1828
+ "notNull": true
1829
+ },
1830
+ "token_hash": {
1831
+ "name": "token_hash",
1832
+ "type": "text",
1833
+ "primaryKey": false,
1834
+ "notNull": true
1835
+ },
1836
+ "revoked_at": {
1837
+ "name": "revoked_at",
1838
+ "type": "timestamp with time zone",
1839
+ "primaryKey": false,
1840
+ "notNull": false
1841
+ },
1842
+ "replaced_by_jti": {
1843
+ "name": "replaced_by_jti",
1844
+ "type": "text",
1845
+ "primaryKey": false,
1846
+ "notNull": false
1847
+ },
1848
+ "expires_at": {
1849
+ "name": "expires_at",
1850
+ "type": "timestamp with time zone",
1851
+ "primaryKey": false,
1852
+ "notNull": true
1853
+ },
1854
+ "created_at": {
1855
+ "name": "created_at",
1856
+ "type": "timestamp with time zone",
1857
+ "primaryKey": false,
1858
+ "notNull": true
1859
+ }
1860
+ },
1861
+ "indexes": {
1862
+ "refresh_tokens_customer_idx": {
1863
+ "name": "refresh_tokens_customer_idx",
1864
+ "columns": [
1865
+ {
1866
+ "expression": "customer_id",
1867
+ "isExpression": false,
1868
+ "asc": true,
1869
+ "nulls": "last"
1870
+ }
1871
+ ],
1872
+ "isUnique": false,
1873
+ "concurrently": false,
1874
+ "method": "btree",
1875
+ "with": {}
1876
+ }
1877
+ },
1878
+ "foreignKeys": {},
1879
+ "compositePrimaryKeys": {},
1880
+ "uniqueConstraints": {},
1881
+ "policies": {},
1882
+ "checkConstraints": {},
1883
+ "isRLSEnabled": false
1884
+ },
1885
+ "public.reviews": {
1886
+ "name": "reviews",
1887
+ "schema": "",
1888
+ "columns": {
1889
+ "id": {
1890
+ "name": "id",
1891
+ "type": "text",
1892
+ "primaryKey": true,
1893
+ "notNull": true
1894
+ },
1895
+ "product_id": {
1896
+ "name": "product_id",
1897
+ "type": "text",
1898
+ "primaryKey": false,
1899
+ "notNull": true
1900
+ },
1901
+ "customer_id": {
1902
+ "name": "customer_id",
1903
+ "type": "text",
1904
+ "primaryKey": false,
1905
+ "notNull": false
1906
+ },
1907
+ "order_id": {
1908
+ "name": "order_id",
1909
+ "type": "text",
1910
+ "primaryKey": false,
1911
+ "notNull": false
1912
+ },
1913
+ "rating": {
1914
+ "name": "rating",
1915
+ "type": "integer",
1916
+ "primaryKey": false,
1917
+ "notNull": true
1918
+ },
1919
+ "title": {
1920
+ "name": "title",
1921
+ "type": "text",
1922
+ "primaryKey": false,
1923
+ "notNull": true,
1924
+ "default": "''"
1925
+ },
1926
+ "body": {
1927
+ "name": "body",
1928
+ "type": "text",
1929
+ "primaryKey": false,
1930
+ "notNull": true,
1931
+ "default": "''"
1932
+ },
1933
+ "moderation_status": {
1934
+ "name": "moderation_status",
1935
+ "type": "text",
1936
+ "primaryKey": false,
1937
+ "notNull": true,
1938
+ "default": "'pending'"
1939
+ },
1940
+ "submitted_at": {
1941
+ "name": "submitted_at",
1942
+ "type": "timestamp with time zone",
1943
+ "primaryKey": false,
1944
+ "notNull": true
1945
+ },
1946
+ "moderated_at": {
1947
+ "name": "moderated_at",
1948
+ "type": "timestamp with time zone",
1949
+ "primaryKey": false,
1950
+ "notNull": false
1951
+ },
1952
+ "moderated_by": {
1953
+ "name": "moderated_by",
1954
+ "type": "text",
1955
+ "primaryKey": false,
1956
+ "notNull": false
1957
+ }
1958
+ },
1959
+ "indexes": {
1960
+ "reviews_product_idx": {
1961
+ "name": "reviews_product_idx",
1962
+ "columns": [
1963
+ {
1964
+ "expression": "product_id",
1965
+ "isExpression": false,
1966
+ "asc": true,
1967
+ "nulls": "last"
1968
+ }
1969
+ ],
1970
+ "isUnique": false,
1971
+ "concurrently": false,
1972
+ "method": "btree",
1973
+ "with": {}
1974
+ },
1975
+ "reviews_status_idx": {
1976
+ "name": "reviews_status_idx",
1977
+ "columns": [
1978
+ {
1979
+ "expression": "moderation_status",
1980
+ "isExpression": false,
1981
+ "asc": true,
1982
+ "nulls": "last"
1983
+ }
1984
+ ],
1985
+ "isUnique": false,
1986
+ "concurrently": false,
1987
+ "method": "btree",
1988
+ "with": {}
1989
+ }
1990
+ },
1991
+ "foreignKeys": {},
1992
+ "compositePrimaryKeys": {},
1993
+ "uniqueConstraints": {},
1994
+ "policies": {},
1995
+ "checkConstraints": {},
1996
+ "isRLSEnabled": false
1997
+ },
1998
+ "public.settings": {
1999
+ "name": "settings",
2000
+ "schema": "",
2001
+ "columns": {
2002
+ "slot": {
2003
+ "name": "slot",
2004
+ "type": "text",
2005
+ "primaryKey": false,
2006
+ "notNull": true
2007
+ },
2008
+ "path": {
2009
+ "name": "path",
2010
+ "type": "text",
2011
+ "primaryKey": false,
2012
+ "notNull": true
2013
+ },
2014
+ "ciphertext": {
2015
+ "name": "ciphertext",
2016
+ "type": "bytea",
2017
+ "primaryKey": false,
2018
+ "notNull": false
2019
+ },
2020
+ "plain": {
2021
+ "name": "plain",
2022
+ "type": "text",
2023
+ "primaryKey": false,
2024
+ "notNull": false
2025
+ },
2026
+ "iv": {
2027
+ "name": "iv",
2028
+ "type": "bytea",
2029
+ "primaryKey": false,
2030
+ "notNull": false
2031
+ },
2032
+ "tag": {
2033
+ "name": "tag",
2034
+ "type": "bytea",
2035
+ "primaryKey": false,
2036
+ "notNull": false
2037
+ },
2038
+ "key_id": {
2039
+ "name": "key_id",
2040
+ "type": "text",
2041
+ "primaryKey": false,
2042
+ "notNull": false
2043
+ },
2044
+ "updated_at": {
2045
+ "name": "updated_at",
2046
+ "type": "timestamp with time zone",
2047
+ "primaryKey": false,
2048
+ "notNull": true
2049
+ },
2050
+ "updated_by": {
2051
+ "name": "updated_by",
2052
+ "type": "text",
2053
+ "primaryKey": false,
2054
+ "notNull": false
2055
+ }
2056
+ },
2057
+ "indexes": {},
2058
+ "foreignKeys": {},
2059
+ "compositePrimaryKeys": {
2060
+ "settings_slot_path_pk": {
2061
+ "name": "settings_slot_path_pk",
2062
+ "columns": [
2063
+ "slot",
2064
+ "path"
2065
+ ]
2066
+ }
2067
+ },
2068
+ "uniqueConstraints": {},
2069
+ "policies": {},
2070
+ "checkConstraints": {
2071
+ "settings_one_value": {
2072
+ "name": "settings_one_value",
2073
+ "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))"
2074
+ }
2075
+ },
2076
+ "isRLSEnabled": false
2077
+ },
2078
+ "public.stock_adjustments": {
2079
+ "name": "stock_adjustments",
2080
+ "schema": "",
2081
+ "columns": {
2082
+ "id": {
2083
+ "name": "id",
2084
+ "type": "text",
2085
+ "primaryKey": true,
2086
+ "notNull": true
2087
+ },
2088
+ "variant_id": {
2089
+ "name": "variant_id",
2090
+ "type": "text",
2091
+ "primaryKey": false,
2092
+ "notNull": true
2093
+ },
2094
+ "adjustment": {
2095
+ "name": "adjustment",
2096
+ "type": "integer",
2097
+ "primaryKey": false,
2098
+ "notNull": true
2099
+ },
2100
+ "reason": {
2101
+ "name": "reason",
2102
+ "type": "text",
2103
+ "primaryKey": false,
2104
+ "notNull": true
2105
+ },
2106
+ "actor": {
2107
+ "name": "actor",
2108
+ "type": "text",
2109
+ "primaryKey": false,
2110
+ "notNull": true
2111
+ },
2112
+ "previous_qty": {
2113
+ "name": "previous_qty",
2114
+ "type": "integer",
2115
+ "primaryKey": false,
2116
+ "notNull": true
2117
+ },
2118
+ "new_qty": {
2119
+ "name": "new_qty",
2120
+ "type": "integer",
2121
+ "primaryKey": false,
2122
+ "notNull": true
2123
+ },
2124
+ "timestamp": {
2125
+ "name": "timestamp",
2126
+ "type": "timestamp with time zone",
2127
+ "primaryKey": false,
2128
+ "notNull": true
2129
+ }
2130
+ },
2131
+ "indexes": {
2132
+ "stock_adjustments_variant_idx": {
2133
+ "name": "stock_adjustments_variant_idx",
2134
+ "columns": [
2135
+ {
2136
+ "expression": "variant_id",
2137
+ "isExpression": false,
2138
+ "asc": true,
2139
+ "nulls": "last"
2140
+ }
2141
+ ],
2142
+ "isUnique": false,
2143
+ "concurrently": false,
2144
+ "method": "btree",
2145
+ "with": {}
2146
+ }
2147
+ },
2148
+ "foreignKeys": {},
2149
+ "compositePrimaryKeys": {},
2150
+ "uniqueConstraints": {},
2151
+ "policies": {},
2152
+ "checkConstraints": {},
2153
+ "isRLSEnabled": false
2154
+ },
2155
+ "public.variants": {
2156
+ "name": "variants",
2157
+ "schema": "",
2158
+ "columns": {
2159
+ "id": {
2160
+ "name": "id",
2161
+ "type": "text",
2162
+ "primaryKey": true,
2163
+ "notNull": true
2164
+ },
2165
+ "product_id": {
2166
+ "name": "product_id",
2167
+ "type": "text",
2168
+ "primaryKey": false,
2169
+ "notNull": true
2170
+ },
2171
+ "sku": {
2172
+ "name": "sku",
2173
+ "type": "text",
2174
+ "primaryKey": false,
2175
+ "notNull": true
2176
+ },
2177
+ "name": {
2178
+ "name": "name",
2179
+ "type": "text",
2180
+ "primaryKey": false,
2181
+ "notNull": true,
2182
+ "default": "''"
2183
+ },
2184
+ "price_minor": {
2185
+ "name": "price_minor",
2186
+ "type": "integer",
2187
+ "primaryKey": false,
2188
+ "notNull": true
2189
+ },
2190
+ "compare_at_price_minor": {
2191
+ "name": "compare_at_price_minor",
2192
+ "type": "integer",
2193
+ "primaryKey": false,
2194
+ "notNull": false
2195
+ },
2196
+ "weight_grams": {
2197
+ "name": "weight_grams",
2198
+ "type": "integer",
2199
+ "primaryKey": false,
2200
+ "notNull": false
2201
+ },
2202
+ "dimensions": {
2203
+ "name": "dimensions",
2204
+ "type": "jsonb",
2205
+ "primaryKey": false,
2206
+ "notNull": false
2207
+ },
2208
+ "stock": {
2209
+ "name": "stock",
2210
+ "type": "integer",
2211
+ "primaryKey": false,
2212
+ "notNull": true,
2213
+ "default": 0
2214
+ },
2215
+ "low_stock_threshold": {
2216
+ "name": "low_stock_threshold",
2217
+ "type": "integer",
2218
+ "primaryKey": false,
2219
+ "notNull": true,
2220
+ "default": 0
2221
+ },
2222
+ "options": {
2223
+ "name": "options",
2224
+ "type": "jsonb",
2225
+ "primaryKey": false,
2226
+ "notNull": true,
2227
+ "default": "'[]'::jsonb"
2228
+ },
2229
+ "status": {
2230
+ "name": "status",
2231
+ "type": "text",
2232
+ "primaryKey": false,
2233
+ "notNull": true,
2234
+ "default": "'active'"
2235
+ },
2236
+ "created_at": {
2237
+ "name": "created_at",
2238
+ "type": "timestamp with time zone",
2239
+ "primaryKey": false,
2240
+ "notNull": true
2241
+ },
2242
+ "updated_at": {
2243
+ "name": "updated_at",
2244
+ "type": "timestamp with time zone",
2245
+ "primaryKey": false,
2246
+ "notNull": true
2247
+ }
2248
+ },
2249
+ "indexes": {
2250
+ "variants_sku_unique": {
2251
+ "name": "variants_sku_unique",
2252
+ "columns": [
2253
+ {
2254
+ "expression": "sku",
2255
+ "isExpression": false,
2256
+ "asc": true,
2257
+ "nulls": "last"
2258
+ }
2259
+ ],
2260
+ "isUnique": true,
2261
+ "concurrently": false,
2262
+ "method": "btree",
2263
+ "with": {}
2264
+ },
2265
+ "variants_product_idx": {
2266
+ "name": "variants_product_idx",
2267
+ "columns": [
2268
+ {
2269
+ "expression": "product_id",
2270
+ "isExpression": false,
2271
+ "asc": true,
2272
+ "nulls": "last"
2273
+ }
2274
+ ],
2275
+ "isUnique": false,
2276
+ "concurrently": false,
2277
+ "method": "btree",
2278
+ "with": {}
2279
+ }
2280
+ },
2281
+ "foreignKeys": {},
2282
+ "compositePrimaryKeys": {},
2283
+ "uniqueConstraints": {},
2284
+ "policies": {},
2285
+ "checkConstraints": {},
2286
+ "isRLSEnabled": false
2287
+ }
2288
+ },
2289
+ "enums": {},
2290
+ "schemas": {},
2291
+ "sequences": {},
2292
+ "roles": {},
2293
+ "policies": {},
2294
+ "views": {},
2295
+ "_meta": {
2296
+ "columns": {},
2297
+ "schemas": {},
2298
+ "tables": {}
2299
+ }
2300
+ }