 --order 502635   
      /*
      CHANGE REPORT for Table AUTOMATICFLAG
          - Adding a new relationship AUTOMATICFLAG_PLANT_ID
          WARNING : Create FK statement may fail (existing data may violate the new FK rules: adding a new FK AUTOMATICFLAG_PLANT_ID of table AUTOMATICFLAG, which references table PLANT).
          - Adding column PLANT_ID
          - Adding index XIF2AUTOMATICFLAG
      ACTION is ALTER or modify Table AUTOMATICFLAG
      */

drop sequence SEQ_AUTOMATICFLAG;

CREATE SEQUENCE SEQ_AUTOMATICFLAG
START WITH 20
INCREMENT BY 1;

ALTER TABLE AUTOMATICFLAG ADD (PLANT_ID             NUMBER NULL);

CREATE INDEX XIF2AUTOMATICFLAG ON AUTOMATICFLAG
(
       PLANT_ID                       ASC
);


ALTER TABLE AUTOMATICFLAG
       ADD  ( CONSTRAINT AUTOMATICFLAG_PLANT_ID
              FOREIGN KEY (PLANT_ID)
                             REFERENCES PLANT
                             ON DELETE CASCADE ) ;

