Archive old migrations (#426)

* Archive old migrations

* Fix invalid placement of migrations
This commit is contained in:
Rikard Bartholf
2024-10-17 11:19:12 +02:00
committed by GitHub
parent 763262c108
commit ddcbd0afb0
500 changed files with 0 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
-- P5-3704 Remove state from non US orders
-- Remove state (235) values when countryCode (151) is not US
DELETE FROM "order-orders_fields"
WHERE fieldid = 235 AND orderid IN (
SELECT orders.orderid FROM "order-orders" orders
JOIN "order-orders_fields" countryCode ON countryCode.fieldid = 151 AND countryCode.orderid = orders.orderid
WHERE countryCode.value != 'US'
);
-- Remove delivery-state (242) values when delivery-countryCode (213) is not US
DELETE FROM "order-orders_fields"
WHERE fieldid = 242 AND orderid IN (
SELECT orderid FROM "order-orders_fields" WHERE fieldid = 213 AND value != 'US'
);