-- ABS-130127 --

ALTER TABLE ROUTECONTROLBULKPACKSTOP ADD (PACKINGNOTELINE_ID NUMBER NULL);

DROP INDEX XAK1ROUTECONTROLBULKPACKSTOP;
CREATE UNIQUE INDEX XAK1ROUTECONTROLBULKPACKSTOP ON ROUTECONTROLBULKPACKSTOP (ROUTECONTROL_ID, STOPNUMBER, STOP_ID, PRODUCT_LINK_ID, SIZEDEFINITION_LINK_ID, FINISHINGMETHOD_ID, SEQUENCENUMBER,PACKINGNOTELINE_ID);

CREATE INDEX XIF7ROUTECONTROLBULKPACKSTOP ON ROUTECONTROLBULKPACKSTOP(PACKINGNOTELINE_ID);

ALTER TABLE ROUTECONTROLBULKPACKSTOP 
      ADD CONSTRAINT FK_RCBULKPACKSTOP_PACKINGNOTELINEID FOREIGN KEY (PACKINGNOTELINE_ID)
      REFERENCES PACKINGNOTELINE (PACKINGNOTELINE_ID) ON DELETE SET NULL;
      
