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
+13
View File
@@ -0,0 +1,13 @@
-- migrate email and phone to addresses table
ALTER TABLE addresses ADD column IF NOT EXISTS email text;
ALTER TABLE addresses ADD column IF NOT EXISTS phone text;
UPDATE addresses SET phone = oo.phone, email = oo.email FROM orders oo WHERE addresses.id = oo.billing_address_id;
UPDATE addresses SET phone = oo.delivery_phone, email = oo.delivery_email FROM orders oo WHERE addresses.id = oo.delivery_address_id;
-- ALTER table orders drop column phone;
-- ALTER table orders drop column email;
-- ALTER table orders drop column delivery_email;
-- ALTER table orders drop column delivery_phone;