--order 502747 (analysis changed - itest7)

/*
      CHANGE REPORT for Table STANDARDDELIVERYAMNTDETAILS
          - Adding a new relationship STANDARDDELIVERYAMNTDETAILS_DA
          WARNING : Create FK statement may fail (existing data may violate the new FK rules: adding a new FK STANDARDDELIVERYAMNTDETAILS_DA of table STANDARDDELIVERYAMNTDETAILS, which references table DAY).
          - Adding column DAY_ID
          - Adding index XIF2STANDARDDELIVERYAMNTDETAIL
          - Changing definition of index XAK1STANDARDDELIVERYAMNTDETAIL
      ACTION is ALTER or modify Table STANDARDDELIVERYAMNTDETAILS
      */

ALTER TABLE STANDARDDELIVERYAMNTDETAILS ADD (DAY_ID               NUMBER NOT 
    NULL);

CREATE INDEX XIF2STANDARDDELIVERYAMNTDETAIL ON STANDARDDELIVERYAMNTDETAILS
(
       DAY_ID                         ASC
);


ALTER TABLE STANDARDDELIVERYAMNTDETAILS
       ADD  ( CONSTRAINT STANDARDDELIVERYAMNTDETAILS_DA
              FOREIGN KEY (DAY_ID)
                             REFERENCES DAY ) ;

DROP INDEX XAK1STANDARDDELIVERYAMNTDETAIL;

CREATE UNIQUE INDEX XAK1STANDARDDELIVERYAMNTDETAIL ON STANDARDDELIVERYAMNTDETAILS
(
       STANDARDDELIVERYLINE_ID        ASC,
       ITEMNUMBER                     ASC,
       DAY_ID                         
);



