--Order 20014102.150

ALTER TABLE UNIQUEITEMROUTE
	ADD (LASTINSTOP_ID NUMBER NULL);

ALTER TABLE UNIQUEITEMROUTE
	ADD (LASTOUTSTOP_ID NUMBER NULL);

ALTER TABLE UNIQUEITEMROUTE
	ADD (PLANNEDOUTSTOP_ID NUMBER NULL);

CREATE INDEX XIF5UNIQUEITEMROUTE ON UNIQUEITEMROUTE
(LASTINSTOP_ID   ASC);

CREATE INDEX XIF6UNIQUEITEMROUTE ON UNIQUEITEMROUTE
(LASTOUTSTOP_ID   ASC);

CREATE INDEX XIF7UNIQUEITEMROUTE ON UNIQUEITEMROUTE
(PLANNEDOUTSTOP_ID   ASC);

ALTER TABLE UNIQUEITEMROUTE
ADD CONSTRAINT STOP_LASTINUIR FOREIGN KEY (LASTINSTOP_ID) REFERENCES STOP (STOP_ID) ON DELETE SET NULL;

ALTER TABLE UNIQUEITEMROUTE
ADD CONSTRAINT STOP_LASTOUTUIR FOREIGN KEY (LASTOUTSTOP_ID) REFERENCES STOP (STOP_ID) ON DELETE SET NULL;

ALTER TABLE UNIQUEITEMROUTE
ADD CONSTRAINT STOP_PLANNEDOUTUIR FOREIGN KEY (PLANNEDOUTSTOP_ID) REFERENCES STOP (STOP_ID) ON DELETE SET NULL;
