@queelabs/db 0.0.1 → 0.0.2

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.
@@ -1,3164 +0,0 @@
1
- {
2
- "id": "a2aff4b6-4635-488d-a2f4-29394c9cf933",
3
- "prevId": "9b29a76d-cc53-407c-bfd3-4021fdd89b39",
4
- "version": "7",
5
- "dialect": "postgresql",
6
- "tables": {
7
- "public.actor_memberships": {
8
- "name": "actor_memberships",
9
- "schema": "",
10
- "columns": {
11
- "actor_id": {
12
- "name": "actor_id",
13
- "type": "text",
14
- "primaryKey": false,
15
- "notNull": true
16
- },
17
- "marketplace_id": {
18
- "name": "marketplace_id",
19
- "type": "text",
20
- "primaryKey": false,
21
- "notNull": true
22
- },
23
- "role": {
24
- "name": "role",
25
- "type": "text",
26
- "primaryKey": false,
27
- "notNull": true
28
- }
29
- },
30
- "indexes": {},
31
- "foreignKeys": {
32
- "actor_memberships_actor_id_actors_id_fk": {
33
- "name": "actor_memberships_actor_id_actors_id_fk",
34
- "tableFrom": "actor_memberships",
35
- "tableTo": "actors",
36
- "columnsFrom": [
37
- "actor_id"
38
- ],
39
- "columnsTo": [
40
- "id"
41
- ],
42
- "onDelete": "cascade",
43
- "onUpdate": "no action"
44
- },
45
- "actor_memberships_marketplace_id_marketplaces_id_fk": {
46
- "name": "actor_memberships_marketplace_id_marketplaces_id_fk",
47
- "tableFrom": "actor_memberships",
48
- "tableTo": "marketplaces",
49
- "columnsFrom": [
50
- "marketplace_id"
51
- ],
52
- "columnsTo": [
53
- "id"
54
- ],
55
- "onDelete": "cascade",
56
- "onUpdate": "no action"
57
- }
58
- },
59
- "compositePrimaryKeys": {
60
- "actor_memberships_actor_id_marketplace_id_pk": {
61
- "name": "actor_memberships_actor_id_marketplace_id_pk",
62
- "columns": [
63
- "actor_id",
64
- "marketplace_id"
65
- ]
66
- }
67
- },
68
- "uniqueConstraints": {},
69
- "policies": {},
70
- "checkConstraints": {},
71
- "isRLSEnabled": false
72
- },
73
- "public.actors": {
74
- "name": "actors",
75
- "schema": "",
76
- "columns": {
77
- "id": {
78
- "name": "id",
79
- "type": "text",
80
- "primaryKey": true,
81
- "notNull": true
82
- },
83
- "marketplace_id": {
84
- "name": "marketplace_id",
85
- "type": "text",
86
- "primaryKey": false,
87
- "notNull": true
88
- },
89
- "external_ref": {
90
- "name": "external_ref",
91
- "type": "text",
92
- "primaryKey": false,
93
- "notNull": false
94
- },
95
- "type": {
96
- "name": "type",
97
- "type": "text",
98
- "primaryKey": false,
99
- "notNull": true
100
- },
101
- "display_name": {
102
- "name": "display_name",
103
- "type": "text",
104
- "primaryKey": false,
105
- "notNull": true
106
- },
107
- "default_payout_destination": {
108
- "name": "default_payout_destination",
109
- "type": "jsonb",
110
- "primaryKey": false,
111
- "notNull": false
112
- },
113
- "metadata": {
114
- "name": "metadata",
115
- "type": "jsonb",
116
- "primaryKey": false,
117
- "notNull": false
118
- },
119
- "created_at": {
120
- "name": "created_at",
121
- "type": "timestamp with time zone",
122
- "primaryKey": false,
123
- "notNull": true,
124
- "default": "now()"
125
- },
126
- "updated_at": {
127
- "name": "updated_at",
128
- "type": "timestamp with time zone",
129
- "primaryKey": false,
130
- "notNull": true,
131
- "default": "now()"
132
- }
133
- },
134
- "indexes": {
135
- "actors_marketplace_idx": {
136
- "name": "actors_marketplace_idx",
137
- "columns": [
138
- {
139
- "expression": "marketplace_id",
140
- "isExpression": false,
141
- "asc": true,
142
- "nulls": "last"
143
- }
144
- ],
145
- "isUnique": false,
146
- "concurrently": false,
147
- "method": "btree",
148
- "with": {}
149
- },
150
- "actors_marketplace_external_ref_uq": {
151
- "name": "actors_marketplace_external_ref_uq",
152
- "columns": [
153
- {
154
- "expression": "marketplace_id",
155
- "isExpression": false,
156
- "asc": true,
157
- "nulls": "last"
158
- },
159
- {
160
- "expression": "external_ref",
161
- "isExpression": false,
162
- "asc": true,
163
- "nulls": "last"
164
- }
165
- ],
166
- "isUnique": true,
167
- "concurrently": false,
168
- "method": "btree",
169
- "with": {}
170
- }
171
- },
172
- "foreignKeys": {
173
- "actors_marketplace_id_marketplaces_id_fk": {
174
- "name": "actors_marketplace_id_marketplaces_id_fk",
175
- "tableFrom": "actors",
176
- "tableTo": "marketplaces",
177
- "columnsFrom": [
178
- "marketplace_id"
179
- ],
180
- "columnsTo": [
181
- "id"
182
- ],
183
- "onDelete": "cascade",
184
- "onUpdate": "no action"
185
- }
186
- },
187
- "compositePrimaryKeys": {},
188
- "uniqueConstraints": {},
189
- "policies": {},
190
- "checkConstraints": {},
191
- "isRLSEnabled": false
192
- },
193
- "public.admin_users": {
194
- "name": "admin_users",
195
- "schema": "",
196
- "columns": {
197
- "id": {
198
- "name": "id",
199
- "type": "text",
200
- "primaryKey": true,
201
- "notNull": true
202
- },
203
- "email": {
204
- "name": "email",
205
- "type": "text",
206
- "primaryKey": false,
207
- "notNull": true
208
- },
209
- "external_ref": {
210
- "name": "external_ref",
211
- "type": "text",
212
- "primaryKey": false,
213
- "notNull": false
214
- },
215
- "created_at": {
216
- "name": "created_at",
217
- "type": "timestamp with time zone",
218
- "primaryKey": false,
219
- "notNull": true,
220
- "default": "now()"
221
- },
222
- "updated_at": {
223
- "name": "updated_at",
224
- "type": "timestamp with time zone",
225
- "primaryKey": false,
226
- "notNull": true,
227
- "default": "now()"
228
- }
229
- },
230
- "indexes": {
231
- "admin_users_email_uq": {
232
- "name": "admin_users_email_uq",
233
- "columns": [
234
- {
235
- "expression": "email",
236
- "isExpression": false,
237
- "asc": true,
238
- "nulls": "last"
239
- }
240
- ],
241
- "isUnique": true,
242
- "concurrently": false,
243
- "method": "btree",
244
- "with": {}
245
- }
246
- },
247
- "foreignKeys": {},
248
- "compositePrimaryKeys": {},
249
- "uniqueConstraints": {},
250
- "policies": {},
251
- "checkConstraints": {},
252
- "isRLSEnabled": false
253
- },
254
- "public.agent_tokens": {
255
- "name": "agent_tokens",
256
- "schema": "",
257
- "columns": {
258
- "id": {
259
- "name": "id",
260
- "type": "text",
261
- "primaryKey": true,
262
- "notNull": true
263
- },
264
- "marketplace_id": {
265
- "name": "marketplace_id",
266
- "type": "text",
267
- "primaryKey": false,
268
- "notNull": true
269
- },
270
- "actor_id": {
271
- "name": "actor_id",
272
- "type": "text",
273
- "primaryKey": false,
274
- "notNull": false
275
- },
276
- "hashed_token": {
277
- "name": "hashed_token",
278
- "type": "text",
279
- "primaryKey": false,
280
- "notNull": true
281
- },
282
- "label": {
283
- "name": "label",
284
- "type": "text",
285
- "primaryKey": false,
286
- "notNull": false
287
- },
288
- "expires_at": {
289
- "name": "expires_at",
290
- "type": "timestamp with time zone",
291
- "primaryKey": false,
292
- "notNull": false
293
- },
294
- "created_at": {
295
- "name": "created_at",
296
- "type": "timestamp with time zone",
297
- "primaryKey": false,
298
- "notNull": true,
299
- "default": "now()"
300
- }
301
- },
302
- "indexes": {
303
- "agent_tokens_marketplace_idx": {
304
- "name": "agent_tokens_marketplace_idx",
305
- "columns": [
306
- {
307
- "expression": "marketplace_id",
308
- "isExpression": false,
309
- "asc": true,
310
- "nulls": "last"
311
- }
312
- ],
313
- "isUnique": false,
314
- "concurrently": false,
315
- "method": "btree",
316
- "with": {}
317
- }
318
- },
319
- "foreignKeys": {
320
- "agent_tokens_marketplace_id_marketplaces_id_fk": {
321
- "name": "agent_tokens_marketplace_id_marketplaces_id_fk",
322
- "tableFrom": "agent_tokens",
323
- "tableTo": "marketplaces",
324
- "columnsFrom": [
325
- "marketplace_id"
326
- ],
327
- "columnsTo": [
328
- "id"
329
- ],
330
- "onDelete": "cascade",
331
- "onUpdate": "no action"
332
- },
333
- "agent_tokens_actor_id_actors_id_fk": {
334
- "name": "agent_tokens_actor_id_actors_id_fk",
335
- "tableFrom": "agent_tokens",
336
- "tableTo": "actors",
337
- "columnsFrom": [
338
- "actor_id"
339
- ],
340
- "columnsTo": [
341
- "id"
342
- ],
343
- "onDelete": "set null",
344
- "onUpdate": "no action"
345
- }
346
- },
347
- "compositePrimaryKeys": {},
348
- "uniqueConstraints": {},
349
- "policies": {},
350
- "checkConstraints": {},
351
- "isRLSEnabled": false
352
- },
353
- "public.api_keys": {
354
- "name": "api_keys",
355
- "schema": "",
356
- "columns": {
357
- "id": {
358
- "name": "id",
359
- "type": "text",
360
- "primaryKey": true,
361
- "notNull": true
362
- },
363
- "marketplace_id": {
364
- "name": "marketplace_id",
365
- "type": "text",
366
- "primaryKey": false,
367
- "notNull": true
368
- },
369
- "name": {
370
- "name": "name",
371
- "type": "text",
372
- "primaryKey": false,
373
- "notNull": true
374
- },
375
- "hashed_key": {
376
- "name": "hashed_key",
377
- "type": "text",
378
- "primaryKey": false,
379
- "notNull": true
380
- },
381
- "prefix": {
382
- "name": "prefix",
383
- "type": "text",
384
- "primaryKey": false,
385
- "notNull": true
386
- },
387
- "scopes": {
388
- "name": "scopes",
389
- "type": "jsonb",
390
- "primaryKey": false,
391
- "notNull": true,
392
- "default": "'[\"*\"]'::jsonb"
393
- },
394
- "revoked_at": {
395
- "name": "revoked_at",
396
- "type": "timestamp with time zone",
397
- "primaryKey": false,
398
- "notNull": false
399
- },
400
- "expires_at": {
401
- "name": "expires_at",
402
- "type": "timestamp with time zone",
403
- "primaryKey": false,
404
- "notNull": false
405
- },
406
- "last_used_at": {
407
- "name": "last_used_at",
408
- "type": "timestamp with time zone",
409
- "primaryKey": false,
410
- "notNull": false
411
- },
412
- "created_at": {
413
- "name": "created_at",
414
- "type": "timestamp with time zone",
415
- "primaryKey": false,
416
- "notNull": true,
417
- "default": "now()"
418
- }
419
- },
420
- "indexes": {
421
- "api_keys_marketplace_idx": {
422
- "name": "api_keys_marketplace_idx",
423
- "columns": [
424
- {
425
- "expression": "marketplace_id",
426
- "isExpression": false,
427
- "asc": true,
428
- "nulls": "last"
429
- }
430
- ],
431
- "isUnique": false,
432
- "concurrently": false,
433
- "method": "btree",
434
- "with": {}
435
- }
436
- },
437
- "foreignKeys": {
438
- "api_keys_marketplace_id_marketplaces_id_fk": {
439
- "name": "api_keys_marketplace_id_marketplaces_id_fk",
440
- "tableFrom": "api_keys",
441
- "tableTo": "marketplaces",
442
- "columnsFrom": [
443
- "marketplace_id"
444
- ],
445
- "columnsTo": [
446
- "id"
447
- ],
448
- "onDelete": "cascade",
449
- "onUpdate": "no action"
450
- }
451
- },
452
- "compositePrimaryKeys": {},
453
- "uniqueConstraints": {},
454
- "policies": {},
455
- "checkConstraints": {},
456
- "isRLSEnabled": false
457
- },
458
- "public.audit_logs": {
459
- "name": "audit_logs",
460
- "schema": "",
461
- "columns": {
462
- "id": {
463
- "name": "id",
464
- "type": "text",
465
- "primaryKey": true,
466
- "notNull": true
467
- },
468
- "marketplace_id": {
469
- "name": "marketplace_id",
470
- "type": "text",
471
- "primaryKey": false,
472
- "notNull": false
473
- },
474
- "actor_id": {
475
- "name": "actor_id",
476
- "type": "text",
477
- "primaryKey": false,
478
- "notNull": false
479
- },
480
- "action": {
481
- "name": "action",
482
- "type": "text",
483
- "primaryKey": false,
484
- "notNull": true
485
- },
486
- "resource": {
487
- "name": "resource",
488
- "type": "text",
489
- "primaryKey": false,
490
- "notNull": true
491
- },
492
- "metadata": {
493
- "name": "metadata",
494
- "type": "jsonb",
495
- "primaryKey": false,
496
- "notNull": false
497
- },
498
- "created_at": {
499
- "name": "created_at",
500
- "type": "timestamp with time zone",
501
- "primaryKey": false,
502
- "notNull": true,
503
- "default": "now()"
504
- }
505
- },
506
- "indexes": {
507
- "audit_logs_marketplace_idx": {
508
- "name": "audit_logs_marketplace_idx",
509
- "columns": [
510
- {
511
- "expression": "marketplace_id",
512
- "isExpression": false,
513
- "asc": true,
514
- "nulls": "last"
515
- }
516
- ],
517
- "isUnique": false,
518
- "concurrently": false,
519
- "method": "btree",
520
- "with": {}
521
- }
522
- },
523
- "foreignKeys": {
524
- "audit_logs_marketplace_id_marketplaces_id_fk": {
525
- "name": "audit_logs_marketplace_id_marketplaces_id_fk",
526
- "tableFrom": "audit_logs",
527
- "tableTo": "marketplaces",
528
- "columnsFrom": [
529
- "marketplace_id"
530
- ],
531
- "columnsTo": [
532
- "id"
533
- ],
534
- "onDelete": "set null",
535
- "onUpdate": "no action"
536
- },
537
- "audit_logs_actor_id_actors_id_fk": {
538
- "name": "audit_logs_actor_id_actors_id_fk",
539
- "tableFrom": "audit_logs",
540
- "tableTo": "actors",
541
- "columnsFrom": [
542
- "actor_id"
543
- ],
544
- "columnsTo": [
545
- "id"
546
- ],
547
- "onDelete": "set null",
548
- "onUpdate": "no action"
549
- }
550
- },
551
- "compositePrimaryKeys": {},
552
- "uniqueConstraints": {},
553
- "policies": {},
554
- "checkConstraints": {},
555
- "isRLSEnabled": false
556
- },
557
- "public.disputes": {
558
- "name": "disputes",
559
- "schema": "",
560
- "columns": {
561
- "id": {
562
- "name": "id",
563
- "type": "text",
564
- "primaryKey": true,
565
- "notNull": true
566
- },
567
- "marketplace_id": {
568
- "name": "marketplace_id",
569
- "type": "text",
570
- "primaryKey": false,
571
- "notNull": true
572
- },
573
- "order_id": {
574
- "name": "order_id",
575
- "type": "text",
576
- "primaryKey": false,
577
- "notNull": true
578
- },
579
- "status": {
580
- "name": "status",
581
- "type": "text",
582
- "primaryKey": false,
583
- "notNull": true,
584
- "default": "'open'"
585
- },
586
- "reason": {
587
- "name": "reason",
588
- "type": "text",
589
- "primaryKey": false,
590
- "notNull": false
591
- },
592
- "created_at": {
593
- "name": "created_at",
594
- "type": "timestamp with time zone",
595
- "primaryKey": false,
596
- "notNull": true,
597
- "default": "now()"
598
- },
599
- "updated_at": {
600
- "name": "updated_at",
601
- "type": "timestamp with time zone",
602
- "primaryKey": false,
603
- "notNull": true,
604
- "default": "now()"
605
- }
606
- },
607
- "indexes": {
608
- "disputes_order_idx": {
609
- "name": "disputes_order_idx",
610
- "columns": [
611
- {
612
- "expression": "order_id",
613
- "isExpression": false,
614
- "asc": true,
615
- "nulls": "last"
616
- }
617
- ],
618
- "isUnique": false,
619
- "concurrently": false,
620
- "method": "btree",
621
- "with": {}
622
- }
623
- },
624
- "foreignKeys": {
625
- "disputes_marketplace_id_marketplaces_id_fk": {
626
- "name": "disputes_marketplace_id_marketplaces_id_fk",
627
- "tableFrom": "disputes",
628
- "tableTo": "marketplaces",
629
- "columnsFrom": [
630
- "marketplace_id"
631
- ],
632
- "columnsTo": [
633
- "id"
634
- ],
635
- "onDelete": "cascade",
636
- "onUpdate": "no action"
637
- },
638
- "disputes_order_id_orders_id_fk": {
639
- "name": "disputes_order_id_orders_id_fk",
640
- "tableFrom": "disputes",
641
- "tableTo": "orders",
642
- "columnsFrom": [
643
- "order_id"
644
- ],
645
- "columnsTo": [
646
- "id"
647
- ],
648
- "onDelete": "cascade",
649
- "onUpdate": "no action"
650
- }
651
- },
652
- "compositePrimaryKeys": {},
653
- "uniqueConstraints": {},
654
- "policies": {},
655
- "checkConstraints": {},
656
- "isRLSEnabled": false
657
- },
658
- "public.domain_events": {
659
- "name": "domain_events",
660
- "schema": "",
661
- "columns": {
662
- "id": {
663
- "name": "id",
664
- "type": "text",
665
- "primaryKey": true,
666
- "notNull": true
667
- },
668
- "marketplace_id": {
669
- "name": "marketplace_id",
670
- "type": "text",
671
- "primaryKey": false,
672
- "notNull": true
673
- },
674
- "type": {
675
- "name": "type",
676
- "type": "text",
677
- "primaryKey": false,
678
- "notNull": true
679
- },
680
- "aggregate_type": {
681
- "name": "aggregate_type",
682
- "type": "text",
683
- "primaryKey": false,
684
- "notNull": true
685
- },
686
- "aggregate_id": {
687
- "name": "aggregate_id",
688
- "type": "text",
689
- "primaryKey": false,
690
- "notNull": true
691
- },
692
- "payload": {
693
- "name": "payload",
694
- "type": "jsonb",
695
- "primaryKey": false,
696
- "notNull": true
697
- },
698
- "occurred_at": {
699
- "name": "occurred_at",
700
- "type": "timestamp with time zone",
701
- "primaryKey": false,
702
- "notNull": true
703
- },
704
- "processed_at": {
705
- "name": "processed_at",
706
- "type": "timestamp with time zone",
707
- "primaryKey": false,
708
- "notNull": false
709
- },
710
- "idempotency_key": {
711
- "name": "idempotency_key",
712
- "type": "text",
713
- "primaryKey": false,
714
- "notNull": false
715
- }
716
- },
717
- "indexes": {
718
- "domain_events_marketplace_idx": {
719
- "name": "domain_events_marketplace_idx",
720
- "columns": [
721
- {
722
- "expression": "marketplace_id",
723
- "isExpression": false,
724
- "asc": true,
725
- "nulls": "last"
726
- }
727
- ],
728
- "isUnique": false,
729
- "concurrently": false,
730
- "method": "btree",
731
- "with": {}
732
- },
733
- "domain_events_processed_idx": {
734
- "name": "domain_events_processed_idx",
735
- "columns": [
736
- {
737
- "expression": "processed_at",
738
- "isExpression": false,
739
- "asc": true,
740
- "nulls": "last"
741
- }
742
- ],
743
- "isUnique": false,
744
- "concurrently": false,
745
- "method": "btree",
746
- "with": {}
747
- },
748
- "domain_events_marketplace_idempotency_uq": {
749
- "name": "domain_events_marketplace_idempotency_uq",
750
- "columns": [
751
- {
752
- "expression": "marketplace_id",
753
- "isExpression": false,
754
- "asc": true,
755
- "nulls": "last"
756
- },
757
- {
758
- "expression": "idempotency_key",
759
- "isExpression": false,
760
- "asc": true,
761
- "nulls": "last"
762
- }
763
- ],
764
- "isUnique": true,
765
- "concurrently": false,
766
- "method": "btree",
767
- "with": {}
768
- }
769
- },
770
- "foreignKeys": {
771
- "domain_events_marketplace_id_marketplaces_id_fk": {
772
- "name": "domain_events_marketplace_id_marketplaces_id_fk",
773
- "tableFrom": "domain_events",
774
- "tableTo": "marketplaces",
775
- "columnsFrom": [
776
- "marketplace_id"
777
- ],
778
- "columnsTo": [
779
- "id"
780
- ],
781
- "onDelete": "cascade",
782
- "onUpdate": "no action"
783
- }
784
- },
785
- "compositePrimaryKeys": {},
786
- "uniqueConstraints": {},
787
- "policies": {},
788
- "checkConstraints": {},
789
- "isRLSEnabled": false
790
- },
791
- "public.flags": {
792
- "name": "flags",
793
- "schema": "",
794
- "columns": {
795
- "id": {
796
- "name": "id",
797
- "type": "text",
798
- "primaryKey": true,
799
- "notNull": true
800
- },
801
- "marketplace_id": {
802
- "name": "marketplace_id",
803
- "type": "text",
804
- "primaryKey": false,
805
- "notNull": true
806
- },
807
- "subject_type": {
808
- "name": "subject_type",
809
- "type": "text",
810
- "primaryKey": false,
811
- "notNull": true
812
- },
813
- "subject_id": {
814
- "name": "subject_id",
815
- "type": "text",
816
- "primaryKey": false,
817
- "notNull": true
818
- },
819
- "reporter_actor_id": {
820
- "name": "reporter_actor_id",
821
- "type": "text",
822
- "primaryKey": false,
823
- "notNull": false
824
- },
825
- "reason": {
826
- "name": "reason",
827
- "type": "text",
828
- "primaryKey": false,
829
- "notNull": false
830
- },
831
- "created_at": {
832
- "name": "created_at",
833
- "type": "timestamp with time zone",
834
- "primaryKey": false,
835
- "notNull": true,
836
- "default": "now()"
837
- }
838
- },
839
- "indexes": {
840
- "flags_marketplace_idx": {
841
- "name": "flags_marketplace_idx",
842
- "columns": [
843
- {
844
- "expression": "marketplace_id",
845
- "isExpression": false,
846
- "asc": true,
847
- "nulls": "last"
848
- }
849
- ],
850
- "isUnique": false,
851
- "concurrently": false,
852
- "method": "btree",
853
- "with": {}
854
- }
855
- },
856
- "foreignKeys": {
857
- "flags_marketplace_id_marketplaces_id_fk": {
858
- "name": "flags_marketplace_id_marketplaces_id_fk",
859
- "tableFrom": "flags",
860
- "tableTo": "marketplaces",
861
- "columnsFrom": [
862
- "marketplace_id"
863
- ],
864
- "columnsTo": [
865
- "id"
866
- ],
867
- "onDelete": "cascade",
868
- "onUpdate": "no action"
869
- },
870
- "flags_reporter_actor_id_actors_id_fk": {
871
- "name": "flags_reporter_actor_id_actors_id_fk",
872
- "tableFrom": "flags",
873
- "tableTo": "actors",
874
- "columnsFrom": [
875
- "reporter_actor_id"
876
- ],
877
- "columnsTo": [
878
- "id"
879
- ],
880
- "onDelete": "set null",
881
- "onUpdate": "no action"
882
- }
883
- },
884
- "compositePrimaryKeys": {},
885
- "uniqueConstraints": {},
886
- "policies": {},
887
- "checkConstraints": {},
888
- "isRLSEnabled": false
889
- },
890
- "public.fulfillments": {
891
- "name": "fulfillments",
892
- "schema": "",
893
- "columns": {
894
- "id": {
895
- "name": "id",
896
- "type": "text",
897
- "primaryKey": true,
898
- "notNull": true
899
- },
900
- "marketplace_id": {
901
- "name": "marketplace_id",
902
- "type": "text",
903
- "primaryKey": false,
904
- "notNull": true
905
- },
906
- "order_id": {
907
- "name": "order_id",
908
- "type": "text",
909
- "primaryKey": false,
910
- "notNull": true
911
- },
912
- "status": {
913
- "name": "status",
914
- "type": "text",
915
- "primaryKey": false,
916
- "notNull": true,
917
- "default": "'pending'"
918
- },
919
- "result": {
920
- "name": "result",
921
- "type": "jsonb",
922
- "primaryKey": false,
923
- "notNull": false
924
- },
925
- "confirmed_at": {
926
- "name": "confirmed_at",
927
- "type": "timestamp with time zone",
928
- "primaryKey": false,
929
- "notNull": false
930
- },
931
- "created_at": {
932
- "name": "created_at",
933
- "type": "timestamp with time zone",
934
- "primaryKey": false,
935
- "notNull": true,
936
- "default": "now()"
937
- },
938
- "updated_at": {
939
- "name": "updated_at",
940
- "type": "timestamp with time zone",
941
- "primaryKey": false,
942
- "notNull": true,
943
- "default": "now()"
944
- }
945
- },
946
- "indexes": {
947
- "fulfillments_order_uq": {
948
- "name": "fulfillments_order_uq",
949
- "columns": [
950
- {
951
- "expression": "order_id",
952
- "isExpression": false,
953
- "asc": true,
954
- "nulls": "last"
955
- }
956
- ],
957
- "isUnique": true,
958
- "concurrently": false,
959
- "method": "btree",
960
- "with": {}
961
- }
962
- },
963
- "foreignKeys": {
964
- "fulfillments_marketplace_id_marketplaces_id_fk": {
965
- "name": "fulfillments_marketplace_id_marketplaces_id_fk",
966
- "tableFrom": "fulfillments",
967
- "tableTo": "marketplaces",
968
- "columnsFrom": [
969
- "marketplace_id"
970
- ],
971
- "columnsTo": [
972
- "id"
973
- ],
974
- "onDelete": "cascade",
975
- "onUpdate": "no action"
976
- },
977
- "fulfillments_order_id_orders_id_fk": {
978
- "name": "fulfillments_order_id_orders_id_fk",
979
- "tableFrom": "fulfillments",
980
- "tableTo": "orders",
981
- "columnsFrom": [
982
- "order_id"
983
- ],
984
- "columnsTo": [
985
- "id"
986
- ],
987
- "onDelete": "cascade",
988
- "onUpdate": "no action"
989
- }
990
- },
991
- "compositePrimaryKeys": {},
992
- "uniqueConstraints": {},
993
- "policies": {},
994
- "checkConstraints": {},
995
- "isRLSEnabled": false
996
- },
997
- "public.integrations": {
998
- "name": "integrations",
999
- "schema": "",
1000
- "columns": {
1001
- "id": {
1002
- "name": "id",
1003
- "type": "text",
1004
- "primaryKey": true,
1005
- "notNull": true
1006
- },
1007
- "marketplace_id": {
1008
- "name": "marketplace_id",
1009
- "type": "text",
1010
- "primaryKey": false,
1011
- "notNull": true
1012
- },
1013
- "provider": {
1014
- "name": "provider",
1015
- "type": "text",
1016
- "primaryKey": false,
1017
- "notNull": true
1018
- },
1019
- "config": {
1020
- "name": "config",
1021
- "type": "jsonb",
1022
- "primaryKey": false,
1023
- "notNull": true
1024
- },
1025
- "created_at": {
1026
- "name": "created_at",
1027
- "type": "timestamp with time zone",
1028
- "primaryKey": false,
1029
- "notNull": true,
1030
- "default": "now()"
1031
- },
1032
- "updated_at": {
1033
- "name": "updated_at",
1034
- "type": "timestamp with time zone",
1035
- "primaryKey": false,
1036
- "notNull": true,
1037
- "default": "now()"
1038
- }
1039
- },
1040
- "indexes": {
1041
- "integrations_marketplace_provider_uq": {
1042
- "name": "integrations_marketplace_provider_uq",
1043
- "columns": [
1044
- {
1045
- "expression": "marketplace_id",
1046
- "isExpression": false,
1047
- "asc": true,
1048
- "nulls": "last"
1049
- },
1050
- {
1051
- "expression": "provider",
1052
- "isExpression": false,
1053
- "asc": true,
1054
- "nulls": "last"
1055
- }
1056
- ],
1057
- "isUnique": true,
1058
- "concurrently": false,
1059
- "method": "btree",
1060
- "with": {}
1061
- }
1062
- },
1063
- "foreignKeys": {
1064
- "integrations_marketplace_id_marketplaces_id_fk": {
1065
- "name": "integrations_marketplace_id_marketplaces_id_fk",
1066
- "tableFrom": "integrations",
1067
- "tableTo": "marketplaces",
1068
- "columnsFrom": [
1069
- "marketplace_id"
1070
- ],
1071
- "columnsTo": [
1072
- "id"
1073
- ],
1074
- "onDelete": "cascade",
1075
- "onUpdate": "no action"
1076
- }
1077
- },
1078
- "compositePrimaryKeys": {},
1079
- "uniqueConstraints": {},
1080
- "policies": {},
1081
- "checkConstraints": {},
1082
- "isRLSEnabled": false
1083
- },
1084
- "public.ledger_entries": {
1085
- "name": "ledger_entries",
1086
- "schema": "",
1087
- "columns": {
1088
- "id": {
1089
- "name": "id",
1090
- "type": "text",
1091
- "primaryKey": true,
1092
- "notNull": true
1093
- },
1094
- "marketplace_id": {
1095
- "name": "marketplace_id",
1096
- "type": "text",
1097
- "primaryKey": false,
1098
- "notNull": true
1099
- },
1100
- "order_id": {
1101
- "name": "order_id",
1102
- "type": "text",
1103
- "primaryKey": false,
1104
- "notNull": false
1105
- },
1106
- "settlement_id": {
1107
- "name": "settlement_id",
1108
- "type": "text",
1109
- "primaryKey": false,
1110
- "notNull": false
1111
- },
1112
- "kind": {
1113
- "name": "kind",
1114
- "type": "text",
1115
- "primaryKey": false,
1116
- "notNull": true
1117
- },
1118
- "amount_minor": {
1119
- "name": "amount_minor",
1120
- "type": "integer",
1121
- "primaryKey": false,
1122
- "notNull": true
1123
- },
1124
- "currency": {
1125
- "name": "currency",
1126
- "type": "text",
1127
- "primaryKey": false,
1128
- "notNull": true
1129
- },
1130
- "memo": {
1131
- "name": "memo",
1132
- "type": "text",
1133
- "primaryKey": false,
1134
- "notNull": false
1135
- },
1136
- "metadata": {
1137
- "name": "metadata",
1138
- "type": "jsonb",
1139
- "primaryKey": false,
1140
- "notNull": false
1141
- },
1142
- "created_at": {
1143
- "name": "created_at",
1144
- "type": "timestamp with time zone",
1145
- "primaryKey": false,
1146
- "notNull": true,
1147
- "default": "now()"
1148
- }
1149
- },
1150
- "indexes": {
1151
- "ledger_entries_marketplace_idx": {
1152
- "name": "ledger_entries_marketplace_idx",
1153
- "columns": [
1154
- {
1155
- "expression": "marketplace_id",
1156
- "isExpression": false,
1157
- "asc": true,
1158
- "nulls": "last"
1159
- }
1160
- ],
1161
- "isUnique": false,
1162
- "concurrently": false,
1163
- "method": "btree",
1164
- "with": {}
1165
- }
1166
- },
1167
- "foreignKeys": {
1168
- "ledger_entries_marketplace_id_marketplaces_id_fk": {
1169
- "name": "ledger_entries_marketplace_id_marketplaces_id_fk",
1170
- "tableFrom": "ledger_entries",
1171
- "tableTo": "marketplaces",
1172
- "columnsFrom": [
1173
- "marketplace_id"
1174
- ],
1175
- "columnsTo": [
1176
- "id"
1177
- ],
1178
- "onDelete": "cascade",
1179
- "onUpdate": "no action"
1180
- },
1181
- "ledger_entries_order_id_orders_id_fk": {
1182
- "name": "ledger_entries_order_id_orders_id_fk",
1183
- "tableFrom": "ledger_entries",
1184
- "tableTo": "orders",
1185
- "columnsFrom": [
1186
- "order_id"
1187
- ],
1188
- "columnsTo": [
1189
- "id"
1190
- ],
1191
- "onDelete": "set null",
1192
- "onUpdate": "no action"
1193
- },
1194
- "ledger_entries_settlement_id_settlements_id_fk": {
1195
- "name": "ledger_entries_settlement_id_settlements_id_fk",
1196
- "tableFrom": "ledger_entries",
1197
- "tableTo": "settlements",
1198
- "columnsFrom": [
1199
- "settlement_id"
1200
- ],
1201
- "columnsTo": [
1202
- "id"
1203
- ],
1204
- "onDelete": "set null",
1205
- "onUpdate": "no action"
1206
- }
1207
- },
1208
- "compositePrimaryKeys": {},
1209
- "uniqueConstraints": {},
1210
- "policies": {},
1211
- "checkConstraints": {},
1212
- "isRLSEnabled": false
1213
- },
1214
- "public.listing_assets": {
1215
- "name": "listing_assets",
1216
- "schema": "",
1217
- "columns": {
1218
- "id": {
1219
- "name": "id",
1220
- "type": "text",
1221
- "primaryKey": true,
1222
- "notNull": true
1223
- },
1224
- "listing_version_id": {
1225
- "name": "listing_version_id",
1226
- "type": "text",
1227
- "primaryKey": false,
1228
- "notNull": true
1229
- },
1230
- "url": {
1231
- "name": "url",
1232
- "type": "text",
1233
- "primaryKey": false,
1234
- "notNull": true
1235
- },
1236
- "kind": {
1237
- "name": "kind",
1238
- "type": "text",
1239
- "primaryKey": false,
1240
- "notNull": true
1241
- },
1242
- "metadata": {
1243
- "name": "metadata",
1244
- "type": "jsonb",
1245
- "primaryKey": false,
1246
- "notNull": false
1247
- }
1248
- },
1249
- "indexes": {
1250
- "listing_assets_version_idx": {
1251
- "name": "listing_assets_version_idx",
1252
- "columns": [
1253
- {
1254
- "expression": "listing_version_id",
1255
- "isExpression": false,
1256
- "asc": true,
1257
- "nulls": "last"
1258
- }
1259
- ],
1260
- "isUnique": false,
1261
- "concurrently": false,
1262
- "method": "btree",
1263
- "with": {}
1264
- }
1265
- },
1266
- "foreignKeys": {
1267
- "listing_assets_listing_version_id_listing_versions_id_fk": {
1268
- "name": "listing_assets_listing_version_id_listing_versions_id_fk",
1269
- "tableFrom": "listing_assets",
1270
- "tableTo": "listing_versions",
1271
- "columnsFrom": [
1272
- "listing_version_id"
1273
- ],
1274
- "columnsTo": [
1275
- "id"
1276
- ],
1277
- "onDelete": "cascade",
1278
- "onUpdate": "no action"
1279
- }
1280
- },
1281
- "compositePrimaryKeys": {},
1282
- "uniqueConstraints": {},
1283
- "policies": {},
1284
- "checkConstraints": {},
1285
- "isRLSEnabled": false
1286
- },
1287
- "public.listing_types": {
1288
- "name": "listing_types",
1289
- "schema": "",
1290
- "columns": {
1291
- "id": {
1292
- "name": "id",
1293
- "type": "text",
1294
- "primaryKey": true,
1295
- "notNull": true
1296
- },
1297
- "marketplace_id": {
1298
- "name": "marketplace_id",
1299
- "type": "text",
1300
- "primaryKey": false,
1301
- "notNull": true
1302
- },
1303
- "slug": {
1304
- "name": "slug",
1305
- "type": "text",
1306
- "primaryKey": false,
1307
- "notNull": true
1308
- },
1309
- "name": {
1310
- "name": "name",
1311
- "type": "text",
1312
- "primaryKey": false,
1313
- "notNull": true
1314
- },
1315
- "schema": {
1316
- "name": "schema",
1317
- "type": "jsonb",
1318
- "primaryKey": false,
1319
- "notNull": false
1320
- },
1321
- "created_at": {
1322
- "name": "created_at",
1323
- "type": "timestamp with time zone",
1324
- "primaryKey": false,
1325
- "notNull": true,
1326
- "default": "now()"
1327
- }
1328
- },
1329
- "indexes": {
1330
- "listing_types_marketplace_slug_uq": {
1331
- "name": "listing_types_marketplace_slug_uq",
1332
- "columns": [
1333
- {
1334
- "expression": "marketplace_id",
1335
- "isExpression": false,
1336
- "asc": true,
1337
- "nulls": "last"
1338
- },
1339
- {
1340
- "expression": "slug",
1341
- "isExpression": false,
1342
- "asc": true,
1343
- "nulls": "last"
1344
- }
1345
- ],
1346
- "isUnique": true,
1347
- "concurrently": false,
1348
- "method": "btree",
1349
- "with": {}
1350
- }
1351
- },
1352
- "foreignKeys": {
1353
- "listing_types_marketplace_id_marketplaces_id_fk": {
1354
- "name": "listing_types_marketplace_id_marketplaces_id_fk",
1355
- "tableFrom": "listing_types",
1356
- "tableTo": "marketplaces",
1357
- "columnsFrom": [
1358
- "marketplace_id"
1359
- ],
1360
- "columnsTo": [
1361
- "id"
1362
- ],
1363
- "onDelete": "cascade",
1364
- "onUpdate": "no action"
1365
- }
1366
- },
1367
- "compositePrimaryKeys": {},
1368
- "uniqueConstraints": {},
1369
- "policies": {},
1370
- "checkConstraints": {},
1371
- "isRLSEnabled": false
1372
- },
1373
- "public.listing_versions": {
1374
- "name": "listing_versions",
1375
- "schema": "",
1376
- "columns": {
1377
- "id": {
1378
- "name": "id",
1379
- "type": "text",
1380
- "primaryKey": true,
1381
- "notNull": true
1382
- },
1383
- "listing_id": {
1384
- "name": "listing_id",
1385
- "type": "text",
1386
- "primaryKey": false,
1387
- "notNull": true
1388
- },
1389
- "version": {
1390
- "name": "version",
1391
- "type": "integer",
1392
- "primaryKey": false,
1393
- "notNull": true
1394
- },
1395
- "title": {
1396
- "name": "title",
1397
- "type": "text",
1398
- "primaryKey": false,
1399
- "notNull": true
1400
- },
1401
- "description": {
1402
- "name": "description",
1403
- "type": "text",
1404
- "primaryKey": false,
1405
- "notNull": false
1406
- },
1407
- "price_amount_minor": {
1408
- "name": "price_amount_minor",
1409
- "type": "integer",
1410
- "primaryKey": false,
1411
- "notNull": false
1412
- },
1413
- "price_currency": {
1414
- "name": "price_currency",
1415
- "type": "text",
1416
- "primaryKey": false,
1417
- "notNull": false
1418
- },
1419
- "payout_destination": {
1420
- "name": "payout_destination",
1421
- "type": "jsonb",
1422
- "primaryKey": false,
1423
- "notNull": false
1424
- },
1425
- "metadata": {
1426
- "name": "metadata",
1427
- "type": "jsonb",
1428
- "primaryKey": false,
1429
- "notNull": false
1430
- },
1431
- "created_at": {
1432
- "name": "created_at",
1433
- "type": "timestamp with time zone",
1434
- "primaryKey": false,
1435
- "notNull": true,
1436
- "default": "now()"
1437
- }
1438
- },
1439
- "indexes": {
1440
- "listing_versions_listing_version_uq": {
1441
- "name": "listing_versions_listing_version_uq",
1442
- "columns": [
1443
- {
1444
- "expression": "listing_id",
1445
- "isExpression": false,
1446
- "asc": true,
1447
- "nulls": "last"
1448
- },
1449
- {
1450
- "expression": "version",
1451
- "isExpression": false,
1452
- "asc": true,
1453
- "nulls": "last"
1454
- }
1455
- ],
1456
- "isUnique": true,
1457
- "concurrently": false,
1458
- "method": "btree",
1459
- "with": {}
1460
- }
1461
- },
1462
- "foreignKeys": {
1463
- "listing_versions_listing_id_listings_id_fk": {
1464
- "name": "listing_versions_listing_id_listings_id_fk",
1465
- "tableFrom": "listing_versions",
1466
- "tableTo": "listings",
1467
- "columnsFrom": [
1468
- "listing_id"
1469
- ],
1470
- "columnsTo": [
1471
- "id"
1472
- ],
1473
- "onDelete": "cascade",
1474
- "onUpdate": "no action"
1475
- }
1476
- },
1477
- "compositePrimaryKeys": {},
1478
- "uniqueConstraints": {},
1479
- "policies": {},
1480
- "checkConstraints": {},
1481
- "isRLSEnabled": false
1482
- },
1483
- "public.listings": {
1484
- "name": "listings",
1485
- "schema": "",
1486
- "columns": {
1487
- "id": {
1488
- "name": "id",
1489
- "type": "text",
1490
- "primaryKey": true,
1491
- "notNull": true
1492
- },
1493
- "marketplace_id": {
1494
- "name": "marketplace_id",
1495
- "type": "text",
1496
- "primaryKey": false,
1497
- "notNull": true
1498
- },
1499
- "actor_id": {
1500
- "name": "actor_id",
1501
- "type": "text",
1502
- "primaryKey": false,
1503
- "notNull": true
1504
- },
1505
- "listing_type_id": {
1506
- "name": "listing_type_id",
1507
- "type": "text",
1508
- "primaryKey": false,
1509
- "notNull": true
1510
- },
1511
- "current_version_id": {
1512
- "name": "current_version_id",
1513
- "type": "text",
1514
- "primaryKey": false,
1515
- "notNull": false
1516
- },
1517
- "status": {
1518
- "name": "status",
1519
- "type": "text",
1520
- "primaryKey": false,
1521
- "notNull": true,
1522
- "default": "'draft'"
1523
- },
1524
- "created_at": {
1525
- "name": "created_at",
1526
- "type": "timestamp with time zone",
1527
- "primaryKey": false,
1528
- "notNull": true,
1529
- "default": "now()"
1530
- },
1531
- "updated_at": {
1532
- "name": "updated_at",
1533
- "type": "timestamp with time zone",
1534
- "primaryKey": false,
1535
- "notNull": true,
1536
- "default": "now()"
1537
- }
1538
- },
1539
- "indexes": {
1540
- "listings_marketplace_idx": {
1541
- "name": "listings_marketplace_idx",
1542
- "columns": [
1543
- {
1544
- "expression": "marketplace_id",
1545
- "isExpression": false,
1546
- "asc": true,
1547
- "nulls": "last"
1548
- }
1549
- ],
1550
- "isUnique": false,
1551
- "concurrently": false,
1552
- "method": "btree",
1553
- "with": {}
1554
- }
1555
- },
1556
- "foreignKeys": {
1557
- "listings_marketplace_id_marketplaces_id_fk": {
1558
- "name": "listings_marketplace_id_marketplaces_id_fk",
1559
- "tableFrom": "listings",
1560
- "tableTo": "marketplaces",
1561
- "columnsFrom": [
1562
- "marketplace_id"
1563
- ],
1564
- "columnsTo": [
1565
- "id"
1566
- ],
1567
- "onDelete": "cascade",
1568
- "onUpdate": "no action"
1569
- },
1570
- "listings_actor_id_actors_id_fk": {
1571
- "name": "listings_actor_id_actors_id_fk",
1572
- "tableFrom": "listings",
1573
- "tableTo": "actors",
1574
- "columnsFrom": [
1575
- "actor_id"
1576
- ],
1577
- "columnsTo": [
1578
- "id"
1579
- ],
1580
- "onDelete": "cascade",
1581
- "onUpdate": "no action"
1582
- },
1583
- "listings_listing_type_id_listing_types_id_fk": {
1584
- "name": "listings_listing_type_id_listing_types_id_fk",
1585
- "tableFrom": "listings",
1586
- "tableTo": "listing_types",
1587
- "columnsFrom": [
1588
- "listing_type_id"
1589
- ],
1590
- "columnsTo": [
1591
- "id"
1592
- ],
1593
- "onDelete": "restrict",
1594
- "onUpdate": "no action"
1595
- }
1596
- },
1597
- "compositePrimaryKeys": {},
1598
- "uniqueConstraints": {},
1599
- "policies": {},
1600
- "checkConstraints": {},
1601
- "isRLSEnabled": false
1602
- },
1603
- "public.marketplaces": {
1604
- "name": "marketplaces",
1605
- "schema": "",
1606
- "columns": {
1607
- "id": {
1608
- "name": "id",
1609
- "type": "text",
1610
- "primaryKey": true,
1611
- "notNull": true
1612
- },
1613
- "name": {
1614
- "name": "name",
1615
- "type": "text",
1616
- "primaryKey": false,
1617
- "notNull": true
1618
- },
1619
- "slug": {
1620
- "name": "slug",
1621
- "type": "text",
1622
- "primaryKey": false,
1623
- "notNull": true
1624
- },
1625
- "owner_id": {
1626
- "name": "owner_id",
1627
- "type": "text",
1628
- "primaryKey": false,
1629
- "notNull": false
1630
- },
1631
- "created_at": {
1632
- "name": "created_at",
1633
- "type": "timestamp with time zone",
1634
- "primaryKey": false,
1635
- "notNull": true,
1636
- "default": "now()"
1637
- },
1638
- "updated_at": {
1639
- "name": "updated_at",
1640
- "type": "timestamp with time zone",
1641
- "primaryKey": false,
1642
- "notNull": true,
1643
- "default": "now()"
1644
- }
1645
- },
1646
- "indexes": {
1647
- "marketplaces_slug_uq": {
1648
- "name": "marketplaces_slug_uq",
1649
- "columns": [
1650
- {
1651
- "expression": "slug",
1652
- "isExpression": false,
1653
- "asc": true,
1654
- "nulls": "last"
1655
- }
1656
- ],
1657
- "isUnique": true,
1658
- "concurrently": false,
1659
- "method": "btree",
1660
- "with": {}
1661
- }
1662
- },
1663
- "foreignKeys": {
1664
- "marketplaces_owner_id_admin_users_id_fk": {
1665
- "name": "marketplaces_owner_id_admin_users_id_fk",
1666
- "tableFrom": "marketplaces",
1667
- "tableTo": "admin_users",
1668
- "columnsFrom": [
1669
- "owner_id"
1670
- ],
1671
- "columnsTo": [
1672
- "id"
1673
- ],
1674
- "onDelete": "set null",
1675
- "onUpdate": "no action"
1676
- }
1677
- },
1678
- "compositePrimaryKeys": {},
1679
- "uniqueConstraints": {},
1680
- "policies": {},
1681
- "checkConstraints": {},
1682
- "isRLSEnabled": false
1683
- },
1684
- "public.moderation_cases": {
1685
- "name": "moderation_cases",
1686
- "schema": "",
1687
- "columns": {
1688
- "id": {
1689
- "name": "id",
1690
- "type": "text",
1691
- "primaryKey": true,
1692
- "notNull": true
1693
- },
1694
- "marketplace_id": {
1695
- "name": "marketplace_id",
1696
- "type": "text",
1697
- "primaryKey": false,
1698
- "notNull": true
1699
- },
1700
- "subject_type": {
1701
- "name": "subject_type",
1702
- "type": "text",
1703
- "primaryKey": false,
1704
- "notNull": true
1705
- },
1706
- "subject_id": {
1707
- "name": "subject_id",
1708
- "type": "text",
1709
- "primaryKey": false,
1710
- "notNull": true
1711
- },
1712
- "status": {
1713
- "name": "status",
1714
- "type": "text",
1715
- "primaryKey": false,
1716
- "notNull": true,
1717
- "default": "'open'"
1718
- },
1719
- "notes": {
1720
- "name": "notes",
1721
- "type": "text",
1722
- "primaryKey": false,
1723
- "notNull": false
1724
- },
1725
- "created_at": {
1726
- "name": "created_at",
1727
- "type": "timestamp with time zone",
1728
- "primaryKey": false,
1729
- "notNull": true,
1730
- "default": "now()"
1731
- },
1732
- "updated_at": {
1733
- "name": "updated_at",
1734
- "type": "timestamp with time zone",
1735
- "primaryKey": false,
1736
- "notNull": true,
1737
- "default": "now()"
1738
- }
1739
- },
1740
- "indexes": {
1741
- "moderation_cases_marketplace_idx": {
1742
- "name": "moderation_cases_marketplace_idx",
1743
- "columns": [
1744
- {
1745
- "expression": "marketplace_id",
1746
- "isExpression": false,
1747
- "asc": true,
1748
- "nulls": "last"
1749
- }
1750
- ],
1751
- "isUnique": false,
1752
- "concurrently": false,
1753
- "method": "btree",
1754
- "with": {}
1755
- }
1756
- },
1757
- "foreignKeys": {
1758
- "moderation_cases_marketplace_id_marketplaces_id_fk": {
1759
- "name": "moderation_cases_marketplace_id_marketplaces_id_fk",
1760
- "tableFrom": "moderation_cases",
1761
- "tableTo": "marketplaces",
1762
- "columnsFrom": [
1763
- "marketplace_id"
1764
- ],
1765
- "columnsTo": [
1766
- "id"
1767
- ],
1768
- "onDelete": "cascade",
1769
- "onUpdate": "no action"
1770
- }
1771
- },
1772
- "compositePrimaryKeys": {},
1773
- "uniqueConstraints": {},
1774
- "policies": {},
1775
- "checkConstraints": {},
1776
- "isRLSEnabled": false
1777
- },
1778
- "public.offers": {
1779
- "name": "offers",
1780
- "schema": "",
1781
- "columns": {
1782
- "id": {
1783
- "name": "id",
1784
- "type": "text",
1785
- "primaryKey": true,
1786
- "notNull": true
1787
- },
1788
- "marketplace_id": {
1789
- "name": "marketplace_id",
1790
- "type": "text",
1791
- "primaryKey": false,
1792
- "notNull": true
1793
- },
1794
- "listing_id": {
1795
- "name": "listing_id",
1796
- "type": "text",
1797
- "primaryKey": false,
1798
- "notNull": true
1799
- },
1800
- "buyer_actor_id": {
1801
- "name": "buyer_actor_id",
1802
- "type": "text",
1803
- "primaryKey": false,
1804
- "notNull": true
1805
- },
1806
- "status": {
1807
- "name": "status",
1808
- "type": "text",
1809
- "primaryKey": false,
1810
- "notNull": true,
1811
- "default": "'open'"
1812
- },
1813
- "proposed_price_amount_minor": {
1814
- "name": "proposed_price_amount_minor",
1815
- "type": "integer",
1816
- "primaryKey": false,
1817
- "notNull": false
1818
- },
1819
- "proposed_price_currency": {
1820
- "name": "proposed_price_currency",
1821
- "type": "text",
1822
- "primaryKey": false,
1823
- "notNull": false
1824
- },
1825
- "metadata": {
1826
- "name": "metadata",
1827
- "type": "jsonb",
1828
- "primaryKey": false,
1829
- "notNull": false
1830
- },
1831
- "created_at": {
1832
- "name": "created_at",
1833
- "type": "timestamp with time zone",
1834
- "primaryKey": false,
1835
- "notNull": true,
1836
- "default": "now()"
1837
- },
1838
- "updated_at": {
1839
- "name": "updated_at",
1840
- "type": "timestamp with time zone",
1841
- "primaryKey": false,
1842
- "notNull": true,
1843
- "default": "now()"
1844
- }
1845
- },
1846
- "indexes": {
1847
- "offers_marketplace_idx": {
1848
- "name": "offers_marketplace_idx",
1849
- "columns": [
1850
- {
1851
- "expression": "marketplace_id",
1852
- "isExpression": false,
1853
- "asc": true,
1854
- "nulls": "last"
1855
- }
1856
- ],
1857
- "isUnique": false,
1858
- "concurrently": false,
1859
- "method": "btree",
1860
- "with": {}
1861
- }
1862
- },
1863
- "foreignKeys": {
1864
- "offers_marketplace_id_marketplaces_id_fk": {
1865
- "name": "offers_marketplace_id_marketplaces_id_fk",
1866
- "tableFrom": "offers",
1867
- "tableTo": "marketplaces",
1868
- "columnsFrom": [
1869
- "marketplace_id"
1870
- ],
1871
- "columnsTo": [
1872
- "id"
1873
- ],
1874
- "onDelete": "cascade",
1875
- "onUpdate": "no action"
1876
- },
1877
- "offers_listing_id_listings_id_fk": {
1878
- "name": "offers_listing_id_listings_id_fk",
1879
- "tableFrom": "offers",
1880
- "tableTo": "listings",
1881
- "columnsFrom": [
1882
- "listing_id"
1883
- ],
1884
- "columnsTo": [
1885
- "id"
1886
- ],
1887
- "onDelete": "cascade",
1888
- "onUpdate": "no action"
1889
- },
1890
- "offers_buyer_actor_id_actors_id_fk": {
1891
- "name": "offers_buyer_actor_id_actors_id_fk",
1892
- "tableFrom": "offers",
1893
- "tableTo": "actors",
1894
- "columnsFrom": [
1895
- "buyer_actor_id"
1896
- ],
1897
- "columnsTo": [
1898
- "id"
1899
- ],
1900
- "onDelete": "cascade",
1901
- "onUpdate": "no action"
1902
- }
1903
- },
1904
- "compositePrimaryKeys": {},
1905
- "uniqueConstraints": {},
1906
- "policies": {},
1907
- "checkConstraints": {},
1908
- "isRLSEnabled": false
1909
- },
1910
- "public.order_items": {
1911
- "name": "order_items",
1912
- "schema": "",
1913
- "columns": {
1914
- "id": {
1915
- "name": "id",
1916
- "type": "text",
1917
- "primaryKey": true,
1918
- "notNull": true
1919
- },
1920
- "order_id": {
1921
- "name": "order_id",
1922
- "type": "text",
1923
- "primaryKey": false,
1924
- "notNull": true
1925
- },
1926
- "listing_version_id": {
1927
- "name": "listing_version_id",
1928
- "type": "text",
1929
- "primaryKey": false,
1930
- "notNull": true
1931
- },
1932
- "quantity": {
1933
- "name": "quantity",
1934
- "type": "integer",
1935
- "primaryKey": false,
1936
- "notNull": true,
1937
- "default": 1
1938
- },
1939
- "unit_amount_minor": {
1940
- "name": "unit_amount_minor",
1941
- "type": "integer",
1942
- "primaryKey": false,
1943
- "notNull": true
1944
- },
1945
- "unit_currency": {
1946
- "name": "unit_currency",
1947
- "type": "text",
1948
- "primaryKey": false,
1949
- "notNull": true
1950
- },
1951
- "metadata": {
1952
- "name": "metadata",
1953
- "type": "jsonb",
1954
- "primaryKey": false,
1955
- "notNull": false
1956
- }
1957
- },
1958
- "indexes": {
1959
- "order_items_order_idx": {
1960
- "name": "order_items_order_idx",
1961
- "columns": [
1962
- {
1963
- "expression": "order_id",
1964
- "isExpression": false,
1965
- "asc": true,
1966
- "nulls": "last"
1967
- }
1968
- ],
1969
- "isUnique": false,
1970
- "concurrently": false,
1971
- "method": "btree",
1972
- "with": {}
1973
- }
1974
- },
1975
- "foreignKeys": {
1976
- "order_items_order_id_orders_id_fk": {
1977
- "name": "order_items_order_id_orders_id_fk",
1978
- "tableFrom": "order_items",
1979
- "tableTo": "orders",
1980
- "columnsFrom": [
1981
- "order_id"
1982
- ],
1983
- "columnsTo": [
1984
- "id"
1985
- ],
1986
- "onDelete": "cascade",
1987
- "onUpdate": "no action"
1988
- },
1989
- "order_items_listing_version_id_listing_versions_id_fk": {
1990
- "name": "order_items_listing_version_id_listing_versions_id_fk",
1991
- "tableFrom": "order_items",
1992
- "tableTo": "listing_versions",
1993
- "columnsFrom": [
1994
- "listing_version_id"
1995
- ],
1996
- "columnsTo": [
1997
- "id"
1998
- ],
1999
- "onDelete": "restrict",
2000
- "onUpdate": "no action"
2001
- }
2002
- },
2003
- "compositePrimaryKeys": {},
2004
- "uniqueConstraints": {},
2005
- "policies": {},
2006
- "checkConstraints": {},
2007
- "isRLSEnabled": false
2008
- },
2009
- "public.orders": {
2010
- "name": "orders",
2011
- "schema": "",
2012
- "columns": {
2013
- "id": {
2014
- "name": "id",
2015
- "type": "text",
2016
- "primaryKey": true,
2017
- "notNull": true
2018
- },
2019
- "qtx_id": {
2020
- "name": "qtx_id",
2021
- "type": "text",
2022
- "primaryKey": false,
2023
- "notNull": true
2024
- },
2025
- "marketplace_id": {
2026
- "name": "marketplace_id",
2027
- "type": "text",
2028
- "primaryKey": false,
2029
- "notNull": true
2030
- },
2031
- "buyer_actor_id": {
2032
- "name": "buyer_actor_id",
2033
- "type": "text",
2034
- "primaryKey": false,
2035
- "notNull": true
2036
- },
2037
- "seller_actor_id": {
2038
- "name": "seller_actor_id",
2039
- "type": "text",
2040
- "primaryKey": false,
2041
- "notNull": true
2042
- },
2043
- "listing_id": {
2044
- "name": "listing_id",
2045
- "type": "text",
2046
- "primaryKey": false,
2047
- "notNull": true
2048
- },
2049
- "offer_id": {
2050
- "name": "offer_id",
2051
- "type": "text",
2052
- "primaryKey": false,
2053
- "notNull": false
2054
- },
2055
- "status": {
2056
- "name": "status",
2057
- "type": "text",
2058
- "primaryKey": false,
2059
- "notNull": true,
2060
- "default": "'created'"
2061
- },
2062
- "total_amount_minor": {
2063
- "name": "total_amount_minor",
2064
- "type": "integer",
2065
- "primaryKey": false,
2066
- "notNull": true
2067
- },
2068
- "total_currency": {
2069
- "name": "total_currency",
2070
- "type": "text",
2071
- "primaryKey": false,
2072
- "notNull": true
2073
- },
2074
- "metadata": {
2075
- "name": "metadata",
2076
- "type": "jsonb",
2077
- "primaryKey": false,
2078
- "notNull": false
2079
- },
2080
- "created_at": {
2081
- "name": "created_at",
2082
- "type": "timestamp with time zone",
2083
- "primaryKey": false,
2084
- "notNull": true,
2085
- "default": "now()"
2086
- },
2087
- "updated_at": {
2088
- "name": "updated_at",
2089
- "type": "timestamp with time zone",
2090
- "primaryKey": false,
2091
- "notNull": true,
2092
- "default": "now()"
2093
- }
2094
- },
2095
- "indexes": {
2096
- "orders_marketplace_idx": {
2097
- "name": "orders_marketplace_idx",
2098
- "columns": [
2099
- {
2100
- "expression": "marketplace_id",
2101
- "isExpression": false,
2102
- "asc": true,
2103
- "nulls": "last"
2104
- }
2105
- ],
2106
- "isUnique": false,
2107
- "concurrently": false,
2108
- "method": "btree",
2109
- "with": {}
2110
- },
2111
- "orders_qtx_uq": {
2112
- "name": "orders_qtx_uq",
2113
- "columns": [
2114
- {
2115
- "expression": "qtx_id",
2116
- "isExpression": false,
2117
- "asc": true,
2118
- "nulls": "last"
2119
- }
2120
- ],
2121
- "isUnique": true,
2122
- "concurrently": false,
2123
- "method": "btree",
2124
- "with": {}
2125
- }
2126
- },
2127
- "foreignKeys": {
2128
- "orders_marketplace_id_marketplaces_id_fk": {
2129
- "name": "orders_marketplace_id_marketplaces_id_fk",
2130
- "tableFrom": "orders",
2131
- "tableTo": "marketplaces",
2132
- "columnsFrom": [
2133
- "marketplace_id"
2134
- ],
2135
- "columnsTo": [
2136
- "id"
2137
- ],
2138
- "onDelete": "cascade",
2139
- "onUpdate": "no action"
2140
- },
2141
- "orders_buyer_actor_id_actors_id_fk": {
2142
- "name": "orders_buyer_actor_id_actors_id_fk",
2143
- "tableFrom": "orders",
2144
- "tableTo": "actors",
2145
- "columnsFrom": [
2146
- "buyer_actor_id"
2147
- ],
2148
- "columnsTo": [
2149
- "id"
2150
- ],
2151
- "onDelete": "cascade",
2152
- "onUpdate": "no action"
2153
- },
2154
- "orders_seller_actor_id_actors_id_fk": {
2155
- "name": "orders_seller_actor_id_actors_id_fk",
2156
- "tableFrom": "orders",
2157
- "tableTo": "actors",
2158
- "columnsFrom": [
2159
- "seller_actor_id"
2160
- ],
2161
- "columnsTo": [
2162
- "id"
2163
- ],
2164
- "onDelete": "cascade",
2165
- "onUpdate": "no action"
2166
- },
2167
- "orders_listing_id_listings_id_fk": {
2168
- "name": "orders_listing_id_listings_id_fk",
2169
- "tableFrom": "orders",
2170
- "tableTo": "listings",
2171
- "columnsFrom": [
2172
- "listing_id"
2173
- ],
2174
- "columnsTo": [
2175
- "id"
2176
- ],
2177
- "onDelete": "restrict",
2178
- "onUpdate": "no action"
2179
- },
2180
- "orders_offer_id_offers_id_fk": {
2181
- "name": "orders_offer_id_offers_id_fk",
2182
- "tableFrom": "orders",
2183
- "tableTo": "offers",
2184
- "columnsFrom": [
2185
- "offer_id"
2186
- ],
2187
- "columnsTo": [
2188
- "id"
2189
- ],
2190
- "onDelete": "set null",
2191
- "onUpdate": "no action"
2192
- }
2193
- },
2194
- "compositePrimaryKeys": {},
2195
- "uniqueConstraints": {},
2196
- "policies": {},
2197
- "checkConstraints": {},
2198
- "isRLSEnabled": false
2199
- },
2200
- "public.payment_challenges": {
2201
- "name": "payment_challenges",
2202
- "schema": "",
2203
- "columns": {
2204
- "id": {
2205
- "name": "id",
2206
- "type": "text",
2207
- "primaryKey": true,
2208
- "notNull": true
2209
- },
2210
- "marketplace_id": {
2211
- "name": "marketplace_id",
2212
- "type": "text",
2213
- "primaryKey": false,
2214
- "notNull": true
2215
- },
2216
- "order_id": {
2217
- "name": "order_id",
2218
- "type": "text",
2219
- "primaryKey": false,
2220
- "notNull": true
2221
- },
2222
- "status": {
2223
- "name": "status",
2224
- "type": "text",
2225
- "primaryKey": false,
2226
- "notNull": true,
2227
- "default": "'pending'"
2228
- },
2229
- "rail": {
2230
- "name": "rail",
2231
- "type": "text",
2232
- "primaryKey": false,
2233
- "notNull": true
2234
- },
2235
- "challenge_payload": {
2236
- "name": "challenge_payload",
2237
- "type": "jsonb",
2238
- "primaryKey": false,
2239
- "notNull": true
2240
- },
2241
- "expires_at": {
2242
- "name": "expires_at",
2243
- "type": "timestamp with time zone",
2244
- "primaryKey": false,
2245
- "notNull": false
2246
- },
2247
- "created_at": {
2248
- "name": "created_at",
2249
- "type": "timestamp with time zone",
2250
- "primaryKey": false,
2251
- "notNull": true,
2252
- "default": "now()"
2253
- },
2254
- "updated_at": {
2255
- "name": "updated_at",
2256
- "type": "timestamp with time zone",
2257
- "primaryKey": false,
2258
- "notNull": true,
2259
- "default": "now()"
2260
- }
2261
- },
2262
- "indexes": {
2263
- "payment_challenges_order_idx": {
2264
- "name": "payment_challenges_order_idx",
2265
- "columns": [
2266
- {
2267
- "expression": "order_id",
2268
- "isExpression": false,
2269
- "asc": true,
2270
- "nulls": "last"
2271
- }
2272
- ],
2273
- "isUnique": false,
2274
- "concurrently": false,
2275
- "method": "btree",
2276
- "with": {}
2277
- }
2278
- },
2279
- "foreignKeys": {
2280
- "payment_challenges_marketplace_id_marketplaces_id_fk": {
2281
- "name": "payment_challenges_marketplace_id_marketplaces_id_fk",
2282
- "tableFrom": "payment_challenges",
2283
- "tableTo": "marketplaces",
2284
- "columnsFrom": [
2285
- "marketplace_id"
2286
- ],
2287
- "columnsTo": [
2288
- "id"
2289
- ],
2290
- "onDelete": "cascade",
2291
- "onUpdate": "no action"
2292
- },
2293
- "payment_challenges_order_id_orders_id_fk": {
2294
- "name": "payment_challenges_order_id_orders_id_fk",
2295
- "tableFrom": "payment_challenges",
2296
- "tableTo": "orders",
2297
- "columnsFrom": [
2298
- "order_id"
2299
- ],
2300
- "columnsTo": [
2301
- "id"
2302
- ],
2303
- "onDelete": "cascade",
2304
- "onUpdate": "no action"
2305
- }
2306
- },
2307
- "compositePrimaryKeys": {},
2308
- "uniqueConstraints": {},
2309
- "policies": {},
2310
- "checkConstraints": {},
2311
- "isRLSEnabled": false
2312
- },
2313
- "public.payment_receipts": {
2314
- "name": "payment_receipts",
2315
- "schema": "",
2316
- "columns": {
2317
- "id": {
2318
- "name": "id",
2319
- "type": "text",
2320
- "primaryKey": true,
2321
- "notNull": true
2322
- },
2323
- "qtx_id": {
2324
- "name": "qtx_id",
2325
- "type": "text",
2326
- "primaryKey": false,
2327
- "notNull": true
2328
- },
2329
- "marketplace_id": {
2330
- "name": "marketplace_id",
2331
- "type": "text",
2332
- "primaryKey": false,
2333
- "notNull": true
2334
- },
2335
- "order_id": {
2336
- "name": "order_id",
2337
- "type": "text",
2338
- "primaryKey": false,
2339
- "notNull": true
2340
- },
2341
- "challenge_id": {
2342
- "name": "challenge_id",
2343
- "type": "text",
2344
- "primaryKey": false,
2345
- "notNull": true
2346
- },
2347
- "rail": {
2348
- "name": "rail",
2349
- "type": "text",
2350
- "primaryKey": false,
2351
- "notNull": true
2352
- },
2353
- "qhash": {
2354
- "name": "qhash",
2355
- "type": "text",
2356
- "primaryKey": false,
2357
- "notNull": false
2358
- },
2359
- "receipt_payload": {
2360
- "name": "receipt_payload",
2361
- "type": "jsonb",
2362
- "primaryKey": false,
2363
- "notNull": true
2364
- },
2365
- "verified_at": {
2366
- "name": "verified_at",
2367
- "type": "timestamp with time zone",
2368
- "primaryKey": false,
2369
- "notNull": true
2370
- },
2371
- "created_at": {
2372
- "name": "created_at",
2373
- "type": "timestamp with time zone",
2374
- "primaryKey": false,
2375
- "notNull": true,
2376
- "default": "now()"
2377
- }
2378
- },
2379
- "indexes": {
2380
- "payment_receipts_order_idx": {
2381
- "name": "payment_receipts_order_idx",
2382
- "columns": [
2383
- {
2384
- "expression": "order_id",
2385
- "isExpression": false,
2386
- "asc": true,
2387
- "nulls": "last"
2388
- }
2389
- ],
2390
- "isUnique": false,
2391
- "concurrently": false,
2392
- "method": "btree",
2393
- "with": {}
2394
- },
2395
- "payment_receipts_challenge_uq": {
2396
- "name": "payment_receipts_challenge_uq",
2397
- "columns": [
2398
- {
2399
- "expression": "challenge_id",
2400
- "isExpression": false,
2401
- "asc": true,
2402
- "nulls": "last"
2403
- }
2404
- ],
2405
- "isUnique": true,
2406
- "concurrently": false,
2407
- "method": "btree",
2408
- "with": {}
2409
- },
2410
- "payment_receipts_qhash_uq": {
2411
- "name": "payment_receipts_qhash_uq",
2412
- "columns": [
2413
- {
2414
- "expression": "qhash",
2415
- "isExpression": false,
2416
- "asc": true,
2417
- "nulls": "last"
2418
- }
2419
- ],
2420
- "isUnique": true,
2421
- "concurrently": false,
2422
- "method": "btree",
2423
- "with": {}
2424
- },
2425
- "payment_receipts_qtx_idx": {
2426
- "name": "payment_receipts_qtx_idx",
2427
- "columns": [
2428
- {
2429
- "expression": "qtx_id",
2430
- "isExpression": false,
2431
- "asc": true,
2432
- "nulls": "last"
2433
- }
2434
- ],
2435
- "isUnique": false,
2436
- "concurrently": false,
2437
- "method": "btree",
2438
- "with": {}
2439
- }
2440
- },
2441
- "foreignKeys": {
2442
- "payment_receipts_marketplace_id_marketplaces_id_fk": {
2443
- "name": "payment_receipts_marketplace_id_marketplaces_id_fk",
2444
- "tableFrom": "payment_receipts",
2445
- "tableTo": "marketplaces",
2446
- "columnsFrom": [
2447
- "marketplace_id"
2448
- ],
2449
- "columnsTo": [
2450
- "id"
2451
- ],
2452
- "onDelete": "cascade",
2453
- "onUpdate": "no action"
2454
- },
2455
- "payment_receipts_order_id_orders_id_fk": {
2456
- "name": "payment_receipts_order_id_orders_id_fk",
2457
- "tableFrom": "payment_receipts",
2458
- "tableTo": "orders",
2459
- "columnsFrom": [
2460
- "order_id"
2461
- ],
2462
- "columnsTo": [
2463
- "id"
2464
- ],
2465
- "onDelete": "cascade",
2466
- "onUpdate": "no action"
2467
- },
2468
- "payment_receipts_challenge_id_payment_challenges_id_fk": {
2469
- "name": "payment_receipts_challenge_id_payment_challenges_id_fk",
2470
- "tableFrom": "payment_receipts",
2471
- "tableTo": "payment_challenges",
2472
- "columnsFrom": [
2473
- "challenge_id"
2474
- ],
2475
- "columnsTo": [
2476
- "id"
2477
- ],
2478
- "onDelete": "cascade",
2479
- "onUpdate": "no action"
2480
- }
2481
- },
2482
- "compositePrimaryKeys": {},
2483
- "uniqueConstraints": {},
2484
- "policies": {},
2485
- "checkConstraints": {},
2486
- "isRLSEnabled": false
2487
- },
2488
- "public.request_idempotency": {
2489
- "name": "request_idempotency",
2490
- "schema": "",
2491
- "columns": {
2492
- "id": {
2493
- "name": "id",
2494
- "type": "text",
2495
- "primaryKey": true,
2496
- "notNull": true
2497
- },
2498
- "marketplace_id": {
2499
- "name": "marketplace_id",
2500
- "type": "text",
2501
- "primaryKey": false,
2502
- "notNull": true
2503
- },
2504
- "idempotency_key": {
2505
- "name": "idempotency_key",
2506
- "type": "text",
2507
- "primaryKey": false,
2508
- "notNull": true
2509
- },
2510
- "operation": {
2511
- "name": "operation",
2512
- "type": "text",
2513
- "primaryKey": false,
2514
- "notNull": true
2515
- },
2516
- "request_fingerprint": {
2517
- "name": "request_fingerprint",
2518
- "type": "text",
2519
- "primaryKey": false,
2520
- "notNull": true
2521
- },
2522
- "response_status": {
2523
- "name": "response_status",
2524
- "type": "integer",
2525
- "primaryKey": false,
2526
- "notNull": true
2527
- },
2528
- "response_body": {
2529
- "name": "response_body",
2530
- "type": "jsonb",
2531
- "primaryKey": false,
2532
- "notNull": true
2533
- },
2534
- "created_at": {
2535
- "name": "created_at",
2536
- "type": "timestamp with time zone",
2537
- "primaryKey": false,
2538
- "notNull": true,
2539
- "default": "now()"
2540
- },
2541
- "updated_at": {
2542
- "name": "updated_at",
2543
- "type": "timestamp with time zone",
2544
- "primaryKey": false,
2545
- "notNull": true,
2546
- "default": "now()"
2547
- }
2548
- },
2549
- "indexes": {
2550
- "request_idempotency_marketplace_key_operation_uq": {
2551
- "name": "request_idempotency_marketplace_key_operation_uq",
2552
- "columns": [
2553
- {
2554
- "expression": "marketplace_id",
2555
- "isExpression": false,
2556
- "asc": true,
2557
- "nulls": "last"
2558
- },
2559
- {
2560
- "expression": "idempotency_key",
2561
- "isExpression": false,
2562
- "asc": true,
2563
- "nulls": "last"
2564
- },
2565
- {
2566
- "expression": "operation",
2567
- "isExpression": false,
2568
- "asc": true,
2569
- "nulls": "last"
2570
- }
2571
- ],
2572
- "isUnique": true,
2573
- "concurrently": false,
2574
- "method": "btree",
2575
- "with": {}
2576
- }
2577
- },
2578
- "foreignKeys": {
2579
- "request_idempotency_marketplace_id_marketplaces_id_fk": {
2580
- "name": "request_idempotency_marketplace_id_marketplaces_id_fk",
2581
- "tableFrom": "request_idempotency",
2582
- "tableTo": "marketplaces",
2583
- "columnsFrom": [
2584
- "marketplace_id"
2585
- ],
2586
- "columnsTo": [
2587
- "id"
2588
- ],
2589
- "onDelete": "cascade",
2590
- "onUpdate": "no action"
2591
- }
2592
- },
2593
- "compositePrimaryKeys": {},
2594
- "uniqueConstraints": {},
2595
- "policies": {},
2596
- "checkConstraints": {},
2597
- "isRLSEnabled": false
2598
- },
2599
- "public.reviews": {
2600
- "name": "reviews",
2601
- "schema": "",
2602
- "columns": {
2603
- "id": {
2604
- "name": "id",
2605
- "type": "text",
2606
- "primaryKey": true,
2607
- "notNull": true
2608
- },
2609
- "marketplace_id": {
2610
- "name": "marketplace_id",
2611
- "type": "text",
2612
- "primaryKey": false,
2613
- "notNull": true
2614
- },
2615
- "order_id": {
2616
- "name": "order_id",
2617
- "type": "text",
2618
- "primaryKey": false,
2619
- "notNull": true
2620
- },
2621
- "reviewer_actor_id": {
2622
- "name": "reviewer_actor_id",
2623
- "type": "text",
2624
- "primaryKey": false,
2625
- "notNull": true
2626
- },
2627
- "rating": {
2628
- "name": "rating",
2629
- "type": "integer",
2630
- "primaryKey": false,
2631
- "notNull": true
2632
- },
2633
- "comment": {
2634
- "name": "comment",
2635
- "type": "text",
2636
- "primaryKey": false,
2637
- "notNull": false
2638
- },
2639
- "created_at": {
2640
- "name": "created_at",
2641
- "type": "timestamp with time zone",
2642
- "primaryKey": false,
2643
- "notNull": true,
2644
- "default": "now()"
2645
- }
2646
- },
2647
- "indexes": {
2648
- "reviews_order_reviewer_uq": {
2649
- "name": "reviews_order_reviewer_uq",
2650
- "columns": [
2651
- {
2652
- "expression": "order_id",
2653
- "isExpression": false,
2654
- "asc": true,
2655
- "nulls": "last"
2656
- },
2657
- {
2658
- "expression": "reviewer_actor_id",
2659
- "isExpression": false,
2660
- "asc": true,
2661
- "nulls": "last"
2662
- }
2663
- ],
2664
- "isUnique": true,
2665
- "concurrently": false,
2666
- "method": "btree",
2667
- "with": {}
2668
- }
2669
- },
2670
- "foreignKeys": {
2671
- "reviews_marketplace_id_marketplaces_id_fk": {
2672
- "name": "reviews_marketplace_id_marketplaces_id_fk",
2673
- "tableFrom": "reviews",
2674
- "tableTo": "marketplaces",
2675
- "columnsFrom": [
2676
- "marketplace_id"
2677
- ],
2678
- "columnsTo": [
2679
- "id"
2680
- ],
2681
- "onDelete": "cascade",
2682
- "onUpdate": "no action"
2683
- },
2684
- "reviews_order_id_orders_id_fk": {
2685
- "name": "reviews_order_id_orders_id_fk",
2686
- "tableFrom": "reviews",
2687
- "tableTo": "orders",
2688
- "columnsFrom": [
2689
- "order_id"
2690
- ],
2691
- "columnsTo": [
2692
- "id"
2693
- ],
2694
- "onDelete": "cascade",
2695
- "onUpdate": "no action"
2696
- },
2697
- "reviews_reviewer_actor_id_actors_id_fk": {
2698
- "name": "reviews_reviewer_actor_id_actors_id_fk",
2699
- "tableFrom": "reviews",
2700
- "tableTo": "actors",
2701
- "columnsFrom": [
2702
- "reviewer_actor_id"
2703
- ],
2704
- "columnsTo": [
2705
- "id"
2706
- ],
2707
- "onDelete": "cascade",
2708
- "onUpdate": "no action"
2709
- }
2710
- },
2711
- "compositePrimaryKeys": {},
2712
- "uniqueConstraints": {},
2713
- "policies": {},
2714
- "checkConstraints": {},
2715
- "isRLSEnabled": false
2716
- },
2717
- "public.settlement_rules": {
2718
- "name": "settlement_rules",
2719
- "schema": "",
2720
- "columns": {
2721
- "id": {
2722
- "name": "id",
2723
- "type": "text",
2724
- "primaryKey": true,
2725
- "notNull": true
2726
- },
2727
- "marketplace_id": {
2728
- "name": "marketplace_id",
2729
- "type": "text",
2730
- "primaryKey": false,
2731
- "notNull": true
2732
- },
2733
- "name": {
2734
- "name": "name",
2735
- "type": "text",
2736
- "primaryKey": false,
2737
- "notNull": true
2738
- },
2739
- "rules": {
2740
- "name": "rules",
2741
- "type": "jsonb",
2742
- "primaryKey": false,
2743
- "notNull": true
2744
- },
2745
- "created_at": {
2746
- "name": "created_at",
2747
- "type": "timestamp with time zone",
2748
- "primaryKey": false,
2749
- "notNull": true,
2750
- "default": "now()"
2751
- }
2752
- },
2753
- "indexes": {
2754
- "settlement_rules_marketplace_idx": {
2755
- "name": "settlement_rules_marketplace_idx",
2756
- "columns": [
2757
- {
2758
- "expression": "marketplace_id",
2759
- "isExpression": false,
2760
- "asc": true,
2761
- "nulls": "last"
2762
- }
2763
- ],
2764
- "isUnique": false,
2765
- "concurrently": false,
2766
- "method": "btree",
2767
- "with": {}
2768
- }
2769
- },
2770
- "foreignKeys": {
2771
- "settlement_rules_marketplace_id_marketplaces_id_fk": {
2772
- "name": "settlement_rules_marketplace_id_marketplaces_id_fk",
2773
- "tableFrom": "settlement_rules",
2774
- "tableTo": "marketplaces",
2775
- "columnsFrom": [
2776
- "marketplace_id"
2777
- ],
2778
- "columnsTo": [
2779
- "id"
2780
- ],
2781
- "onDelete": "cascade",
2782
- "onUpdate": "no action"
2783
- }
2784
- },
2785
- "compositePrimaryKeys": {},
2786
- "uniqueConstraints": {},
2787
- "policies": {},
2788
- "checkConstraints": {},
2789
- "isRLSEnabled": false
2790
- },
2791
- "public.settlements": {
2792
- "name": "settlements",
2793
- "schema": "",
2794
- "columns": {
2795
- "id": {
2796
- "name": "id",
2797
- "type": "text",
2798
- "primaryKey": true,
2799
- "notNull": true
2800
- },
2801
- "qtx_id": {
2802
- "name": "qtx_id",
2803
- "type": "text",
2804
- "primaryKey": false,
2805
- "notNull": true
2806
- },
2807
- "marketplace_id": {
2808
- "name": "marketplace_id",
2809
- "type": "text",
2810
- "primaryKey": false,
2811
- "notNull": true
2812
- },
2813
- "order_id": {
2814
- "name": "order_id",
2815
- "type": "text",
2816
- "primaryKey": false,
2817
- "notNull": true
2818
- },
2819
- "status": {
2820
- "name": "status",
2821
- "type": "text",
2822
- "primaryKey": false,
2823
- "notNull": true,
2824
- "default": "'pending'"
2825
- },
2826
- "amount_minor": {
2827
- "name": "amount_minor",
2828
- "type": "integer",
2829
- "primaryKey": false,
2830
- "notNull": true
2831
- },
2832
- "currency": {
2833
- "name": "currency",
2834
- "type": "text",
2835
- "primaryKey": false,
2836
- "notNull": true
2837
- },
2838
- "metadata": {
2839
- "name": "metadata",
2840
- "type": "jsonb",
2841
- "primaryKey": false,
2842
- "notNull": false
2843
- },
2844
- "created_at": {
2845
- "name": "created_at",
2846
- "type": "timestamp with time zone",
2847
- "primaryKey": false,
2848
- "notNull": true,
2849
- "default": "now()"
2850
- },
2851
- "updated_at": {
2852
- "name": "updated_at",
2853
- "type": "timestamp with time zone",
2854
- "primaryKey": false,
2855
- "notNull": true,
2856
- "default": "now()"
2857
- }
2858
- },
2859
- "indexes": {
2860
- "settlements_marketplace_order_uq": {
2861
- "name": "settlements_marketplace_order_uq",
2862
- "columns": [
2863
- {
2864
- "expression": "marketplace_id",
2865
- "isExpression": false,
2866
- "asc": true,
2867
- "nulls": "last"
2868
- },
2869
- {
2870
- "expression": "order_id",
2871
- "isExpression": false,
2872
- "asc": true,
2873
- "nulls": "last"
2874
- }
2875
- ],
2876
- "isUnique": true,
2877
- "concurrently": false,
2878
- "method": "btree",
2879
- "with": {}
2880
- },
2881
- "settlements_order_idx": {
2882
- "name": "settlements_order_idx",
2883
- "columns": [
2884
- {
2885
- "expression": "order_id",
2886
- "isExpression": false,
2887
- "asc": true,
2888
- "nulls": "last"
2889
- }
2890
- ],
2891
- "isUnique": false,
2892
- "concurrently": false,
2893
- "method": "btree",
2894
- "with": {}
2895
- }
2896
- },
2897
- "foreignKeys": {
2898
- "settlements_marketplace_id_marketplaces_id_fk": {
2899
- "name": "settlements_marketplace_id_marketplaces_id_fk",
2900
- "tableFrom": "settlements",
2901
- "tableTo": "marketplaces",
2902
- "columnsFrom": [
2903
- "marketplace_id"
2904
- ],
2905
- "columnsTo": [
2906
- "id"
2907
- ],
2908
- "onDelete": "cascade",
2909
- "onUpdate": "no action"
2910
- },
2911
- "settlements_order_id_orders_id_fk": {
2912
- "name": "settlements_order_id_orders_id_fk",
2913
- "tableFrom": "settlements",
2914
- "tableTo": "orders",
2915
- "columnsFrom": [
2916
- "order_id"
2917
- ],
2918
- "columnsTo": [
2919
- "id"
2920
- ],
2921
- "onDelete": "cascade",
2922
- "onUpdate": "no action"
2923
- }
2924
- },
2925
- "compositePrimaryKeys": {},
2926
- "uniqueConstraints": {},
2927
- "policies": {},
2928
- "checkConstraints": {},
2929
- "isRLSEnabled": false
2930
- },
2931
- "public.webhook_deliveries": {
2932
- "name": "webhook_deliveries",
2933
- "schema": "",
2934
- "columns": {
2935
- "id": {
2936
- "name": "id",
2937
- "type": "text",
2938
- "primaryKey": true,
2939
- "notNull": true
2940
- },
2941
- "subscription_id": {
2942
- "name": "subscription_id",
2943
- "type": "text",
2944
- "primaryKey": false,
2945
- "notNull": true
2946
- },
2947
- "event_id": {
2948
- "name": "event_id",
2949
- "type": "text",
2950
- "primaryKey": false,
2951
- "notNull": true
2952
- },
2953
- "status": {
2954
- "name": "status",
2955
- "type": "text",
2956
- "primaryKey": false,
2957
- "notNull": true,
2958
- "default": "'pending'"
2959
- },
2960
- "attempts": {
2961
- "name": "attempts",
2962
- "type": "integer",
2963
- "primaryKey": false,
2964
- "notNull": true,
2965
- "default": 0
2966
- },
2967
- "response_status": {
2968
- "name": "response_status",
2969
- "type": "integer",
2970
- "primaryKey": false,
2971
- "notNull": false
2972
- },
2973
- "last_error": {
2974
- "name": "last_error",
2975
- "type": "text",
2976
- "primaryKey": false,
2977
- "notNull": false
2978
- },
2979
- "next_attempt_at": {
2980
- "name": "next_attempt_at",
2981
- "type": "timestamp with time zone",
2982
- "primaryKey": false,
2983
- "notNull": false
2984
- },
2985
- "dead_lettered_at": {
2986
- "name": "dead_lettered_at",
2987
- "type": "timestamp with time zone",
2988
- "primaryKey": false,
2989
- "notNull": false
2990
- },
2991
- "created_at": {
2992
- "name": "created_at",
2993
- "type": "timestamp with time zone",
2994
- "primaryKey": false,
2995
- "notNull": true,
2996
- "default": "now()"
2997
- },
2998
- "updated_at": {
2999
- "name": "updated_at",
3000
- "type": "timestamp with time zone",
3001
- "primaryKey": false,
3002
- "notNull": true,
3003
- "default": "now()"
3004
- }
3005
- },
3006
- "indexes": {
3007
- "webhook_deliveries_status_idx": {
3008
- "name": "webhook_deliveries_status_idx",
3009
- "columns": [
3010
- {
3011
- "expression": "status",
3012
- "isExpression": false,
3013
- "asc": true,
3014
- "nulls": "last"
3015
- }
3016
- ],
3017
- "isUnique": false,
3018
- "concurrently": false,
3019
- "method": "btree",
3020
- "with": {}
3021
- },
3022
- "webhook_deliveries_next_attempt_idx": {
3023
- "name": "webhook_deliveries_next_attempt_idx",
3024
- "columns": [
3025
- {
3026
- "expression": "next_attempt_at",
3027
- "isExpression": false,
3028
- "asc": true,
3029
- "nulls": "last"
3030
- }
3031
- ],
3032
- "isUnique": false,
3033
- "concurrently": false,
3034
- "method": "btree",
3035
- "with": {}
3036
- }
3037
- },
3038
- "foreignKeys": {
3039
- "webhook_deliveries_subscription_id_webhook_subscriptions_id_fk": {
3040
- "name": "webhook_deliveries_subscription_id_webhook_subscriptions_id_fk",
3041
- "tableFrom": "webhook_deliveries",
3042
- "tableTo": "webhook_subscriptions",
3043
- "columnsFrom": [
3044
- "subscription_id"
3045
- ],
3046
- "columnsTo": [
3047
- "id"
3048
- ],
3049
- "onDelete": "cascade",
3050
- "onUpdate": "no action"
3051
- },
3052
- "webhook_deliveries_event_id_domain_events_id_fk": {
3053
- "name": "webhook_deliveries_event_id_domain_events_id_fk",
3054
- "tableFrom": "webhook_deliveries",
3055
- "tableTo": "domain_events",
3056
- "columnsFrom": [
3057
- "event_id"
3058
- ],
3059
- "columnsTo": [
3060
- "id"
3061
- ],
3062
- "onDelete": "cascade",
3063
- "onUpdate": "no action"
3064
- }
3065
- },
3066
- "compositePrimaryKeys": {},
3067
- "uniqueConstraints": {},
3068
- "policies": {},
3069
- "checkConstraints": {},
3070
- "isRLSEnabled": false
3071
- },
3072
- "public.webhook_subscriptions": {
3073
- "name": "webhook_subscriptions",
3074
- "schema": "",
3075
- "columns": {
3076
- "id": {
3077
- "name": "id",
3078
- "type": "text",
3079
- "primaryKey": true,
3080
- "notNull": true
3081
- },
3082
- "marketplace_id": {
3083
- "name": "marketplace_id",
3084
- "type": "text",
3085
- "primaryKey": false,
3086
- "notNull": true
3087
- },
3088
- "url": {
3089
- "name": "url",
3090
- "type": "text",
3091
- "primaryKey": false,
3092
- "notNull": true
3093
- },
3094
- "secret": {
3095
- "name": "secret",
3096
- "type": "text",
3097
- "primaryKey": false,
3098
- "notNull": true
3099
- },
3100
- "event_types": {
3101
- "name": "event_types",
3102
- "type": "jsonb",
3103
- "primaryKey": false,
3104
- "notNull": false
3105
- },
3106
- "created_at": {
3107
- "name": "created_at",
3108
- "type": "timestamp with time zone",
3109
- "primaryKey": false,
3110
- "notNull": true,
3111
- "default": "now()"
3112
- }
3113
- },
3114
- "indexes": {
3115
- "webhook_subscriptions_marketplace_idx": {
3116
- "name": "webhook_subscriptions_marketplace_idx",
3117
- "columns": [
3118
- {
3119
- "expression": "marketplace_id",
3120
- "isExpression": false,
3121
- "asc": true,
3122
- "nulls": "last"
3123
- }
3124
- ],
3125
- "isUnique": false,
3126
- "concurrently": false,
3127
- "method": "btree",
3128
- "with": {}
3129
- }
3130
- },
3131
- "foreignKeys": {
3132
- "webhook_subscriptions_marketplace_id_marketplaces_id_fk": {
3133
- "name": "webhook_subscriptions_marketplace_id_marketplaces_id_fk",
3134
- "tableFrom": "webhook_subscriptions",
3135
- "tableTo": "marketplaces",
3136
- "columnsFrom": [
3137
- "marketplace_id"
3138
- ],
3139
- "columnsTo": [
3140
- "id"
3141
- ],
3142
- "onDelete": "cascade",
3143
- "onUpdate": "no action"
3144
- }
3145
- },
3146
- "compositePrimaryKeys": {},
3147
- "uniqueConstraints": {},
3148
- "policies": {},
3149
- "checkConstraints": {},
3150
- "isRLSEnabled": false
3151
- }
3152
- },
3153
- "enums": {},
3154
- "schemas": {},
3155
- "sequences": {},
3156
- "roles": {},
3157
- "policies": {},
3158
- "views": {},
3159
- "_meta": {
3160
- "columns": {},
3161
- "schemas": {},
3162
- "tables": {}
3163
- }
3164
- }