--order 502608      
      /*
      ACTION is CREATE Table PLANTPRODUCTGROUPSETTINGS
      */

CREATE TABLE PLANTPRODUCTGROUPSETTINGS (
       PLANT_ID             NUMBER NOT NULL,
       PRODUCTGROUP_ID      NUMBER NOT NULL,
       DEFAULTSTOCKROOM_ID  NUMBER NULL,
       FIXEDSTOCKROOM       VARCHAR2(1) DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_ValidationField192
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N')),
       SPECIALSDEFAULTSTOCKROOM_ID NUMBER NULL,
       SPECIALSFIXEDSTOCKROOM VARCHAR2(1) DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_ValidationField193
                                          CHECK (SPECIALSFIXEDSTOCKROOM IN ('Y', 'N')),
       ACTIVE               VARCHAR2(1) DEFAULT 'Y' NOT NULL
                                   CONSTRAINT YN_ValidationField194
                                          CHECK (ACTIVE IN ('Y', 'N')),
       SYSTEMUSER_ID        NUMBER NOT NULL,
       TIMESTAMP            DATE NOT NULL
);

ALTER TABLE PLANTPRODUCTGROUPSETTINGS 
  ADD CONSTRAINT CHK_DEFAULT_STOCK_FIXED_PPGS
 CHECK ((FIXEDSTOCKROOM = 'Y' AND DEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (FIXEDSTOCKROOM = 'N')) ;

ALTER TABLE PLANTPRODUCTGROUPSETTINGS 
  ADD CONSTRAINT CHK_SPEC_DEF_STOCK_FIX_PPGS
 CHECK ((SPECIALSFIXEDSTOCKROOM = 'Y' AND SPECIALSDEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (SPECIALSFIXEDSTOCKROOM = 'N')) ;

CREATE INDEX XIF1PLANTPRODUCTGROUPSETTINGS ON PLANTPRODUCTGROUPSETTINGS
(
       PLANT_ID                       ASC
);

CREATE INDEX XIF2PLANTPRODUCTGROUPSETTINGS ON PLANTPRODUCTGROUPSETTINGS
(
       PRODUCTGROUP_ID                ASC
);

CREATE INDEX XIF3PLANTPRODUCTGROUPSETTINGS ON PLANTPRODUCTGROUPSETTINGS
(
       DEFAULTSTOCKROOM_ID            ASC
);

CREATE INDEX XIF4PLANTPRODUCTGROUPSETTINGS ON PLANTPRODUCTGROUPSETTINGS
(
       SPECIALSDEFAULTSTOCKROOM_ID    ASC
);


ALTER TABLE PLANTPRODUCTGROUPSETTINGS
       ADD  ( CONSTRAINT XPKPLANTPRODUCTGROUPSETTINGS PRIMARY KEY (
              PLANT_ID, PRODUCTGROUP_ID) ) ;

      
      /*
      CHANGE REPORT for Table PLANTPRODUCTSETTINGS
          - Adding a new relationship PLANTPRODUCTSETTINGS_DEFAULTST
          - Adding column DEFAULTSTOCKROOM_ID
          - Adding column FIXEDSTOCKROOM
          - Adding index XIF5PLANTPRODUCTSETTINGS
      ACTION is ALTER or modify Table PLANTPRODUCTSETTINGS
      */

ALTER TABLE PLANTPRODUCTSETTINGS ADD (DEFAULTSTOCKROOM_ID  NUMBER NULL);


ALTER TABLE PLANTPRODUCTSETTINGS ADD (FIXEDSTOCKROOM       VARCHAR2(1) DEFAULT 
    'N' NOT NULL
                                   CONSTRAINT YN_ValidationField195
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N')))
    ;

ALTER TABLE PLANTPRODUCTSETTINGS
  ADD CONSTRAINT CHK_DEFAULT_STOCK_FIXED_PPS
 CHECK ((FIXEDSTOCKROOM = 'Y' AND DEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (FIXEDSTOCKROOM = 'N')) ;

CREATE INDEX XIF5PLANTPRODUCTSETTINGS ON PLANTPRODUCTSETTINGS
(
       DEFAULTSTOCKROOM_ID            ASC
);

      
      /*
      CHANGE REPORT for Table PLANTPRODUCTSIZESETTINGS
          - Adding a new relationship PLANTPRODUCTSIZESETTINGS_DEFAU
          - Adding column DEFAULTSTOCKROOM_ID
          - Adding column FIXEDSTOCKROOM
          - Adding index XIF4PLANTPRODUCTSIZESETTINGS
      ACTION is ALTER or modify Table PLANTPRODUCTSIZESETTINGS
      */

ALTER TABLE PLANTPRODUCTSIZESETTINGS ADD (DEFAULTSTOCKROOM_ID  NUMBER NULL);


ALTER TABLE PLANTPRODUCTSIZESETTINGS ADD (FIXEDSTOCKROOM       VARCHAR2(1) 
    DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_Validation196
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N')));

ALTER TABLE PLANTPRODUCTSIZESETTINGS 
  ADD CONSTRAINT CHK_DEFAULT_STOCK_FIXED_PPSS
 CHECK ((FIXEDSTOCKROOM = 'Y' AND DEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (FIXEDSTOCKROOM = 'N')) ;

CREATE INDEX XIF4PLANTPRODUCTSIZESETTINGS ON PLANTPRODUCTSIZESETTINGS
(
       DEFAULTSTOCKROOM_ID            ASC
);

      
      /*
      CHANGE REPORT for Table PRODUCT
          - Adding a new relationship PROD_DEFAULTSTOCKROOM_ID
          - Adding column DEFAULTSTOCKROOM_ID
          - Adding column FIXEDSTOCKROOM
      ACTION is ALTER or modify Table PRODUCT
      */

ALTER TABLE PRODUCT ADD (DEFAULTSTOCKROOM_ID  NUMBER NULL);


ALTER TABLE PRODUCT ADD (FIXEDSTOCKROOM       VARCHAR2(1) DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_Validation197
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N')));

ALTER TABLE PRODUCT
  ADD CONSTRAINT CHK_DEFAULT_STOCK_FIXED_P
 CHECK ((FIXEDSTOCKROOM = 'Y' AND DEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (FIXEDSTOCKROOM = 'N')) ;

CREATE INDEX XIF25PRODUCT ON PRODUCT
(
       DEFAULTSTOCKROOM_ID            ASC
);
      
      /*
      CHANGE REPORT for Table PRODUCTGROUP
          - Adding a new relationship PRODGR_DEFAULTSTOCKROOM_ID
          - Adding a new relationship PRODGR_SPECIALDEFSTOCKROOM_ID
          - Adding column DEFAULTSTOCKROOM_ID
          - Adding column FIXEDSTOCKROOM
          - Adding column SPECIALSDEFAULTSTOCKROOM_ID
          - Adding column SPECIALSFIXEDSTOCKROOM
          - Adding index XIF10PRODUCTGROUP
          - Adding index XIF11PRODUCTGROUP
      ACTION is ALTER or modify Table PRODUCTGROUP
      */

ALTER TABLE PRODUCTGROUP ADD (DEFAULTSTOCKROOM_ID  NUMBER NULL);


ALTER TABLE PRODUCTGROUP ADD (FIXEDSTOCKROOM       VARCHAR2(1) DEFAULT 'N' NOT 
    NULL
                                   CONSTRAINT YN_Validation198
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N'))) ;

ALTER TABLE PRODUCTGROUP
  ADD CONSTRAINT CHK_DEFAULT_STOCK_FIXED_PG
 CHECK ((FIXEDSTOCKROOM = 'Y' AND DEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (FIXEDSTOCKROOM = 'N')) ;

ALTER TABLE PRODUCTGROUP ADD (SPECIALSDEFAULTSTOCKROOM_ID NUMBER NULL);


ALTER TABLE PRODUCTGROUP ADD (SPECIALSFIXEDSTOCKROOM VARCHAR2(1) DEFAULT 'N' 
    NOT NULL
                                   CONSTRAINT YN_Validation199
                                          CHECK (SPECIALSFIXEDSTOCKROOM IN ('Y',
     'N')));

ALTER TABLE PRODUCTGROUP
  ADD CONSTRAINT CHK_SPEC_DEF_STOCK_FIX_PG
 CHECK ((SPECIALSFIXEDSTOCKROOM = 'Y' AND SPECIALSDEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (SPECIALSFIXEDSTOCKROOM = 'N')) ;

CREATE INDEX XIF10PRODUCTGROUP ON PRODUCTGROUP
(
       DEFAULTSTOCKROOM_ID            ASC
);

CREATE INDEX XIF11PRODUCTGROUP ON PRODUCTGROUP
(
       SPECIALSDEFAULTSTOCKROOM_ID    ASC
);

      
      /*
      CHANGE REPORT for Table PRODUCTGROUPPERCUSTOMER
          - Adding a new relationship PGPC_DEFAULTSTOCKROOM_ID
          - Adding column DEFAULTSTOCKROOM_ID
          - Adding column FIXEDSTOCKROOM
          - Adding index XIF3PRODUCTGROUPPERCUSTOMER
      ACTION is ALTER or modify Table PRODUCTGROUPPERCUSTOMER
      */

ALTER TABLE PRODUCTGROUPPERCUSTOMER ADD (DEFAULTSTOCKROOM_ID  NUMBER NULL);


ALTER TABLE PRODUCTGROUPPERCUSTOMER ADD (FIXEDSTOCKROOM       VARCHAR2(1) 
    DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_ValidationField200
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N')));

ALTER TABLE PRODUCTGROUPPERCUSTOMER
  ADD CONSTRAINT CHK_DEFAULT_STOCK_FIXED_PGPC
 CHECK ((FIXEDSTOCKROOM = 'Y' AND DEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (FIXEDSTOCKROOM = 'N')) ;


CREATE INDEX XIF3PRODUCTGROUPPERCUSTOMER ON PRODUCTGROUPPERCUSTOMER
(
       DEFAULTSTOCKROOM_ID            ASC
);

      
      /*
      CHANGE REPORT for Table PRODUCTLISTPERCUSTOMER
          - Adding column DEFAULTSTOCKROOM_ID
          - Adding column FIXEDSTOCKROOM
          - Adding index XIF19PRODUCTLISTPERCUSTOMER
      ACTION is ALTER or modify Table PRODUCTLISTPERCUSTOMER
      */

ALTER TABLE PRODUCTLISTPERCUSTOMER ADD (DEFAULTSTOCKROOM_ID  NUMBER NULL);


ALTER TABLE PRODUCTLISTPERCUSTOMER ADD (FIXEDSTOCKROOM       VARCHAR2(1) 
    DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_Validation201
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N')))
    ;

ALTER TABLE PRODUCTLISTPERCUSTOMER
  ADD CONSTRAINT CHK_DEFAULT_STOCK_FIXED_PLPC
 CHECK ((FIXEDSTOCKROOM = 'Y' AND DEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (FIXEDSTOCKROOM = 'N')) ;


CREATE INDEX XIF19PRODUCTLISTPERCUSTOMER ON PRODUCTLISTPERCUSTOMER
(
       DEFAULTSTOCKROOM_ID            ASC
);


      
      /*
      CHANGE REPORT for Table PRODUCTSIZE
          - Adding a new relationship PRODUCTSIZE_DEFAULTSTOCKROOM_I
          - Adding column DEFAULTSTOCKROOM_ID
          - Adding column FIXEDSTOCKROOM
          - Adding index XIF4PRODUCTSIZE
      ACTION is ALTER or modify Table PRODUCTSIZE
      */

ALTER TABLE PRODUCTSIZE ADD (DEFAULTSTOCKROOM_ID  NUMBER NULL);


ALTER TABLE PRODUCTSIZE ADD (FIXEDSTOCKROOM       VARCHAR2(1) DEFAULT 'N' NOT 
    NULL
                                   CONSTRAINT YN_Validation202
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N')));

ALTER TABLE PRODUCTSIZE
  ADD CONSTRAINT CHK_DEFAULT_STOCK_FIXED_PS
 CHECK ((FIXEDSTOCKROOM = 'Y' AND DEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (FIXEDSTOCKROOM = 'N')) ;

CREATE INDEX XIF4PRODUCTSIZE ON PRODUCTSIZE
(
       DEFAULTSTOCKROOM_ID            ASC
);

      
      /*
      CHANGE REPORT for Table REASONCODE
          - Adding a new relationship REASONCODE_DEFAULTSTOCKROOM_ID
          - Adding column DEFAULTSTOCKROOM_ID
          - Adding column FIXEDSTOCKROOM
          - Adding index XIF2REASONCODE
      ACTION is ALTER or modify Table REASONCODE
      */

ALTER TABLE REASONCODE ADD (DEFAULTSTOCKROOM_ID  NUMBER NULL);


ALTER TABLE REASONCODE ADD (FIXEDSTOCKROOM       VARCHAR2(1) DEFAULT 'N' NOT 
    NULL
                                   CONSTRAINT YN_Validation203
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N')));

ALTER TABLE REASONCODE
  ADD CONSTRAINT CHK_DEFAULT_STOCK_FIXED_RC
 CHECK ((FIXEDSTOCKROOM = 'Y' AND DEFAULTSTOCKROOM_ID IS NOT NULL)  OR  (FIXEDSTOCKROOM = 'N')) ;

CREATE INDEX XIF2REASONCODE ON REASONCODE
(
       DEFAULTSTOCKROOM_ID            ASC
);

      
      /*
      CHANGE REPORT for Table SYSTEMUSER
          - Adding column MAYCHANGESTOCKROOMFORWO
          - Adding column MAYCHANGESTOCKROOMFORMO
      ACTION is ALTER or modify Table SYSTEMUSER
      */

ALTER TABLE SYSTEMUSER ADD (MAYCHANGESTOCKROOMFORWO VARCHAR2(1) DEFAULT 'N' NOT 
    NULL
                                   CONSTRAINT YN_Validation204
                                          CHECK (MAYCHANGESTOCKROOMFORWO IN 
    ('Y', 'N')));


ALTER TABLE SYSTEMUSER ADD (MAYCHANGESTOCKROOMFORMO VARCHAR2(1) DEFAULT 'N' NOT 
    NULL
                                   CONSTRAINT YN_Validation205
                                          CHECK (MAYCHANGESTOCKROOMFORMO IN 
    ('Y', 'N')));

      
      /*
      CHANGE REPORT for Table WORKORDER
          - Adding column FIXEDSTOCKROOM
          - Adding column EXPRESSORDER
      ACTION is ALTER or modify Table WORKORDER
      */

ALTER TABLE WORKORDER ADD (FIXEDSTOCKROOM       VARCHAR2(1) DEFAULT 'N' NOT 
    NULL
                                   CONSTRAINT YN_Validation206
                                          CHECK (FIXEDSTOCKROOM IN ('Y', 'N')));


ALTER TABLE WORKORDER ADD (EXPRESSORDER         VARCHAR2(1) DEFAULT 'N' NOT 
    NULL
                                   CONSTRAINT YN_ValidationField207
                                          CHECK (EXPRESSORDER IN ('Y', 'N')));


ALTER TABLE PLANTPRODUCTGROUPSETTINGS
       ADD  ( CONSTRAINT PLANTPRODUCTGROUPSETTINGS_SPEC
              FOREIGN KEY (SPECIALSDEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;


ALTER TABLE PLANTPRODUCTGROUPSETTINGS
       ADD  ( CONSTRAINT PLANTPRODUCTGROUPSETTINGS_DEFA
              FOREIGN KEY (DEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;


ALTER TABLE PLANTPRODUCTGROUPSETTINGS
       ADD  ( CONSTRAINT PLANTPRODUCTGROUPSETTINGS_PROD
              FOREIGN KEY (PRODUCTGROUP_ID)
                             REFERENCES PRODUCTGROUP 
                             ON DELETE CASCADE) ;


ALTER TABLE PLANTPRODUCTGROUPSETTINGS
       ADD  ( CONSTRAINT PLANTPRODUCTGROUPSETTINGS_PLAN
              FOREIGN KEY (PLANT_ID)
                             REFERENCES PLANT
                             ON DELETE CASCADE ) ;


ALTER TABLE PLANTPRODUCTSETTINGS
       ADD  ( CONSTRAINT PLANTPRODUCTSETTINGS_DEFAULTST
              FOREIGN KEY (DEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;


ALTER TABLE PLANTPRODUCTSIZESETTINGS
       ADD  ( CONSTRAINT PLANTPRODUCTSIZESETTINGS_DEFAU
              FOREIGN KEY (DEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;


ALTER TABLE PRODUCT
       ADD  ( CONSTRAINT PROD_DEFAULTSTOCKROOM_ID
              FOREIGN KEY (DEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;

ALTER TABLE PRODUCTGROUP
       ADD  ( CONSTRAINT PRODGR_DEFAULTSTOCKROOM_ID
              FOREIGN KEY (DEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;

ALTER TABLE PRODUCTGROUP
       ADD  ( CONSTRAINT PRODGR_SPECIALDEFSTOCKROOM_ID
              FOREIGN KEY (SPECIALSDEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;

ALTER TABLE PRODUCTGROUPPERCUSTOMER
       ADD  ( CONSTRAINT PGPC_DEFAULTSTOCKROOM_ID
              FOREIGN KEY (DEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;


ALTER TABLE PRODUCTLISTPERCUSTOMER
       ADD  ( CONSTRAINT PLPC_DEFAULTSTOCKROOM_ID
              FOREIGN KEY (DEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;


ALTER TABLE PRODUCTSIZE
       ADD  ( CONSTRAINT PRODUCTSIZE_DEFAULTSTOCKROOM_I
              FOREIGN KEY (DEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;


ALTER TABLE REASONCODE
       ADD  ( CONSTRAINT REASONCODE_DEFAULTSTOCKROOM_ID
              FOREIGN KEY (DEFAULTSTOCKROOM_ID)
                             REFERENCES STOCKROOM ) ;



