-- remove incorrectly assigned repaid order ids
update inquiries set repaid_order_id = null where repaid_order_id is not null and pre_payment_order_row_id is null;
