New order rows table (#238)
Co-authored-by: Niklas Fondberg <niklas.fondberg@photowall.se> Co-authored-by: Rikard Bartholf <rikard@bartholf.nu>
This commit is contained in:
co-authored by
Niklas Fondberg
Rikard Bartholf
parent
cbffaaeee7
commit
8ef219452f
@@ -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;
|
||||
Reference in New Issue
Block a user