--Order 20013877

---ROUTECONTROL table---

CREATE INDEX XIE9ROUTECONTROL ON ROUTECONTROL
(PLANT_ID   ASC,DRIVINGDATE   ASC);

---ROUTETRANSACTION table---

ALTER TABLE ROUTETRANSACTION
	ADD (PLPC_ID NUMBER NULL);

ALTER TABLE ROUTETRANSACTION
	ADD (OLDPLPC_ID NUMBER NULL);

CREATE INDEX XIF11ROUTETRANSACTION ON ROUTETRANSACTION
(PLPC_ID   ASC);

CREATE INDEX XIF12ROUTETRANSACTION ON ROUTETRANSACTION
(OLDPLPC_ID   ASC);

ALTER TABLE ROUTETRANSACTION
ADD CONSTRAINT ROUTETRANSACTION_PLPC FOREIGN KEY (PLPC_ID) REFERENCES PRODUCTLISTPERCUSTOMER (PRODUCTLISTPERCUSTOMER_ID) ON DELETE SET NULL;

ALTER TABLE ROUTETRANSACTION
ADD CONSTRAINT ROUTETRANSACTION_OLDPLPC FOREIGN KEY (OLDPLPC_ID) REFERENCES PRODUCTLISTPERCUSTOMER (PRODUCTLISTPERCUSTOMER_ID) ON DELETE SET NULL;