P5-6276 set payment type on all credit orders

This commit is contained in:
Martin Carlsson
2020-11-11 11:26:35 +01:00
committed by GitHub
parent b4ca1680fc
commit 417c995ad9
+7
View File
@@ -0,0 +1,7 @@
-- P5-6276: add payment type to credit orders
insert into "order-orders_fields" (orderid, fieldid, value)
select cancelled_by_order_id.value::integer, 170, payment_type.value
from "order-orders" orders
join "order-orders_fields" payment_type on payment_type.fieldid = 170 and payment_type.orderid = orders.orderid
join "order-orders_fields" cancelled_by_order_id on cancelled_by_order_id.fieldid = 238 and cancelled_by_order_id.orderid = orders.orderid;