/*ORDER 501965*/      


CREATE TABLE ALTERNATIVESIZEDEFINITION(
 	 SIZEDEFINITION_ID NUMBER NOT NULL,
	 ALTERNATIVESIZEDEFINITION_ID NUMBER NOT NULL,
	 SEQUENCENUMBER NUMBER NOT NULL,
	 SYSTEMUSER_ID NUMBER NOT NULL,
	 TIMESTAMP DATE NOT NULL
);

CREATE INDEX IF1ALTERNATIVESIZEDEFINITION ON ALTERNATIVESIZEDEFINITION
  (
    SIZEDEFINITION_ID ASC
  );


CREATE INDEX IF2ALTERNATIVESIZEDEFINITION ON ALTERNATIVESIZEDEFINITION
  (
    ALTERNATIVESIZEDEFINITION_ID ASC
  );


ALTER TABLE ALTERNATIVESIZEDEFINITION
       ADD  ( CONSTRAINT XPKALTERNATIVESIZEDEFINITION PRIMARY KEY (
              SIZEDEFINITION_ID,ALTERNATIVESIZEDEFINITION_ID) );

             
ALTER TABLE ALTERNATIVESIZEDEFINITION
       ADD  ( CONSTRAINT ALTERNATIVESIZEDEFINITION_SIZE 
              FOREIGN KEY (SIZEDEFINITION_ID) 
                             REFERENCES SIZEDEFINITION
                             ON DELETE CASCADE);

                             
ALTER TABLE ALTERNATIVESIZEDEFINITION
       ADD  ( CONSTRAINT ALTERNATIVESIZEDEFINITION_ALTE 
              FOREIGN KEY (ALTERNATIVESIZEDEFINITION_ID) 
                             REFERENCES SIZEDEFINITION
                             ON DELETE CASCADE);

      /*
      CHANGE REPORT for Table PRODUCT
          - Adding column ALTERNATIVESIZERESERVATION
      ACTION is ALTER or modify Table PRODUCT
      */

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

      
      /*
      CHANGE REPORT for Table SIZEDEFINITION
          - Adding column RESERVEALTERNATIVESIZE
      ACTION is ALTER or modify Table SIZEDEFINITION
      */

ALTER TABLE SIZEDEFINITION ADD (RESERVEALTERNATIVESIZE VARCHAR2(1) DEFAULT 'N' 
    NOT NULL
                                   CONSTRAINT YN_ValidationNew143
                                          CHECK (RESERVEALTERNATIVESIZE IN ('Y',
     'N')));

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

ALTER TABLE WORKORDER ADD (RESERVATIONTIMESTAMP DATE NULL);

