-- order 502759 (analysis changed)

ALTER TABLE ROUTEASSISTANTTRANSACTION DROP CONSTRAINT 
    ROUTEASSISTANTTRANSACTION_PRO;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP CONSTRAINT 
    ROUTEASSISTANTTRANSACTION_SIZE;
  
      /*
      CHANGE REPORT for Table ROUTEASSISTANTTRANSACTION
          - Changing definition of relation ROUTEASSISTANTTRANSACTION_PRO
          - Changing definition of relation ROUTEASSISTANTTRANSACTION_SIZE
          - Adding column PRODUCT_ID
          - Adding column SIZEDEFINITION_ID
          - Changing definition of index XIF5ROUTEASSISTANTTRANSACTION
          - Changing definition of index XIF6ROUTEASSISTANTTRANSACTION
      ACTION is ALTER or modify Table ROUTEASSISTANTTRANSACTION
      */

DROP INDEX XIF5ROUTEASSISTANTTRANSACTION;


DROP INDEX XIF6ROUTEASSISTANTTRANSACTION;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP COLUMN PRODUCT_LINK_ID;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP COLUMN SIZEDEFINITION_LINK_ID;


ALTER TABLE ROUTEASSISTANTTRANSACTION ADD (PRODUCT_ID           NUMBER NOT NULL);


ALTER TABLE ROUTEASSISTANTTRANSACTION ADD (SIZEDEFINITION_ID    NUMBER NOT NULL);


CREATE INDEX XIF5ROUTEASSISTANTTRANSACTION ON ROUTEASSISTANTTRANSACTION
(
       PRODUCT_ID                     ASC
);

CREATE INDEX XIF6ROUTEASSISTANTTRANSACTION ON ROUTEASSISTANTTRANSACTION
(
       SIZEDEFINITION_ID              ASC
);


ALTER TABLE ROUTEASSISTANTTRANSACTION
       ADD  ( CONSTRAINT ROUTEASSISTANTTRANSACTION_PRO
              FOREIGN KEY (PRODUCT_ID)
                             REFERENCES PRODUCT
                             ON DELETE CASCADE ) ;


ALTER TABLE ROUTEASSISTANTTRANSACTION
       ADD  ( CONSTRAINT ROUTEASSISTANTTRANSACTION_SIZE
              FOREIGN KEY (SIZEDEFINITION_ID)
                             REFERENCES SIZEDEFINITION
                             ON DELETE CASCADE ) ;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP CONSTRAINT 
    ROUTEASSISTANTTRANSACTION_PROD;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP CONSTRAINT 
    ROUTEASSISTANTTRANSACTION_STAN;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP CONSTRAINT 
    ROUTEASSISTANTTRANSACTION_RENT;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP CONSTRAINT 
    ROUTEASSISTANTTRANSACTION_TEMP;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP CONSTRAINT 
    ROUTEASSISTANTTRANSACTION_WEA;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP CONSTRAINT 
    ROUTEASSISTANTTRANSACTION_WEAR;


ALTER TABLE ROUTEASSISTANTTRANSACTION DROP CONSTRAINT 
    ROUTEASSISTANTTRANSACTION_UNIQ;


ALTER TABLE ROUTEASSISTANTTRANSACTION
       ADD  ( CONSTRAINT ROUTEASSISTANTTRANSACTION_PROD
              FOREIGN KEY (PRODUCTLISTPERCUSTOMER_ID)
                             REFERENCES PRODUCTLISTPERCUSTOMER
                             ON DELETE SET NULL ) ;

ALTER TABLE ROUTEASSISTANTTRANSACTION
       ADD  ( CONSTRAINT ROUTEASSISTANTTRANSACTION_STAN
              FOREIGN KEY (STANDARDDELIVERYLINE_ID)
                             REFERENCES STANDARDDELIVERYLINE
                             ON DELETE SET NULL ) ;


ALTER TABLE ROUTEASSISTANTTRANSACTION
       ADD  ( CONSTRAINT ROUTEASSISTANTTRANSACTION_RENT
              FOREIGN KEY (RENTALQTYADJUSTMENT_ID)
                             REFERENCES RENTALQTYADJUSTMENT
                             ON DELETE SET NULL ) ;

ALTER TABLE ROUTEASSISTANTTRANSACTION
       ADD  ( CONSTRAINT ROUTEASSISTANTTRANSACTION_TEMP
              FOREIGN KEY (TEMPORARYDELIVERYSTOP_ID)
                             REFERENCES TEMPORARYDELIVERYSTOP
                             ON DELETE SET NULL ) ;

ALTER TABLE ROUTEASSISTANTTRANSACTION
       ADD  ( CONSTRAINT ROUTEASSISTANTTRANSACTION_WEA
              FOREIGN KEY (WEAREREMPLOYMENT_LINK_ID)
                             REFERENCES WEAREREMPLOYMENT_LINK 
                             ON DELETE SET NULL) ;

ALTER TABLE ROUTEASSISTANTTRANSACTION
       ADD  ( CONSTRAINT ROUTEASSISTANTTRANSACTION_WEAR
              FOREIGN KEY (WEARERINVENTORY_ID)
                             REFERENCES WEARERINVENTORY 
                             ON DELETE SET NULL) ;

ALTER TABLE ROUTEASSISTANTTRANSACTION
       ADD  ( CONSTRAINT ROUTEASSISTANTTRANSACTION_UNIQ
              FOREIGN KEY (UNIQUEITEM_LINK_ID)
                             REFERENCES UNIQUEITEM_LINK
                             ON DELETE SET NULL ) ;


