-- 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;
