--TD 24799

ALTER TABLE INVOICEHEADER
DROP CONSTRAINT INVOICEHEADER_PARENTINVOICEHEA;

ALTER TABLE INVOICEHEADER
ADD CONSTRAINT INVOICEHEADER_PARENTINVOICEHEA FOREIGN KEY (PARENTINVOICEHEADER_ID) REFERENCES INVOICEHEADER (INVOICEHEADER_ID) ON DELETE CASCADE;

ALTER TABLE ARTRANSACTION
DROP CONSTRAINT ARTRANSACTION_INVOICEHEADER_ID;

ALTER TABLE ARTRANSACTION
ADD CONSTRAINT ARTRANSACTION_INVOICEHEADER_ID FOREIGN KEY (INVOICEHEADER_ID) REFERENCES INVOICEHEADER (INVOICEHEADER_ID) ON DELETE SET NULL;