@nymbalhq/platform 1.1.0 → 1.3.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 (40) hide show
  1. package/dist/chunk-2PLYK5RU.js +5861 -0
  2. package/dist/chunk-2PLYK5RU.js.map +1 -0
  3. package/dist/{chunk-PW6ILJF7.js → chunk-QN56IB4G.js} +146 -10
  4. package/dist/chunk-QN56IB4G.js.map +1 -0
  5. package/dist/db/schema/index.d.ts +3798 -2050
  6. package/dist/db/schema/index.js +1 -2
  7. package/dist/index.d.ts +423 -21
  8. package/dist/index.js +1647 -1873
  9. package/dist/index.js.map +1 -1
  10. package/dist/register-UUQ64HZP.js +8 -0
  11. package/migrations/postgres/0008_event_correlation.sql +6 -0
  12. package/migrations/postgres/0009_settings.sql +13 -0
  13. package/migrations/postgres/0010_catch_up_index.sql +2 -0
  14. package/migrations/postgres/0011_audit_entries.sql +27 -0
  15. package/migrations/postgres/0012_event_subject.sql +27 -0
  16. package/migrations/postgres/meta/0008_snapshot.json +1625 -0
  17. package/migrations/postgres/meta/0009_snapshot.json +1705 -0
  18. package/migrations/postgres/meta/0010_snapshot.json +1732 -0
  19. package/migrations/postgres/meta/0011_snapshot.json +1887 -0
  20. package/migrations/postgres/meta/0012_snapshot.json +1926 -0
  21. package/migrations/postgres/meta/_journal.json +35 -0
  22. package/migrations/sqlite/0008_event_correlation.sql +7 -0
  23. package/migrations/sqlite/0009_settings.sql +13 -0
  24. package/migrations/sqlite/0010_catch_up_index.sql +2 -0
  25. package/migrations/sqlite/0011_audit_entries.sql +26 -0
  26. package/migrations/sqlite/0012_event_subject.sql +27 -0
  27. package/migrations/sqlite/meta/0008_snapshot.json +1485 -0
  28. package/migrations/sqlite/meta/0009_snapshot.json +1571 -0
  29. package/migrations/sqlite/meta/0010_snapshot.json +1580 -0
  30. package/migrations/sqlite/meta/0011_snapshot.json +1705 -0
  31. package/migrations/sqlite/meta/0012_snapshot.json +1728 -0
  32. package/migrations/sqlite/meta/_journal.json +35 -0
  33. package/package.json +29 -23
  34. package/dist/chunk-2GFZHF5W.js +0 -2647
  35. package/dist/chunk-2GFZHF5W.js.map +0 -1
  36. package/dist/chunk-PW6ILJF7.js.map +0 -1
  37. package/dist/chunk-PZ5AY32C.js +0 -10
  38. package/dist/register-FJA7YJV3.js +0 -8
  39. package/dist/register-FJA7YJV3.js.map +0 -1
  40. /package/dist/{chunk-PZ5AY32C.js.map → register-UUQ64HZP.js.map} +0 -0
