      
      /*
      CHANGE REPORT for Table REASONCODE
          - Adding a new relationship REASONCODE_EXTSTOCKTRANSTYPE_I
          WARNING : Create FK statement may fail (existing data may violate the new FK rules: adding a new FK REASONCODE_EXTSTOCKTRANSTYPE_I of table REASONCODE, which references table EXTSTOCKTRANSTYPE).
          - Adding column SAMPLEISSUE
          - Adding column EXTSTOCKTRANSTYPE_ID
          - Adding column REGPHYSICALSTOCKTRANS
          - Adding index XIF1REASONCODE
      ACTION is ALTER or modify Table REASONCODE
      */

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


ALTER TABLE REASONCODE ADD (EXTSTOCKTRANSTYPE_ID NUMBER NULL);


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

CREATE INDEX XIF1REASONCODE ON REASONCODE
(
       EXTSTOCKTRANSTYPE_ID           ASC
);


ALTER TABLE REASONCODE
       ADD  ( CONSTRAINT REASONCODE_EXTSTOCKTRANSTYPE_I
              FOREIGN KEY (EXTSTOCKTRANSTYPE_ID)
                             REFERENCES EXTSTOCKTRANSTYPE ) ;

