Files
database/migrations/000.560.sql
T

10 lines
517 B
SQL

-- Updated unshipped Canada orders with DHL to FedEx Express
with unshipped_canada_orders as (
select id
from orders
where paid = 1 and confirmed = 1 and delivered = 0 and canceled = 0 and credit_invoice = 0
and market = 'CA' and delivery_method in ('dhl-dawpx-ddp', 'dhl-dawpx-dap')
) update orders set delivery_method = 'fedexExpressWorldDDP' where id in (select id from unshipped_canada_orders);
-- Too get a log which orders where updated:
-- ) select * from unshipped_canada_orders order by 1;