@@ -0,0 +1,1926 @@
1
+ {
2
+ "id": "fc7da201-2e3d-429e-9ff9-58f5b9e5773d",
3
+ "prevId": "1a99de95-1eb1-457e-b3ff-6430fde566b6",
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_history": {
752
+ "name": "order_history",
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
+ "from_status": {
768
+ "name": "from_status",
769
+ "type": "text",
770
+ "primaryKey": false,
771
+ "notNull": false
772
+ },
773
+ "to_status": {
774
+ "name": "to_status",
775
+ "type": "text",
776
+ "primaryKey": false,
777
+ "notNull": true
778
+ },
779
+ "actor": {
780
+ "name": "actor",
781
+ "type": "text",
782
+ "primaryKey": false,
783
+ "notNull": true
784
+ },
785
+ "note": {
786
+ "name": "note",
787
+ "type": "text",
788
+ "primaryKey": false,
789
+ "notNull": true,
790
+ "default": "''"
791
+ },
792
+ "timestamp": {
793
+ "name": "timestamp",
794
+ "type": "timestamp with time zone",
795
+ "primaryKey": false,
796
+ "notNull": true
797
+ }
798
+ },
799
+ "indexes": {
800
+ "order_history_order_idx": {
801
+ "name": "order_history_order_idx",
802
+ "columns": [
803
+ {
804
+ "expression": "order_id",
805
+ "isExpression": false,
806
+ "asc": true,
807
+ "nulls": "last"
808
+ }
809
+ ],
810
+ "isUnique": false,
811
+ "concurrently": false,
812
+ "method": "btree",
813
+ "with": {}
814
+ }
815
+ },
816
+ "foreignKeys": {},
817
+ "compositePrimaryKeys": {},
818
+ "uniqueConstraints": {},
819
+ "policies": {},
820
+ "checkConstraints": {},
821
+ "isRLSEnabled": false
822
+ },
823
+ "public.order_refunds": {
824
+ "name": "order_refunds",
825
+ "schema": "",
826
+ "columns": {
827
+ "id": {
828
+ "name": "id",
829
+ "type": "text",
830
+ "primaryKey": true,
831
+ "notNull": true
832
+ },
833
+ "order_id": {
834
+ "name": "order_id",
835
+ "type": "text",
836
+ "primaryKey": false,
837
+ "notNull": true
838
+ },
839
+ "amount_minor": {
840
+ "name": "amount_minor",
841
+ "type": "integer",
842
+ "primaryKey": false,
843
+ "notNull": true
844
+ },
845
+ "currency": {
846
+ "name": "currency",
847
+ "type": "text",
848
+ "primaryKey": false,
849
+ "notNull": true
850
+ },
851
+ "provider_refund_id": {
852
+ "name": "provider_refund_id",
853
+ "type": "text",
854
+ "primaryKey": false,
855
+ "notNull": false
856
+ },
857
+ "status": {
858
+ "name": "status",
859
+ "type": "text",
860
+ "primaryKey": false,
861
+ "notNull": true,
862
+ "default": "'pending'"
863
+ },
864
+ "reason": {
865
+ "name": "reason",
866
+ "type": "text",
867
+ "primaryKey": false,
868
+ "notNull": false
869
+ },
870
+ "actor": {
871
+ "name": "actor",
872
+ "type": "text",
873
+ "primaryKey": false,
874
+ "notNull": true
875
+ },
876
+ "created_at": {
877
+ "name": "created_at",
878
+ "type": "timestamp with time zone",
879
+ "primaryKey": false,
880
+ "notNull": true
881
+ },
882
+ "request_id": {
883
+ "name": "request_id",
884
+ "type": "text",
885
+ "primaryKey": false,
886
+ "notNull": false
887
+ }
888
+ },
889
+ "indexes": {
890
+ "order_refunds_order_idx": {
891
+ "name": "order_refunds_order_idx",
892
+ "columns": [
893
+ {
894
+ "expression": "order_id",
895
+ "isExpression": false,
896
+ "asc": true,
897
+ "nulls": "last"
898
+ }
899
+ ],
900
+ "isUnique": false,
901
+ "concurrently": false,
902
+ "method": "btree",
903
+ "with": {}
904
+ },
905
+ "order_refunds_order_request_idx": {
906
+ "name": "order_refunds_order_request_idx",
907
+ "columns": [
908
+ {
909
+ "expression": "order_id",
910
+ "isExpression": false,
911
+ "asc": true,
912
+ "nulls": "last"
913
+ },
914
+ {
915
+ "expression": "request_id",
916
+ "isExpression": false,
917
+ "asc": true,
918
+ "nulls": "last"
919
+ }
920
+ ],
921
+ "isUnique": true,
922
+ "concurrently": false,
923
+ "method": "btree",
924
+ "with": {}
925
+ }
926
+ },
927
+ "foreignKeys": {},
928
+ "compositePrimaryKeys": {},
929
+ "uniqueConstraints": {},
930
+ "policies": {},
931
+ "checkConstraints": {},
932
+ "isRLSEnabled": false
933
+ },
934
+ "public.order_sequences": {
935
+ "name": "order_sequences",
936
+ "schema": "",
937
+ "columns": {
938
+ "id": {
939
+ "name": "id",
940
+ "type": "integer",
941
+ "primaryKey": true,
942
+ "notNull": true
943
+ },
944
+ "next_value": {
945
+ "name": "next_value",
946
+ "type": "integer",
947
+ "primaryKey": false,
948
+ "notNull": true
949
+ }
950
+ },
951
+ "indexes": {},
952
+ "foreignKeys": {},
953
+ "compositePrimaryKeys": {},
954
+ "uniqueConstraints": {},
955
+ "policies": {},
956
+ "checkConstraints": {},
957
+ "isRLSEnabled": false
958
+ },
959
+ "public.orders": {
960
+ "name": "orders",
961
+ "schema": "",
962
+ "columns": {
963
+ "id": {
964
+ "name": "id",
965
+ "type": "text",
966
+ "primaryKey": true,
967
+ "notNull": true
968
+ },
969
+ "order_number": {
970
+ "name": "order_number",
971
+ "type": "text",
972
+ "primaryKey": false,
973
+ "notNull": true
974
+ },
975
+ "sequence": {
976
+ "name": "sequence",
977
+ "type": "integer",
978
+ "primaryKey": false,
979
+ "notNull": true
980
+ },
981
+ "customer_id": {
982
+ "name": "customer_id",
983
+ "type": "text",
984
+ "primaryKey": false,
985
+ "notNull": false
986
+ },
987
+ "status": {
988
+ "name": "status",
989
+ "type": "text",
990
+ "primaryKey": false,
991
+ "notNull": true,
992
+ "default": "'pending'"
993
+ },
994
+ "email": {
995
+ "name": "email",
996
+ "type": "text",
997
+ "primaryKey": false,
998
+ "notNull": true
999
+ },
1000
+ "billing_address": {
1001
+ "name": "billing_address",
1002
+ "type": "jsonb",
1003
+ "primaryKey": false,
1004
+ "notNull": true
1005
+ },
1006
+ "shipping_address": {
1007
+ "name": "shipping_address",
1008
+ "type": "jsonb",
1009
+ "primaryKey": false,
1010
+ "notNull": true
1011
+ },
1012
+ "line_items": {
1013
+ "name": "line_items",
1014
+ "type": "jsonb",
1015
+ "primaryKey": false,
1016
+ "notNull": true
1017
+ },
1018
+ "subtotal_minor": {
1019
+ "name": "subtotal_minor",
1020
+ "type": "integer",
1021
+ "primaryKey": false,
1022
+ "notNull": true
1023
+ },
1024
+ "tax_total_minor": {
1025
+ "name": "tax_total_minor",
1026
+ "type": "integer",
1027
+ "primaryKey": false,
1028
+ "notNull": true,
1029
+ "default": 0
1030
+ },
1031
+ "shipping_total_minor": {
1032
+ "name": "shipping_total_minor",
1033
+ "type": "integer",
1034
+ "primaryKey": false,
1035
+ "notNull": true,
1036
+ "default": 0
1037
+ },
1038
+ "discount_total_minor": {
1039
+ "name": "discount_total_minor",
1040
+ "type": "integer",
1041
+ "primaryKey": false,
1042
+ "notNull": true,
1043
+ "default": 0
1044
+ },
1045
+ "total_minor": {
1046
+ "name": "total_minor",
1047
+ "type": "integer",
1048
+ "primaryKey": false,
1049
+ "notNull": true
1050
+ },
1051
+ "currency": {
1052
+ "name": "currency",
1053
+ "type": "text",
1054
+ "primaryKey": false,
1055
+ "notNull": true
1056
+ },
1057
+ "notes": {
1058
+ "name": "notes",
1059
+ "type": "text",
1060
+ "primaryKey": false,
1061
+ "notNull": true,
1062
+ "default": "''"
1063
+ },
1064
+ "metadata": {
1065
+ "name": "metadata",
1066
+ "type": "jsonb",
1067
+ "primaryKey": false,
1068
+ "notNull": true,
1069
+ "default": "'{}'::jsonb"
1070
+ },
1071
+ "payment_intent_id": {
1072
+ "name": "payment_intent_id",
1073
+ "type": "text",
1074
+ "primaryKey": false,
1075
+ "notNull": false
1076
+ },
1077
+ "cart_token": {
1078
+ "name": "cart_token",
1079
+ "type": "text",
1080
+ "primaryKey": false,
1081
+ "notNull": false
1082
+ },
1083
+ "captured_minor": {
1084
+ "name": "captured_minor",
1085
+ "type": "integer",
1086
+ "primaryKey": false,
1087
+ "notNull": true,
1088
+ "default": 0
1089
+ },
1090
+ "captured_at": {
1091
+ "name": "captured_at",
1092
+ "type": "timestamp with time zone",
1093
+ "primaryKey": false,
1094
+ "notNull": false
1095
+ },
1096
+ "refunded_minor": {
1097
+ "name": "refunded_minor",
1098
+ "type": "integer",
1099
+ "primaryKey": false,
1100
+ "notNull": true,
1101
+ "default": 0
1102
+ },
1103
+ "capture_method": {
1104
+ "name": "capture_method",
1105
+ "type": "text",
1106
+ "primaryKey": false,
1107
+ "notNull": false
1108
+ },
1109
+ "created_at": {
1110
+ "name": "created_at",
1111
+ "type": "timestamp with time zone",
1112
+ "primaryKey": false,
1113
+ "notNull": true
1114
+ },
1115
+ "updated_at": {
1116
+ "name": "updated_at",
1117
+ "type": "timestamp with time zone",
1118
+ "primaryKey": false,
1119
+ "notNull": true
1120
+ }
1121
+ },
1122
+ "indexes": {
1123
+ "orders_number_unique": {
1124
+ "name": "orders_number_unique",
1125
+ "columns": [
1126
+ {
1127
+ "expression": "order_number",
1128
+ "isExpression": false,
1129
+ "asc": true,
1130
+ "nulls": "last"
1131
+ }
1132
+ ],
1133
+ "isUnique": true,
1134
+ "concurrently": false,
1135
+ "method": "btree",
1136
+ "with": {}
1137
+ },
1138
+ "orders_sequence_unique": {
1139
+ "name": "orders_sequence_unique",
1140
+ "columns": [
1141
+ {
1142
+ "expression": "sequence",
1143
+ "isExpression": false,
1144
+ "asc": true,
1145
+ "nulls": "last"
1146
+ }
1147
+ ],
1148
+ "isUnique": true,
1149
+ "concurrently": false,
1150
+ "method": "btree",
1151
+ "with": {}
1152
+ },
1153
+ "orders_customer_idx": {
1154
+ "name": "orders_customer_idx",
1155
+ "columns": [
1156
+ {
1157
+ "expression": "customer_id",
1158
+ "isExpression": false,
1159
+ "asc": true,
1160
+ "nulls": "last"
1161
+ }
1162
+ ],
1163
+ "isUnique": false,
1164
+ "concurrently": false,
1165
+ "method": "btree",
1166
+ "with": {}
1167
+ },
1168
+ "orders_status_idx": {
1169
+ "name": "orders_status_idx",
1170
+ "columns": [
1171
+ {
1172
+ "expression": "status",
1173
+ "isExpression": false,
1174
+ "asc": true,
1175
+ "nulls": "last"
1176
+ }
1177
+ ],
1178
+ "isUnique": false,
1179
+ "concurrently": false,
1180
+ "method": "btree",
1181
+ "with": {}
1182
+ },
1183
+ "orders_payment_intent_idx": {
1184
+ "name": "orders_payment_intent_idx",
1185
+ "columns": [
1186
+ {
1187
+ "expression": "payment_intent_id",
1188
+ "isExpression": false,
1189
+ "asc": true,
1190
+ "nulls": "last"
1191
+ }
1192
+ ],
1193
+ "isUnique": false,
1194
+ "concurrently": false,
1195
+ "method": "btree",
1196
+ "with": {}
1197
+ },
1198
+ "orders_pending_cart_unique": {
1199
+ "name": "orders_pending_cart_unique",
1200
+ "columns": [
1201
+ {
1202
+ "expression": "cart_token",
1203
+ "isExpression": false,
1204
+ "asc": true,
1205
+ "nulls": "last"
1206
+ }
1207
+ ],
1208
+ "isUnique": true,
1209
+ "where": "status = 'pending'",
1210
+ "concurrently": false,
1211
+ "method": "btree",
1212
+ "with": {}
1213
+ }
1214
+ },
1215
+ "foreignKeys": {},
1216
+ "compositePrimaryKeys": {},
1217
+ "uniqueConstraints": {},
1218
+ "policies": {},
1219
+ "checkConstraints": {},
1220
+ "isRLSEnabled": false
1221
+ },
1222
+ "public.processed_events": {
1223
+ "name": "processed_events",
1224
+ "schema": "",
1225
+ "columns": {
1226
+ "handler_name": {
1227
+ "name": "handler_name",
1228
+ "type": "text",
1229
+ "primaryKey": false,
1230
+ "notNull": true
1231
+ },
1232
+ "event_id": {
1233
+ "name": "event_id",
1234
+ "type": "text",
1235
+ "primaryKey": false,
1236
+ "notNull": true
1237
+ },
1238
+ "processed_at": {
1239
+ "name": "processed_at",
1240
+ "type": "timestamp with time zone",
1241
+ "primaryKey": false,
1242
+ "notNull": true
1243
+ }
1244
+ },
1245
+ "indexes": {},
1246
+ "foreignKeys": {},
1247
+ "compositePrimaryKeys": {
1248
+ "processed_events_handler_name_event_id_pk": {
1249
+ "name": "processed_events_handler_name_event_id_pk",
1250
+ "columns": [
1251
+ "handler_name",
1252
+ "event_id"
1253
+ ]
1254
+ }
1255
+ },
1256
+ "uniqueConstraints": {},
1257
+ "policies": {},
1258
+ "checkConstraints": {},
1259
+ "isRLSEnabled": false
1260
+ },
1261
+ "public.product_categories": {
1262
+ "name": "product_categories",
1263
+ "schema": "",
1264
+ "columns": {
1265
+ "product_id": {
1266
+ "name": "product_id",
1267
+ "type": "text",
1268
+ "primaryKey": false,
1269
+ "notNull": true
1270
+ },
1271
+ "category_id": {
1272
+ "name": "category_id",
1273
+ "type": "text",
1274
+ "primaryKey": false,
1275
+ "notNull": true
1276
+ }
1277
+ },
1278
+ "indexes": {
1279
+ "product_categories_category_idx": {
1280
+ "name": "product_categories_category_idx",
1281
+ "columns": [
1282
+ {
1283
+ "expression": "category_id",
1284
+ "isExpression": false,
1285
+ "asc": true,
1286
+ "nulls": "last"
1287
+ }
1288
+ ],
1289
+ "isUnique": false,
1290
+ "concurrently": false,
1291
+ "method": "btree",
1292
+ "with": {}
1293
+ }
1294
+ },
1295
+ "foreignKeys": {},
1296
+ "compositePrimaryKeys": {
1297
+ "product_categories_product_id_category_id_pk": {
1298
+ "name": "product_categories_product_id_category_id_pk",
1299
+ "columns": [
1300
+ "product_id",
1301
+ "category_id"
1302
+ ]
1303
+ }
1304
+ },
1305
+ "uniqueConstraints": {},
1306
+ "policies": {},
1307
+ "checkConstraints": {},
1308
+ "isRLSEnabled": false
1309
+ },
1310
+ "public.products": {
1311
+ "name": "products",
1312
+ "schema": "",
1313
+ "columns": {
1314
+ "id": {
1315
+ "name": "id",
1316
+ "type": "text",
1317
+ "primaryKey": true,
1318
+ "notNull": true
1319
+ },
1320
+ "slug": {
1321
+ "name": "slug",
1322
+ "type": "text",
1323
+ "primaryKey": false,
1324
+ "notNull": true
1325
+ },
1326
+ "name": {
1327
+ "name": "name",
1328
+ "type": "text",
1329
+ "primaryKey": false,
1330
+ "notNull": true
1331
+ },
1332
+ "description": {
1333
+ "name": "description",
1334
+ "type": "text",
1335
+ "primaryKey": false,
1336
+ "notNull": true,
1337
+ "default": "''"
1338
+ },
1339
+ "short_description": {
1340
+ "name": "short_description",
1341
+ "type": "text",
1342
+ "primaryKey": false,
1343
+ "notNull": true,
1344
+ "default": "''"
1345
+ },
1346
+ "status": {
1347
+ "name": "status",
1348
+ "type": "text",
1349
+ "primaryKey": false,
1350
+ "notNull": true,
1351
+ "default": "'draft'"
1352
+ },
1353
+ "type": {
1354
+ "name": "type",
1355
+ "type": "text",
1356
+ "primaryKey": false,
1357
+ "notNull": true,
1358
+ "default": "'simple'"
1359
+ },
1360
+ "seo_title": {
1361
+ "name": "seo_title",
1362
+ "type": "text",
1363
+ "primaryKey": false,
1364
+ "notNull": true,
1365
+ "default": "''"
1366
+ },
1367
+ "seo_description": {
1368
+ "name": "seo_description",
1369
+ "type": "text",
1370
+ "primaryKey": false,
1371
+ "notNull": true,
1372
+ "default": "''"
1373
+ },
1374
+ "media": {
1375
+ "name": "media",
1376
+ "type": "jsonb",
1377
+ "primaryKey": false,
1378
+ "notNull": true,
1379
+ "default": "'[]'::jsonb"
1380
+ },
1381
+ "metadata": {
1382
+ "name": "metadata",
1383
+ "type": "jsonb",
1384
+ "primaryKey": false,
1385
+ "notNull": true,
1386
+ "default": "'{}'::jsonb"
1387
+ },
1388
+ "created_at": {
1389
+ "name": "created_at",
1390
+ "type": "timestamp with time zone",
1391
+ "primaryKey": false,
1392
+ "notNull": true
1393
+ },
1394
+ "updated_at": {
1395
+ "name": "updated_at",
1396
+ "type": "timestamp with time zone",
1397
+ "primaryKey": false,
1398
+ "notNull": true
1399
+ }
1400
+ },
1401
+ "indexes": {
1402
+ "products_slug_unique": {
1403
+ "name": "products_slug_unique",
1404
+ "columns": [
1405
+ {
1406
+ "expression": "slug",
1407
+ "isExpression": false,
1408
+ "asc": true,
1409
+ "nulls": "last"
1410
+ }
1411
+ ],
1412
+ "isUnique": true,
1413
+ "concurrently": false,
1414
+ "method": "btree",
1415
+ "with": {}
1416
+ },
1417
+ "products_status_idx": {
1418
+ "name": "products_status_idx",
1419
+ "columns": [
1420
+ {
1421
+ "expression": "status",
1422
+ "isExpression": false,
1423
+ "asc": true,
1424
+ "nulls": "last"
1425
+ }
1426
+ ],
1427
+ "isUnique": false,
1428
+ "concurrently": false,
1429
+ "method": "btree",
1430
+ "with": {}
1431
+ }
1432
+ },
1433
+ "foreignKeys": {},
1434
+ "compositePrimaryKeys": {},
1435
+ "uniqueConstraints": {},
1436
+ "policies": {},
1437
+ "checkConstraints": {},
1438
+ "isRLSEnabled": false
1439
+ },
1440
+ "public.refresh_tokens": {
1441
+ "name": "refresh_tokens",
1442
+ "schema": "",
1443
+ "columns": {
1444
+ "id": {
1445
+ "name": "id",
1446
+ "type": "text",
1447
+ "primaryKey": true,
1448
+ "notNull": true
1449
+ },
1450
+ "customer_id": {
1451
+ "name": "customer_id",
1452
+ "type": "text",
1453
+ "primaryKey": false,
1454
+ "notNull": true
1455
+ },
1456
+ "token_hash": {
1457
+ "name": "token_hash",
1458
+ "type": "text",
1459
+ "primaryKey": false,
1460
+ "notNull": true
1461
+ },
1462
+ "revoked_at": {
1463
+ "name": "revoked_at",
1464
+ "type": "timestamp with time zone",
1465
+ "primaryKey": false,
1466
+ "notNull": false
1467
+ },
1468
+ "replaced_by_jti": {
1469
+ "name": "replaced_by_jti",
1470
+ "type": "text",
1471
+ "primaryKey": false,
1472
+ "notNull": false
1473
+ },
1474
+ "expires_at": {
1475
+ "name": "expires_at",
1476
+ "type": "timestamp with time zone",
1477
+ "primaryKey": false,
1478
+ "notNull": true
1479
+ },
1480
+ "created_at": {
1481
+ "name": "created_at",
1482
+ "type": "timestamp with time zone",
1483
+ "primaryKey": false,
1484
+ "notNull": true
1485
+ }
1486
+ },
1487
+ "indexes": {
1488
+ "refresh_tokens_customer_idx": {
1489
+ "name": "refresh_tokens_customer_idx",
1490
+ "columns": [
1491
+ {
1492
+ "expression": "customer_id",
1493
+ "isExpression": false,
1494
+ "asc": true,
1495
+ "nulls": "last"
1496
+ }
1497
+ ],
1498
+ "isUnique": false,
1499
+ "concurrently": false,
1500
+ "method": "btree",
1501
+ "with": {}
1502
+ }
1503
+ },
1504
+ "foreignKeys": {},
1505
+ "compositePrimaryKeys": {},
1506
+ "uniqueConstraints": {},
1507
+ "policies": {},
1508
+ "checkConstraints": {},
1509
+ "isRLSEnabled": false
1510
+ },
1511
+ "public.reviews": {
1512
+ "name": "reviews",
1513
+ "schema": "",
1514
+ "columns": {
1515
+ "id": {
1516
+ "name": "id",
1517
+ "type": "text",
1518
+ "primaryKey": true,
1519
+ "notNull": true
1520
+ },
1521
+ "product_id": {
1522
+ "name": "product_id",
1523
+ "type": "text",
1524
+ "primaryKey": false,
1525
+ "notNull": true
1526
+ },
1527
+ "customer_id": {
1528
+ "name": "customer_id",
1529
+ "type": "text",
1530
+ "primaryKey": false,
1531
+ "notNull": false
1532
+ },
1533
+ "order_id": {
1534
+ "name": "order_id",
1535
+ "type": "text",
1536
+ "primaryKey": false,
1537
+ "notNull": false
1538
+ },
1539
+ "rating": {
1540
+ "name": "rating",
1541
+ "type": "integer",
1542
+ "primaryKey": false,
1543
+ "notNull": true
1544
+ },
1545
+ "title": {
1546
+ "name": "title",
1547
+ "type": "text",
1548
+ "primaryKey": false,
1549
+ "notNull": true,
1550
+ "default": "''"
1551
+ },
1552
+ "body": {
1553
+ "name": "body",
1554
+ "type": "text",
1555
+ "primaryKey": false,
1556
+ "notNull": true,
1557
+ "default": "''"
1558
+ },
1559
+ "moderation_status": {
1560
+ "name": "moderation_status",
1561
+ "type": "text",
1562
+ "primaryKey": false,
1563
+ "notNull": true,
1564
+ "default": "'pending'"
1565
+ },
1566
+ "submitted_at": {
1567
+ "name": "submitted_at",
1568
+ "type": "timestamp with time zone",
1569
+ "primaryKey": false,
1570
+ "notNull": true
1571
+ },
1572
+ "moderated_at": {
1573
+ "name": "moderated_at",
1574
+ "type": "timestamp with time zone",
1575
+ "primaryKey": false,
1576
+ "notNull": false
1577
+ },
1578
+ "moderated_by": {
1579
+ "name": "moderated_by",
1580
+ "type": "text",
1581
+ "primaryKey": false,
1582
+ "notNull": false
1583
+ }
1584
+ },
1585
+ "indexes": {
1586
+ "reviews_product_idx": {
1587
+ "name": "reviews_product_idx",
1588
+ "columns": [
1589
+ {
1590
+ "expression": "product_id",
1591
+ "isExpression": false,
1592
+ "asc": true,
1593
+ "nulls": "last"
1594
+ }
1595
+ ],
1596
+ "isUnique": false,
1597
+ "concurrently": false,
1598
+ "method": "btree",
1599
+ "with": {}
1600
+ },
1601
+ "reviews_status_idx": {
1602
+ "name": "reviews_status_idx",
1603
+ "columns": [
1604
+ {
1605
+ "expression": "moderation_status",
1606
+ "isExpression": false,
1607
+ "asc": true,
1608
+ "nulls": "last"
1609
+ }
1610
+ ],
1611
+ "isUnique": false,
1612
+ "concurrently": false,
1613
+ "method": "btree",
1614
+ "with": {}
1615
+ }
1616
+ },
1617
+ "foreignKeys": {},
1618
+ "compositePrimaryKeys": {},
1619
+ "uniqueConstraints": {},
1620
+ "policies": {},
1621
+ "checkConstraints": {},
1622
+ "isRLSEnabled": false
1623
+ },
1624
+ "public.settings": {
1625
+ "name": "settings",
1626
+ "schema": "",
1627
+ "columns": {
1628
+ "slot": {
1629
+ "name": "slot",
1630
+ "type": "text",
1631
+ "primaryKey": false,
1632
+ "notNull": true
1633
+ },
1634
+ "path": {
1635
+ "name": "path",
1636
+ "type": "text",
1637
+ "primaryKey": false,
1638
+ "notNull": true
1639
+ },
1640
+ "ciphertext": {
1641
+ "name": "ciphertext",
1642
+ "type": "bytea",
1643
+ "primaryKey": false,
1644
+ "notNull": false
1645
+ },
1646
+ "plain": {
1647
+ "name": "plain",
1648
+ "type": "text",
1649
+ "primaryKey": false,
1650
+ "notNull": false
1651
+ },
1652
+ "iv": {
1653
+ "name": "iv",
1654
+ "type": "bytea",
1655
+ "primaryKey": false,
1656
+ "notNull": false
1657
+ },
1658
+ "tag": {
1659
+ "name": "tag",
1660
+ "type": "bytea",
1661
+ "primaryKey": false,
1662
+ "notNull": false
1663
+ },
1664
+ "key_id": {
1665
+ "name": "key_id",
1666
+ "type": "text",
1667
+ "primaryKey": false,
1668
+ "notNull": false
1669
+ },
1670
+ "updated_at": {
1671
+ "name": "updated_at",
1672
+ "type": "timestamp with time zone",
1673
+ "primaryKey": false,
1674
+ "notNull": true
1675
+ },
1676
+ "updated_by": {
1677
+ "name": "updated_by",
1678
+ "type": "text",
1679
+ "primaryKey": false,
1680
+ "notNull": false
1681
+ }
1682
+ },
1683
+ "indexes": {},
1684
+ "foreignKeys": {},
1685
+ "compositePrimaryKeys": {
1686
+ "settings_slot_path_pk": {
1687
+ "name": "settings_slot_path_pk",
1688
+ "columns": [
1689
+ "slot",
1690
+ "path"
1691
+ ]
1692
+ }
1693
+ },
1694
+ "uniqueConstraints": {},
1695
+ "policies": {},
1696
+ "checkConstraints": {
1697
+ "settings_one_value": {
1698
+ "name": "settings_one_value",
1699
+ "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))"
1700
+ }
1701
+ },
1702
+ "isRLSEnabled": false
1703
+ },
1704
+ "public.stock_adjustments": {
1705
+ "name": "stock_adjustments",
1706
+ "schema": "",
1707
+ "columns": {
1708
+ "id": {
1709
+ "name": "id",
1710
+ "type": "text",
1711
+ "primaryKey": true,
1712
+ "notNull": true
1713
+ },
1714
+ "variant_id": {
1715
+ "name": "variant_id",
1716
+ "type": "text",
1717
+ "primaryKey": false,
1718
+ "notNull": true
1719
+ },
1720
+ "adjustment": {
1721
+ "name": "adjustment",
1722
+ "type": "integer",
1723
+ "primaryKey": false,
1724
+ "notNull": true
1725
+ },
1726
+ "reason": {
1727
+ "name": "reason",
1728
+ "type": "text",
1729
+ "primaryKey": false,
1730
+ "notNull": true
1731
+ },
1732
+ "actor": {
1733
+ "name": "actor",
1734
+ "type": "text",
1735
+ "primaryKey": false,
1736
+ "notNull": true
1737
+ },
1738
+ "previous_qty": {
1739
+ "name": "previous_qty",
1740
+ "type": "integer",
1741
+ "primaryKey": false,
1742
+ "notNull": true
1743
+ },
1744
+ "new_qty": {
1745
+ "name": "new_qty",
1746
+ "type": "integer",
1747
+ "primaryKey": false,
1748
+ "notNull": true
1749
+ },
1750
+ "timestamp": {
1751
+ "name": "timestamp",
1752
+ "type": "timestamp with time zone",
1753
+ "primaryKey": false,
1754
+ "notNull": true
1755
+ }
1756
+ },
1757
+ "indexes": {
1758
+ "stock_adjustments_variant_idx": {
1759
+ "name": "stock_adjustments_variant_idx",
1760
+ "columns": [
1761
+ {
1762
+ "expression": "variant_id",
1763
+ "isExpression": false,
1764
+ "asc": true,
1765
+ "nulls": "last"
1766
+ }
1767
+ ],
1768
+ "isUnique": false,
1769
+ "concurrently": false,
1770
+ "method": "btree",
1771
+ "with": {}
1772
+ }
1773
+ },
1774
+ "foreignKeys": {},
1775
+ "compositePrimaryKeys": {},
1776
+ "uniqueConstraints": {},
1777
+ "policies": {},
1778
+ "checkConstraints": {},
1779
+ "isRLSEnabled": false
1780
+ },
1781
+ "public.variants": {
1782
+ "name": "variants",
1783
+ "schema": "",
1784
+ "columns": {
1785
+ "id": {
1786
+ "name": "id",
1787
+ "type": "text",
1788
+ "primaryKey": true,
1789
+ "notNull": true
1790
+ },
1791
+ "product_id": {
1792
+ "name": "product_id",
1793
+ "type": "text",
1794
+ "primaryKey": false,
1795
+ "notNull": true
1796
+ },
1797
+ "sku": {
1798
+ "name": "sku",
1799
+ "type": "text",
1800
+ "primaryKey": false,
1801
+ "notNull": true
1802
+ },
1803
+ "name": {
1804
+ "name": "name",
1805
+ "type": "text",
1806
+ "primaryKey": false,
1807
+ "notNull": true,
1808
+ "default": "''"
1809
+ },
1810
+ "price_minor": {
1811
+ "name": "price_minor",
1812
+ "type": "integer",
1813
+ "primaryKey": false,
1814
+ "notNull": true
1815
+ },
1816
+ "compare_at_price_minor": {
1817
+ "name": "compare_at_price_minor",
1818
+ "type": "integer",
1819
+ "primaryKey": false,
1820
+ "notNull": false
1821
+ },
1822
+ "weight_grams": {
1823
+ "name": "weight_grams",
1824
+ "type": "integer",
1825
+ "primaryKey": false,
1826
+ "notNull": false
1827
+ },
1828
+ "dimensions": {
1829
+ "name": "dimensions",
1830
+ "type": "jsonb",
1831
+ "primaryKey": false,
1832
+ "notNull": false
1833
+ },
1834
+ "stock": {
1835
+ "name": "stock",
1836
+ "type": "integer",
1837
+ "primaryKey": false,
1838
+ "notNull": true,
1839
+ "default": 0
1840
+ },
1841
+ "low_stock_threshold": {
1842
+ "name": "low_stock_threshold",
1843
+ "type": "integer",
1844
+ "primaryKey": false,
1845
+ "notNull": true,
1846
+ "default": 0
1847
+ },
1848
+ "options": {
1849
+ "name": "options",
1850
+ "type": "jsonb",
1851
+ "primaryKey": false,
1852
+ "notNull": true,
1853
+ "default": "'[]'::jsonb"
1854
+ },
1855
+ "status": {
1856
+ "name": "status",
1857
+ "type": "text",
1858
+ "primaryKey": false,
1859
+ "notNull": true,
1860
+ "default": "'active'"
1861
+ },
1862
+ "created_at": {
1863
+ "name": "created_at",
1864
+ "type": "timestamp with time zone",
1865
+ "primaryKey": false,
1866
+ "notNull": true
1867
+ },
1868
+ "updated_at": {
1869
+ "name": "updated_at",
1870
+ "type": "timestamp with time zone",
1871
+ "primaryKey": false,
1872
+ "notNull": true
1873
+ }
1874
+ },
1875
+ "indexes": {
1876
+ "variants_sku_unique": {
1877
+ "name": "variants_sku_unique",
1878
+ "columns": [
1879
+ {
1880
+ "expression": "sku",
1881
+ "isExpression": false,
1882
+ "asc": true,
1883
+ "nulls": "last"
1884
+ }
1885
+ ],
1886
+ "isUnique": true,
1887
+ "concurrently": false,
1888
+ "method": "btree",
1889
+ "with": {}
1890
+ },
1891
+ "variants_product_idx": {
1892
+ "name": "variants_product_idx",
1893
+ "columns": [
1894
+ {
1895
+ "expression": "product_id",
1896
+ "isExpression": false,
1897
+ "asc": true,
1898
+ "nulls": "last"
1899
+ }
1900
+ ],
1901
+ "isUnique": false,
1902
+ "concurrently": false,
1903
+ "method": "btree",
1904
+ "with": {}
1905
+ }
1906
+ },
1907
+ "foreignKeys": {},
1908
+ "compositePrimaryKeys": {},
1909
+ "uniqueConstraints": {},
1910
+ "policies": {},
1911
+ "checkConstraints": {},
1912
+ "isRLSEnabled": false
1913
+ }
1914
+ },
1915
+ "enums": {},
1916
+ "schemas": {},
1917
+ "sequences": {},
1918
+ "roles": {},
1919
+ "policies": {},
1920
+ "views": {},
1921
+ "_meta": {
1922
+ "columns": {},
1923
+ "schemas": {},
1924
+ "tables": {}
1925
+ }
1926
+ }