-- ABS-129161 / ABS-129261
ALTER TABLE ROUTECONTROLBULKPACKSTOP
ADD (CUSTOMER_LINK_ID NUMBER NULL,
     SEQUENCENUMBER NUMBER DEFAULT 1 NOT NULL);


COMMENT ON COLUMN ROUTECONTROLBULKPACKSTOP.CUSTOMER_LINK_ID IS
'Used for the related customer for type 2 product';

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

CREATE INDEX XIF6ROUTECONTROLBULKPACKSTOPON ON ROUTECONTROLBULKPACKSTOP(CUSTOMER_LINK_ID);
      
ALTER TABLE ROUTECONTROLBULKPACKSTOP
      ADD CONSTRAINT FK_RCBULKPACKSTOP_CUST_LK FOREIGN KEY (CUSTOMER_LINK_ID)
      REFERENCES CUSTOMER_LINK (CUSTOMER_LINK_ID);

