ALTER TYPE order_row_sub_type ADD VALUE 'inquiry_fee';
ALTER TYPE order_row_sub_type ADD VALUE 'pre_paid_inquiry_fee';

ALTER TYPE order_row_type ADD VALUE 'payment';

alter table inquiries add column pre_payment_order_row_id INT REFERENCES order_rows(id) DEFAULT NULL;
alter table inquiries add column repaid_order_id INT REFERENCES orders(id) DEFAULT NULL;

-- Add foreign key to original inquiry.
-- ON DELETE SET NULL so we can delete an inquiry (gdpr or otherwise) without getting a foreign key violation
ALTER TABLE inquiries ADD COLUMN duplicate_of INTEGER REFERENCES inquiries(inquiryid) ON DELETE SET NULL;

