--ABSN-11475

--STOP TABLE
ALTER TABLE STOP DROP CONSTRAINT STOP_MOVEDTOSTOP_ID;
ALTER TABLE STOP ADD CONSTRAINT FK_STOP_MOVEDTOSTOP_ID FOREIGN KEY (MOVEDTOSTOP_ID) REFERENCES STOP (STOP_ID) ON DELETE CASCADE;

--UNIQUEITEM_LINK TABLE
ALTER TABLE UNIQUEITEM_LINK DROP CONSTRAINT UNIQUEITEM_LINK_RAGGEDITEM_ID;
ALTER TABLE UNIQUEITEM_LINK ADD CONSTRAINT FK_UNIQUEITEMLINK_RAGGEDITEM_ID FOREIGN KEY (RAGGEDITEM_ID) REFERENCES RAGGEDITEM (RAGGEDITEM_ID) ON DELETE SET NULL;

--UNIQUERESIDENTIALITEM_LINK TABLE
ALTER TABLE UNIQUERESIDENTIALITEM_LINK DROP CONSTRAINT UNIQUERESIITEM_LINK_RAGGEDRESI;
ALTER TABLE UNIQUERESIDENTIALITEM_LINK ADD CONSTRAINT FK_UNIQUERESIITEMLINK_RAGGEDRESI FOREIGN KEY (RAGGEDRESIDENTIALITEM_ID) 
            REFERENCES RAGGEDRESIDENTIALITEM (RAGGEDRESIDENTIALITEM_ID) ON DELETE SET NULL;
            
--CLIENTDELNOTELINEDELAYED TABLE
ALTER TABLE CLIENTDELNOTELINEDELAYED DROP CONSTRAINT CLIENTDELNOTELINEDELAYED_DELIV;
ALTER TABLE CLIENTDELNOTELINEDELAYED ADD CONSTRAINT FK_CLIENTDELNOTELINEDELAYED_DELLINE_ID FOREIGN KEY (DELIVERDLINE_ID)
            REFERENCES CLIENTDELIVERYNOTELINE (CLIENTDELIVERYNOTELINE_ID) ON DELETE SET NULL;
