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
+12
View File
@@ -0,0 +1,12 @@
-- P5-4494: remove all contract customer discounts except general discount
ALTER TABLE contract_customers
ADD COLUMN discount INTEGER DEFAULT 0;
UPDATE contract_customers SET discount = (
SELECT discount FROM contract_customers_discounts
WHERE contractcustomerid = contract_customers.contractcustomerid
AND productgroupid IS NULL AND materialid IS NULL
);
DROP TABLE contract_customers_discounts;