1 {
2 "namespaces": [
3 "public"
4 ],
5 "name": "public",
6 "tables": [
7 {
8 "columns": {
9 "id": {
10 "name": "id",
11 "type": "text",
12 "unsigned": false,
13 "autoincrement": false,
14 "primary": false,
15 "nullable": false,
16 "mappedType": "text"
17 },
18 "name": {
19 "name": "name",
20 "type": "text",
21 "unsigned": false,
22 "autoincrement": false,
23 "primary": false,
24 "nullable": false,
25 "mappedType": "text"
26 },
27 "description": {
28 "name": "description",
29 "type": "text",
30 "unsigned": false,
31 "autoincrement": false,
32 "primary": false,
33 "nullable": true,
34 "mappedType": "text"
35 },
36 "campaign_identifier": {
37 "name": "campaign_identifier",
38 "type": "text",
39 "unsigned": false,
40 "autoincrement": false,
41 "primary": false,
42 "nullable": false,
43 "mappedType": "text"
44 },
45 "starts_at": {
46 "name": "starts_at",
47 "type": "timestamptz",
48 "unsigned": false,
49 "autoincrement": false,
50 "primary": false,
51 "nullable": true,
52 "length": 6,
53 "mappedType": "datetime"
54 },
55 "ends_at": {
56 "name": "ends_at",
57 "type": "timestamptz",
58 "unsigned": false,
59 "autoincrement": false,
60 "primary": false,
61 "nullable": true,
62 "length": 6,
63 "mappedType": "datetime"
64 },
65 "created_at": {
66 "name": "created_at",
67 "type": "timestamptz",
68 "unsigned": false,
69 "autoincrement": false,
70 "primary": false,
71 "nullable": false,
72 "length": 6,
73 "default": "now()",
74 "mappedType": "datetime"
75 },
76 "updated_at": {
77 "name": "updated_at",
78 "type": "timestamptz",
79 "unsigned": false,
80 "autoincrement": false,
81 "primary": false,
82 "nullable": false,
83 "length": 6,
84 "default": "now()",
85 "mappedType": "datetime"
86 },
87 "deleted_at": {
88 "name": "deleted_at",
89 "type": "timestamptz",
90 "unsigned": false,
91 "autoincrement": false,
92 "primary": false,
93 "nullable": true,
94 "length": 6,
95 "mappedType": "datetime"
96 }
97 },
98 "name": "promotion_campaign",
99 "schema": "public",
100 "indexes": [
101 {
102 "keyName": "IDX_promotion_campaign_deleted_at",
103 "columnNames": [],
104 "composite": false,
105 "constraint": false,
106 "primary": false,
107 "unique": false,
108 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_campaign_deleted_at\" ON \"promotion_campaign\" (deleted_at) WHERE deleted_at IS NULL"
109 },
110 {
111 "keyName": "IDX_promotion_campaign_campaign_identifier_unique",
112 "columnNames": [],
113 "composite": false,
114 "constraint": false,
115 "primary": false,
116 "unique": false,
117 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_promotion_campaign_campaign_identifier_unique\" ON \"promotion_campaign\" (campaign_identifier) WHERE deleted_at IS NULL"
118 },
119 {
120 "keyName": "promotion_campaign_pkey",
121 "columnNames": [
122 "id"
123 ],
124 "composite": false,
125 "constraint": true,
126 "primary": true,
127 "unique": true
128 }
129 ],
130 "checks": [],
131 "foreignKeys": {},
132 "nativeEnums": {}
133 },
134 {
135 "columns": {
136 "id": {
137 "name": "id",
138 "type": "text",
139 "unsigned": false,
140 "autoincrement": false,
141 "primary": false,
142 "nullable": false,
143 "mappedType": "text"
144 },
145 "type": {
146 "name": "type",
147 "type": "text",
148 "unsigned": false,
149 "autoincrement": false,
150 "primary": false,
151 "nullable": false,
152 "enumItems": [
153 "spend",
154 "usage",
155 "use_by_attribute",
156 "spend_by_attribute"
157 ],
158 "mappedType": "enum"
159 },
160 "currency_code": {
161 "name": "currency_code",
162 "type": "text",
163 "unsigned": false,
164 "autoincrement": false,
165 "primary": false,
166 "nullable": true,
167 "mappedType": "text"
168 },
169 "limit": {
170 "name": "limit",
171 "type": "numeric",
172 "unsigned": false,
173 "autoincrement": false,
174 "primary": false,
175 "nullable": true,
176 "mappedType": "decimal"
177 },
178 "used": {
179 "name": "used",
180 "type": "numeric",
181 "unsigned": false,
182 "autoincrement": false,
183 "primary": false,
184 "nullable": false,
185 "default": "0",
186 "mappedType": "decimal"
187 },
188 "campaign_id": {
189 "name": "campaign_id",
190 "type": "text",
191 "unsigned": false,
192 "autoincrement": false,
193 "primary": false,
194 "nullable": false,
195 "mappedType": "text"
196 },
197 "attribute": {
198 "name": "attribute",
199 "type": "text",
200 "unsigned": false,
201 "autoincrement": false,
202 "primary": false,
203 "nullable": true,
204 "mappedType": "text"
205 },
206 "raw_limit": {
207 "name": "raw_limit",
208 "type": "jsonb",
209 "unsigned": false,
210 "autoincrement": false,
211 "primary": false,
212 "nullable": true,
213 "mappedType": "json"
214 },
215 "raw_used": {
216 "name": "raw_used",
217 "type": "jsonb",
218 "unsigned": false,
219 "autoincrement": false,
220 "primary": false,
221 "nullable": false,
222 "mappedType": "json"
223 },
224 "created_at": {
225 "name": "created_at",
226 "type": "timestamptz",
227 "unsigned": false,
228 "autoincrement": false,
229 "primary": false,
230 "nullable": false,
231 "length": 6,
232 "default": "now()",
233 "mappedType": "datetime"
234 },
235 "updated_at": {
236 "name": "updated_at",
237 "type": "timestamptz",
238 "unsigned": false,
239 "autoincrement": false,
240 "primary": false,
241 "nullable": false,
242 "length": 6,
243 "default": "now()",
244 "mappedType": "datetime"
245 },
246 "deleted_at": {
247 "name": "deleted_at",
248 "type": "timestamptz",
249 "unsigned": false,
250 "autoincrement": false,
251 "primary": false,
252 "nullable": true,
253 "length": 6,
254 "mappedType": "datetime"
255 }
256 },
257 "name": "promotion_campaign_budget",
258 "schema": "public",
259 "indexes": [
260 {
261 "keyName": "IDX_campaign_budget_type",
262 "columnNames": [],
263 "composite": false,
264 "constraint": false,
265 "primary": false,
266 "unique": false,
267 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_campaign_budget_type\" ON \"promotion_campaign_budget\" (type) WHERE deleted_at IS NULL"
268 },
269 {
270 "keyName": "IDX_promotion_campaign_budget_campaign_id_unique",
271 "columnNames": [],
272 "composite": false,
273 "constraint": false,
274 "primary": false,
275 "unique": false,
276 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_promotion_campaign_budget_campaign_id_unique\" ON \"promotion_campaign_budget\" (campaign_id) WHERE deleted_at IS NULL"
277 },
278 {
279 "keyName": "IDX_promotion_campaign_budget_deleted_at",
280 "columnNames": [],
281 "composite": false,
282 "constraint": false,
283 "primary": false,
284 "unique": false,
285 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_campaign_budget_deleted_at\" ON \"promotion_campaign_budget\" (deleted_at) WHERE deleted_at IS NULL"
286 },
287 {
288 "keyName": "promotion_campaign_budget_pkey",
289 "columnNames": [
290 "id"
291 ],
292 "composite": false,
293 "constraint": true,
294 "primary": true,
295 "unique": true
296 }
297 ],
298 "checks": [],
299 "foreignKeys": {
300 "promotion_campaign_budget_campaign_id_foreign": {
301 "constraintName": "promotion_campaign_budget_campaign_id_foreign",
302 "columnNames": [
303 "campaign_id"
304 ],
305 "localTableName": "public.promotion_campaign_budget",
306 "referencedColumnNames": [
307 "id"
308 ],
309 "referencedTableName": "public.promotion_campaign",
310 "deleteRule": "cascade",
311 "updateRule": "cascade"
312 }
313 },
314 "nativeEnums": {}
315 },
316 {
317 "columns": {
318 "id": {
319 "name": "id",
320 "type": "text",
321 "unsigned": false,
322 "autoincrement": false,
323 "primary": false,
324 "nullable": false,
325 "mappedType": "text"
326 },
327 "attribute_value": {
328 "name": "attribute_value",
329 "type": "text",
330 "unsigned": false,
331 "autoincrement": false,
332 "primary": false,
333 "nullable": false,
334 "mappedType": "text"
335 },
336 "used": {
337 "name": "used",
338 "type": "numeric",
339 "unsigned": false,
340 "autoincrement": false,
341 "primary": false,
342 "nullable": false,
343 "default": "0",
344 "mappedType": "decimal"
345 },
346 "budget_id": {
347 "name": "budget_id",
348 "type": "text",
349 "unsigned": false,
350 "autoincrement": false,
351 "primary": false,
352 "nullable": false,
353 "mappedType": "text"
354 },
355 "raw_used": {
356 "name": "raw_used",
357 "type": "jsonb",
358 "unsigned": false,
359 "autoincrement": false,
360 "primary": false,
361 "nullable": false,
362 "mappedType": "json"
363 },
364 "created_at": {
365 "name": "created_at",
366 "type": "timestamptz",
367 "unsigned": false,
368 "autoincrement": false,
369 "primary": false,
370 "nullable": false,
371 "length": 6,
372 "default": "now()",
373 "mappedType": "datetime"
374 },
375 "updated_at": {
376 "name": "updated_at",
377 "type": "timestamptz",
378 "unsigned": false,
379 "autoincrement": false,
380 "primary": false,
381 "nullable": false,
382 "length": 6,
383 "default": "now()",
384 "mappedType": "datetime"
385 },
386 "deleted_at": {
387 "name": "deleted_at",
388 "type": "timestamptz",
389 "unsigned": false,
390 "autoincrement": false,
391 "primary": false,
392 "nullable": true,
393 "length": 6,
394 "mappedType": "datetime"
395 }
396 },
397 "name": "promotion_campaign_budget_usage",
398 "schema": "public",
399 "indexes": [
400 {
401 "keyName": "IDX_promotion_campaign_budget_usage_budget_id",
402 "columnNames": [],
403 "composite": false,
404 "constraint": false,
405 "primary": false,
406 "unique": false,
407 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_campaign_budget_usage_budget_id\" ON \"promotion_campaign_budget_usage\" (budget_id) WHERE deleted_at IS NULL"
408 },
409 {
410 "keyName": "IDX_promotion_campaign_budget_usage_deleted_at",
411 "columnNames": [],
412 "composite": false,
413 "constraint": false,
414 "primary": false,
415 "unique": false,
416 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_campaign_budget_usage_deleted_at\" ON \"promotion_campaign_budget_usage\" (deleted_at) WHERE deleted_at IS NULL"
417 },
418 {
419 "keyName": "IDX_promotion_campaign_budget_usage_attribute_value_budget_id_unique",
420 "columnNames": [],
421 "composite": false,
422 "constraint": false,
423 "primary": false,
424 "unique": false,
425 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_promotion_campaign_budget_usage_attribute_value_budget_id_unique\" ON \"promotion_campaign_budget_usage\" (attribute_value, budget_id) WHERE deleted_at IS NULL"
426 },
427 {
428 "keyName": "promotion_campaign_budget_usage_pkey",
429 "columnNames": [
430 "id"
431 ],
432 "composite": false,
433 "constraint": true,
434 "primary": true,
435 "unique": true
436 }
437 ],
438 "checks": [],
439 "foreignKeys": {
440 "promotion_campaign_budget_usage_budget_id_foreign": {
441 "constraintName": "promotion_campaign_budget_usage_budget_id_foreign",
442 "columnNames": [
443 "budget_id"
444 ],
445 "localTableName": "public.promotion_campaign_budget_usage",
446 "referencedColumnNames": [
447 "id"
448 ],
449 "referencedTableName": "public.promotion_campaign_budget",
450 "deleteRule": "cascade",
451 "updateRule": "cascade"
452 }
453 },
454 "nativeEnums": {}
455 },
456 {
457 "columns": {
458 "id": {
459 "name": "id",
460 "type": "text",
461 "unsigned": false,
462 "autoincrement": false,
463 "primary": false,
464 "nullable": false,
465 "mappedType": "text"
466 },
467 "code": {
468 "name": "code",
469 "type": "text",
470 "unsigned": false,
471 "autoincrement": false,
472 "primary": false,
473 "nullable": false,
474 "mappedType": "text"
475 },
476 "is_automatic": {
477 "name": "is_automatic",
478 "type": "boolean",
479 "unsigned": false,
480 "autoincrement": false,
481 "primary": false,
482 "nullable": false,
483 "default": "false",
484 "mappedType": "boolean"
485 },
486 "is_tax_inclusive": {
487 "name": "is_tax_inclusive",
488 "type": "boolean",
489 "unsigned": false,
490 "autoincrement": false,
491 "primary": false,
492 "nullable": false,
493 "default": "false",
494 "mappedType": "boolean"
495 },
496 "limit": {
497 "name": "limit",
498 "type": "integer",
499 "unsigned": false,
500 "autoincrement": false,
501 "primary": false,
502 "nullable": true,
503 "mappedType": "integer"
504 },
505 "used": {
506 "name": "used",
507 "type": "integer",
508 "unsigned": false,
509 "autoincrement": false,
510 "primary": false,
511 "nullable": false,
512 "default": "0",
513 "mappedType": "integer"
514 },
515 "type": {
516 "name": "type",
517 "type": "text",
518 "unsigned": false,
519 "autoincrement": false,
520 "primary": false,
521 "nullable": false,
522 "enumItems": [
523 "standard",
524 "buyget"
525 ],
526 "mappedType": "enum"
527 },
528 "status": {
529 "name": "status",
530 "type": "text",
531 "unsigned": false,
532 "autoincrement": false,
533 "primary": false,
534 "nullable": false,
535 "default": "'draft'",
536 "enumItems": [
537 "draft",
538 "active",
539 "inactive"
540 ],
541 "mappedType": "enum"
542 },
543 "campaign_id": {
544 "name": "campaign_id",
545 "type": "text",
546 "unsigned": false,
547 "autoincrement": false,
548 "primary": false,
549 "nullable": true,
550 "mappedType": "text"
551 },
552 "metadata": {
553 "name": "metadata",
554 "type": "jsonb",
555 "unsigned": false,
556 "autoincrement": false,
557 "primary": false,
558 "nullable": true,
559 "mappedType": "json"
560 },
561 "created_at": {
562 "name": "created_at",
563 "type": "timestamptz",
564 "unsigned": false,
565 "autoincrement": false,
566 "primary": false,
567 "nullable": false,
568 "length": 6,
569 "default": "now()",
570 "mappedType": "datetime"
571 },
572 "updated_at": {
573 "name": "updated_at",
574 "type": "timestamptz",
575 "unsigned": false,
576 "autoincrement": false,
577 "primary": false,
578 "nullable": false,
579 "length": 6,
580 "default": "now()",
581 "mappedType": "datetime"
582 },
583 "deleted_at": {
584 "name": "deleted_at",
585 "type": "timestamptz",
586 "unsigned": false,
587 "autoincrement": false,
588 "primary": false,
589 "nullable": true,
590 "length": 6,
591 "mappedType": "datetime"
592 }
593 },
594 "name": "promotion",
595 "schema": "public",
596 "indexes": [
597 {
598 "keyName": "IDX_promotion_type",
599 "columnNames": [],
600 "composite": false,
601 "constraint": false,
602 "primary": false,
603 "unique": false,
604 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_type\" ON \"promotion\" (type) WHERE deleted_at IS NULL"
605 },
606 {
607 "keyName": "IDX_promotion_status",
608 "columnNames": [],
609 "composite": false,
610 "constraint": false,
611 "primary": false,
612 "unique": false,
613 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_status\" ON \"promotion\" (status) WHERE deleted_at IS NULL"
614 },
615 {
616 "keyName": "IDX_promotion_campaign_id",
617 "columnNames": [],
618 "composite": false,
619 "constraint": false,
620 "primary": false,
621 "unique": false,
622 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_campaign_id\" ON \"promotion\" (campaign_id) WHERE deleted_at IS NULL"
623 },
624 {
625 "keyName": "IDX_promotion_deleted_at",
626 "columnNames": [],
627 "composite": false,
628 "constraint": false,
629 "primary": false,
630 "unique": false,
631 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_deleted_at\" ON \"promotion\" (deleted_at) WHERE deleted_at IS NULL"
632 },
633 {
634 "keyName": "IDX_unique_promotion_code",
635 "columnNames": [],
636 "composite": false,
637 "constraint": false,
638 "primary": false,
639 "unique": false,
640 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_unique_promotion_code\" ON \"promotion\" (code) WHERE deleted_at IS NULL"
641 },
642 {
643 "keyName": "IDX_promotion_is_automatic",
644 "columnNames": [],
645 "composite": false,
646 "constraint": false,
647 "primary": false,
648 "unique": false,
649 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_is_automatic\" ON \"promotion\" (is_automatic) WHERE deleted_at IS NULL"
650 },
651 {
652 "keyName": "promotion_pkey",
653 "columnNames": [
654 "id"
655 ],
656 "composite": false,
657 "constraint": true,
658 "primary": true,
659 "unique": true
660 }
661 ],
662 "checks": [],
663 "foreignKeys": {
664 "promotion_campaign_id_foreign": {
665 "constraintName": "promotion_campaign_id_foreign",
666 "columnNames": [
667 "campaign_id"
668 ],
669 "localTableName": "public.promotion",
670 "referencedColumnNames": [
671 "id"
672 ],
673 "referencedTableName": "public.promotion_campaign",
674 "deleteRule": "set null",
675 "updateRule": "cascade"
676 }
677 },
678 "nativeEnums": {}
679 },
680 {
681 "columns": {
682 "id": {
683 "name": "id",
684 "type": "text",
685 "unsigned": false,
686 "autoincrement": false,
687 "primary": false,
688 "nullable": false,
689 "mappedType": "text"
690 },
691 "value": {
692 "name": "value",
693 "type": "numeric",
694 "unsigned": false,
695 "autoincrement": false,
696 "primary": false,
697 "nullable": true,
698 "mappedType": "decimal"
699 },
700 "currency_code": {
701 "name": "currency_code",
702 "type": "text",
703 "unsigned": false,
704 "autoincrement": false,
705 "primary": false,
706 "nullable": true,
707 "mappedType": "text"
708 },
709 "max_quantity": {
710 "name": "max_quantity",
711 "type": "integer",
712 "unsigned": false,
713 "autoincrement": false,
714 "primary": false,
715 "nullable": true,
716 "mappedType": "integer"
717 },
718 "apply_to_quantity": {
719 "name": "apply_to_quantity",
720 "type": "integer",
721 "unsigned": false,
722 "autoincrement": false,
723 "primary": false,
724 "nullable": true,
725 "mappedType": "integer"
726 },
727 "buy_rules_min_quantity": {
728 "name": "buy_rules_min_quantity",
729 "type": "integer",
730 "unsigned": false,
731 "autoincrement": false,
732 "primary": false,
733 "nullable": true,
734 "mappedType": "integer"
735 },
736 "type": {
737 "name": "type",
738 "type": "text",
739 "unsigned": false,
740 "autoincrement": false,
741 "primary": false,
742 "nullable": false,
743 "enumItems": [
744 "fixed",
745 "percentage"
746 ],
747 "mappedType": "enum"
748 },
749 "target_type": {
750 "name": "target_type",
751 "type": "text",
752 "unsigned": false,
753 "autoincrement": false,
754 "primary": false,
755 "nullable": false,
756 "enumItems": [
757 "order",
758 "shipping_methods",
759 "items"
760 ],
761 "mappedType": "enum"
762 },
763 "allocation": {
764 "name": "allocation",
765 "type": "text",
766 "unsigned": false,
767 "autoincrement": false,
768 "primary": false,
769 "nullable": true,
770 "enumItems": [
771 "each",
772 "across",
773 "once"
774 ],
775 "mappedType": "enum"
776 },
777 "promotion_id": {
778 "name": "promotion_id",
779 "type": "text",
780 "unsigned": false,
781 "autoincrement": false,
782 "primary": false,
783 "nullable": false,
784 "mappedType": "text"
785 },
786 "raw_value": {
787 "name": "raw_value",
788 "type": "jsonb",
789 "unsigned": false,
790 "autoincrement": false,
791 "primary": false,
792 "nullable": true,
793 "mappedType": "json"
794 },
795 "created_at": {
796 "name": "created_at",
797 "type": "timestamptz",
798 "unsigned": false,
799 "autoincrement": false,
800 "primary": false,
801 "nullable": false,
802 "length": 6,
803 "default": "now()",
804 "mappedType": "datetime"
805 },
806 "updated_at": {
807 "name": "updated_at",
808 "type": "timestamptz",
809 "unsigned": false,
810 "autoincrement": false,
811 "primary": false,
812 "nullable": false,
813 "length": 6,
814 "default": "now()",
815 "mappedType": "datetime"
816 },
817 "deleted_at": {
818 "name": "deleted_at",
819 "type": "timestamptz",
820 "unsigned": false,
821 "autoincrement": false,
822 "primary": false,
823 "nullable": true,
824 "length": 6,
825 "mappedType": "datetime"
826 }
827 },
828 "name": "promotion_application_method",
829 "schema": "public",
830 "indexes": [
831 {
832 "keyName": "IDX_application_method_type",
833 "columnNames": [],
834 "composite": false,
835 "constraint": false,
836 "primary": false,
837 "unique": false,
838 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_application_method_type\" ON \"promotion_application_method\" (type) WHERE deleted_at IS NULL"
839 },
840 {
841 "keyName": "IDX_application_method_target_type",
842 "columnNames": [],
843 "composite": false,
844 "constraint": false,
845 "primary": false,
846 "unique": false,
847 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_application_method_target_type\" ON \"promotion_application_method\" (target_type) WHERE deleted_at IS NULL"
848 },
849 {
850 "keyName": "IDX_application_method_allocation",
851 "columnNames": [],
852 "composite": false,
853 "constraint": false,
854 "primary": false,
855 "unique": false,
856 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_application_method_allocation\" ON \"promotion_application_method\" (allocation) WHERE deleted_at IS NULL"
857 },
858 {
859 "keyName": "IDX_promotion_application_method_promotion_id_unique",
860 "columnNames": [],
861 "composite": false,
862 "constraint": false,
863 "primary": false,
864 "unique": false,
865 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_promotion_application_method_promotion_id_unique\" ON \"promotion_application_method\" (promotion_id) WHERE deleted_at IS NULL"
866 },
867 {
868 "keyName": "IDX_promotion_application_method_deleted_at",
869 "columnNames": [],
870 "composite": false,
871 "constraint": false,
872 "primary": false,
873 "unique": false,
874 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_application_method_deleted_at\" ON \"promotion_application_method\" (deleted_at) WHERE deleted_at IS NULL"
875 },
876 {
877 "keyName": "IDX_promotion_application_method_currency_code",
878 "columnNames": [],
879 "composite": false,
880 "constraint": false,
881 "primary": false,
882 "unique": false,
883 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_application_method_currency_code\" ON \"promotion_application_method\" (currency_code) WHERE deleted_at IS NOT NULL"
884 },
885 {
886 "keyName": "promotion_application_method_pkey",
887 "columnNames": [
888 "id"
889 ],
890 "composite": false,
891 "constraint": true,
892 "primary": true,
893 "unique": true
894 }
895 ],
896 "checks": [],
897 "foreignKeys": {
898 "promotion_application_method_promotion_id_foreign": {
899 "constraintName": "promotion_application_method_promotion_id_foreign",
900 "columnNames": [
901 "promotion_id"
902 ],
903 "localTableName": "public.promotion_application_method",
904 "referencedColumnNames": [
905 "id"
906 ],
907 "referencedTableName": "public.promotion",
908 "deleteRule": "cascade",
909 "updateRule": "cascade"
910 }
911 },
912 "nativeEnums": {}
913 },
914 {
915 "columns": {
916 "id": {
917 "name": "id",
918 "type": "text",
919 "unsigned": false,
920 "autoincrement": false,
921 "primary": false,
922 "nullable": false,
923 "mappedType": "text"
924 },
925 "description": {
926 "name": "description",
927 "type": "text",
928 "unsigned": false,
929 "autoincrement": false,
930 "primary": false,
931 "nullable": true,
932 "mappedType": "text"
933 },
934 "attribute": {
935 "name": "attribute",
936 "type": "text",
937 "unsigned": false,
938 "autoincrement": false,
939 "primary": false,
940 "nullable": false,
941 "mappedType": "text"
942 },
943 "operator": {
944 "name": "operator",
945 "type": "text",
946 "unsigned": false,
947 "autoincrement": false,
948 "primary": false,
949 "nullable": false,
950 "enumItems": [
951 "gte",
952 "lte",
953 "gt",
954 "lt",
955 "eq",
956 "ne",
957 "in"
958 ],
959 "mappedType": "enum"
960 },
961 "created_at": {
962 "name": "created_at",
963 "type": "timestamptz",
964 "unsigned": false,
965 "autoincrement": false,
966 "primary": false,
967 "nullable": false,
968 "length": 6,
969 "default": "now()",
970 "mappedType": "datetime"
971 },
972 "updated_at": {
973 "name": "updated_at",
974 "type": "timestamptz",
975 "unsigned": false,
976 "autoincrement": false,
977 "primary": false,
978 "nullable": false,
979 "length": 6,
980 "default": "now()",
981 "mappedType": "datetime"
982 },
983 "deleted_at": {
984 "name": "deleted_at",
985 "type": "timestamptz",
986 "unsigned": false,
987 "autoincrement": false,
988 "primary": false,
989 "nullable": true,
990 "length": 6,
991 "mappedType": "datetime"
992 }
993 },
994 "name": "promotion_rule",
995 "schema": "public",
996 "indexes": [
997 {
998 "keyName": "IDX_promotion_rule_attribute",
999 "columnNames": [],
1000 "composite": false,
1001 "constraint": false,
1002 "primary": false,
1003 "unique": false,
1004 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_rule_attribute\" ON \"promotion_rule\" (attribute) WHERE deleted_at IS NULL"
1005 },
1006 {
1007 "keyName": "IDX_promotion_rule_operator",
1008 "columnNames": [],
1009 "composite": false,
1010 "constraint": false,
1011 "primary": false,
1012 "unique": false,
1013 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_rule_operator\" ON \"promotion_rule\" (operator) WHERE deleted_at IS NULL"
1014 },
1015 {
1016 "keyName": "IDX_promotion_rule_deleted_at",
1017 "columnNames": [],
1018 "composite": false,
1019 "constraint": false,
1020 "primary": false,
1021 "unique": false,
1022 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_rule_deleted_at\" ON \"promotion_rule\" (deleted_at) WHERE deleted_at IS NULL"
1023 },
1024 {
1025 "keyName": "IDX_promotion_rule_attribute_operator",
1026 "columnNames": [],
1027 "composite": false,
1028 "constraint": false,
1029 "primary": false,
1030 "unique": false,
1031 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_rule_attribute_operator\" ON \"promotion_rule\" (attribute, operator) WHERE deleted_at IS NULL"
1032 },
1033 {
1034 "keyName": "IDX_promotion_rule_attribute_operator_id",
1035 "columnNames": [],
1036 "composite": false,
1037 "constraint": false,
1038 "primary": false,
1039 "unique": false,
1040 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_rule_attribute_operator_id\" ON \"promotion_rule\" (operator, attribute, id) WHERE deleted_at IS NULL"
1041 },
1042 {
1043 "keyName": "promotion_rule_pkey",
1044 "columnNames": [
1045 "id"
1046 ],
1047 "composite": false,
1048 "constraint": true,
1049 "primary": true,
1050 "unique": true
1051 }
1052 ],
1053 "checks": [],
1054 "foreignKeys": {},
1055 "nativeEnums": {}
1056 },
1057 {
1058 "columns": {
1059 "promotion_id": {
1060 "name": "promotion_id",
1061 "type": "text",
1062 "unsigned": false,
1063 "autoincrement": false,
1064 "primary": false,
1065 "nullable": false,
1066 "mappedType": "text"
1067 },
1068 "promotion_rule_id": {
1069 "name": "promotion_rule_id",
1070 "type": "text",
1071 "unsigned": false,
1072 "autoincrement": false,
1073 "primary": false,
1074 "nullable": false,
1075 "mappedType": "text"
1076 }
1077 },
1078 "name": "promotion_promotion_rule",
1079 "schema": "public",
1080 "indexes": [
1081 {
1082 "keyName": "promotion_promotion_rule_pkey",
1083 "columnNames": [
1084 "promotion_id",
1085 "promotion_rule_id"
1086 ],
1087 "composite": true,
1088 "constraint": true,
1089 "primary": true,
1090 "unique": true
1091 }
1092 ],
1093 "checks": [],
1094 "foreignKeys": {
1095 "promotion_promotion_rule_promotion_id_foreign": {
1096 "constraintName": "promotion_promotion_rule_promotion_id_foreign",
1097 "columnNames": [
1098 "promotion_id"
1099 ],
1100 "localTableName": "public.promotion_promotion_rule",
1101 "referencedColumnNames": [
1102 "id"
1103 ],
1104 "referencedTableName": "public.promotion",
1105 "deleteRule": "cascade",
1106 "updateRule": "cascade"
1107 },
1108 "promotion_promotion_rule_promotion_rule_id_foreign": {
1109 "constraintName": "promotion_promotion_rule_promotion_rule_id_foreign",
1110 "columnNames": [
1111 "promotion_rule_id"
1112 ],
1113 "localTableName": "public.promotion_promotion_rule",
1114 "referencedColumnNames": [
1115 "id"
1116 ],
1117 "referencedTableName": "public.promotion_rule",
1118 "deleteRule": "cascade",
1119 "updateRule": "cascade"
1120 }
1121 },
1122 "nativeEnums": {}
1123 },
1124 {
1125 "columns": {
1126 "application_method_id": {
1127 "name": "application_method_id",
1128 "type": "text",
1129 "unsigned": false,
1130 "autoincrement": false,
1131 "primary": false,
1132 "nullable": false,
1133 "mappedType": "text"
1134 },
1135 "promotion_rule_id": {
1136 "name": "promotion_rule_id",
1137 "type": "text",
1138 "unsigned": false,
1139 "autoincrement": false,
1140 "primary": false,
1141 "nullable": false,
1142 "mappedType": "text"
1143 }
1144 },
1145 "name": "application_method_target_rules",
1146 "schema": "public",
1147 "indexes": [
1148 {
1149 "keyName": "application_method_target_rules_pkey",
1150 "columnNames": [
1151 "application_method_id",
1152 "promotion_rule_id"
1153 ],
1154 "composite": true,
1155 "constraint": true,
1156 "primary": true,
1157 "unique": true
1158 }
1159 ],
1160 "checks": [],
1161 "foreignKeys": {
1162 "application_method_target_rules_application_method_id_foreign": {
1163 "constraintName": "application_method_target_rules_application_method_id_foreign",
1164 "columnNames": [
1165 "application_method_id"
1166 ],
1167 "localTableName": "public.application_method_target_rules",
1168 "referencedColumnNames": [
1169 "id"
1170 ],
1171 "referencedTableName": "public.promotion_application_method",
1172 "deleteRule": "cascade",
1173 "updateRule": "cascade"
1174 },
1175 "application_method_target_rules_promotion_rule_id_foreign": {
1176 "constraintName": "application_method_target_rules_promotion_rule_id_foreign",
1177 "columnNames": [
1178 "promotion_rule_id"
1179 ],
1180 "localTableName": "public.application_method_target_rules",
1181 "referencedColumnNames": [
1182 "id"
1183 ],
1184 "referencedTableName": "public.promotion_rule",
1185 "deleteRule": "cascade",
1186 "updateRule": "cascade"
1187 }
1188 },
1189 "nativeEnums": {}
1190 },
1191 {
1192 "columns": {
1193 "application_method_id": {
1194 "name": "application_method_id",
1195 "type": "text",
1196 "unsigned": false,
1197 "autoincrement": false,
1198 "primary": false,
1199 "nullable": false,
1200 "mappedType": "text"
1201 },
1202 "promotion_rule_id": {
1203 "name": "promotion_rule_id",
1204 "type": "text",
1205 "unsigned": false,
1206 "autoincrement": false,
1207 "primary": false,
1208 "nullable": false,
1209 "mappedType": "text"
1210 }
1211 },
1212 "name": "application_method_buy_rules",
1213 "schema": "public",
1214 "indexes": [
1215 {
1216 "keyName": "application_method_buy_rules_pkey",
1217 "columnNames": [
1218 "application_method_id",
1219 "promotion_rule_id"
1220 ],
1221 "composite": true,
1222 "constraint": true,
1223 "primary": true,
1224 "unique": true
1225 }
1226 ],
1227 "checks": [],
1228 "foreignKeys": {
1229 "application_method_buy_rules_application_method_id_foreign": {
1230 "constraintName": "application_method_buy_rules_application_method_id_foreign",
1231 "columnNames": [
1232 "application_method_id"
1233 ],
1234 "localTableName": "public.application_method_buy_rules",
1235 "referencedColumnNames": [
1236 "id"
1237 ],
1238 "referencedTableName": "public.promotion_application_method",
1239 "deleteRule": "cascade",
1240 "updateRule": "cascade"
1241 },
1242 "application_method_buy_rules_promotion_rule_id_foreign": {
1243 "constraintName": "application_method_buy_rules_promotion_rule_id_foreign",
1244 "columnNames": [
1245 "promotion_rule_id"
1246 ],
1247 "localTableName": "public.application_method_buy_rules",
1248 "referencedColumnNames": [
1249 "id"
1250 ],
1251 "referencedTableName": "public.promotion_rule",
1252 "deleteRule": "cascade",
1253 "updateRule": "cascade"
1254 }
1255 },
1256 "nativeEnums": {}
1257 },
1258 {
1259 "columns": {
1260 "id": {
1261 "name": "id",
1262 "type": "text",
1263 "unsigned": false,
1264 "autoincrement": false,
1265 "primary": false,
1266 "nullable": false,
1267 "mappedType": "text"
1268 },
1269 "value": {
1270 "name": "value",
1271 "type": "text",
1272 "unsigned": false,
1273 "autoincrement": false,
1274 "primary": false,
1275 "nullable": false,
1276 "mappedType": "text"
1277 },
1278 "promotion_rule_id": {
1279 "name": "promotion_rule_id",
1280 "type": "text",
1281 "unsigned": false,
1282 "autoincrement": false,
1283 "primary": false,
1284 "nullable": false,
1285 "mappedType": "text"
1286 },
1287 "created_at": {
1288 "name": "created_at",
1289 "type": "timestamptz",
1290 "unsigned": false,
1291 "autoincrement": false,
1292 "primary": false,
1293 "nullable": false,
1294 "length": 6,
1295 "default": "now()",
1296 "mappedType": "datetime"
1297 },
1298 "updated_at": {
1299 "name": "updated_at",
1300 "type": "timestamptz",
1301 "unsigned": false,
1302 "autoincrement": false,
1303 "primary": false,
1304 "nullable": false,
1305 "length": 6,
1306 "default": "now()",
1307 "mappedType": "datetime"
1308 },
1309 "deleted_at": {
1310 "name": "deleted_at",
1311 "type": "timestamptz",
1312 "unsigned": false,
1313 "autoincrement": false,
1314 "primary": false,
1315 "nullable": true,
1316 "length": 6,
1317 "mappedType": "datetime"
1318 }
1319 },
1320 "name": "promotion_rule_value",
1321 "schema": "public",
1322 "indexes": [
1323 {
1324 "keyName": "IDX_promotion_rule_value_promotion_rule_id",
1325 "columnNames": [],
1326 "composite": false,
1327 "constraint": false,
1328 "primary": false,
1329 "unique": false,
1330 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_rule_value_promotion_rule_id\" ON \"promotion_rule_value\" (promotion_rule_id) WHERE deleted_at IS NULL"
1331 },
1332 {
1333 "keyName": "IDX_promotion_rule_value_deleted_at",
1334 "columnNames": [],
1335 "composite": false,
1336 "constraint": false,
1337 "primary": false,
1338 "unique": false,
1339 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_rule_value_deleted_at\" ON \"promotion_rule_value\" (deleted_at) WHERE deleted_at IS NULL"
1340 },
1341 {
1342 "keyName": "IDX_promotion_rule_value_rule_id_value",
1343 "columnNames": [],
1344 "composite": false,
1345 "constraint": false,
1346 "primary": false,
1347 "unique": false,
1348 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_rule_value_rule_id_value\" ON \"promotion_rule_value\" (promotion_rule_id, value) WHERE deleted_at IS NULL"
1349 },
1350 {
1351 "keyName": "IDX_promotion_rule_value_value",
1352 "columnNames": [],
1353 "composite": false,
1354 "constraint": false,
1355 "primary": false,
1356 "unique": false,
1357 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_promotion_rule_value_value\" ON \"promotion_rule_value\" (value) WHERE deleted_at IS NULL"
1358 },
1359 {
1360 "keyName": "promotion_rule_value_pkey",
1361 "columnNames": [
1362 "id"
1363 ],
1364 "composite": false,
1365 "constraint": true,
1366 "primary": true,
1367 "unique": true
1368 }
1369 ],
1370 "checks": [],
1371 "foreignKeys": {
1372 "promotion_rule_value_promotion_rule_id_foreign": {
1373 "constraintName": "promotion_rule_value_promotion_rule_id_foreign",
1374 "columnNames": [
1375 "promotion_rule_id"
1376 ],
1377 "localTableName": "public.promotion_rule_value",
1378 "referencedColumnNames": [
1379 "id"
1380 ],
1381 "referencedTableName": "public.promotion_rule",
1382 "deleteRule": "cascade",
1383 "updateRule": "cascade"
1384 }
1385 },
1386 "nativeEnums": {}
1387 }
1388 ],
1389 "nativeEnums": {}
1390 }