@nymbalhq/platform 1.3.0 → 1.4.0

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