      
      /*
      CHANGE REPORT for Table ROUTE
          - Adding column DELIVERYSCHEME_ID
          - Adding index XIF8ROUTE
      ACTION is ALTER or modify Table ROUTE
      */

ALTER TABLE ROUTE ADD (DELIVERYSCHEME_ID    NUMBER DEFAULT 0 NOT NULL);

CREATE INDEX XIF8ROUTE ON ROUTE
(
       DELIVERYSCHEME_ID              ASC
);


update route r
set r.deliveryscheme_id = (select d.deliveryscheme_id from deliveryscheme d where d.frequency = 1 and rownum=1);



ALTER TABLE ROUTE
       ADD  ( CONSTRAINT ROUTE_DELIVERYSCHEME_ID
              FOREIGN KEY (DELIVERYSCHEME_ID)
                             REFERENCES DELIVERYSCHEME ) ;

