      /*
      CHANGE REPORT for Table PACKINGNOTE
          - Changing column definition of ORIGIN
      ACTION is ALTER or modify Table PACKINGNOTE
      */

COMMENT ON COLUMN PACKINGNOTE.ORIGIN IS '0 = Generated based on Order
1 = Manually added
2 = Generated based on Outscan
3 = Quantity Correction Ticket
4 = Stock Delivery Note
5 = Special Order
6 = Bulk Note
7 = Bin Note
8 = Transfer Weights
9 = Mounting Order';

      /*
      CHANGE REPORT for Table PACKINGNOTELINE
          - Changing column definition of ORIGIN
      ACTION is ALTER or modify Table PACKINGNOTELINE
      */

COMMENT ON COLUMN PACKINGNOTELINE.ORIGIN IS '0 = Generated based on Order
1 = Manually added
2 = Generated based on Outscan
3 = Quantity Correction Ticket
4 = Stock Delivery Note
9 = Mounting Order';

ALTER TABLE PACKINGNOTELINE ADD (MOUNTINGORDERLINE_ID     NUMBER NULL);

CREATE INDEX XIF7PACKINGNOTELINE ON PACKINGNOTELINE
(
       MOUNTINGORDERLINE_ID           ASC
);

ALTER TABLE PACKINGNOTELINE
       ADD  ( CONSTRAINT PACKINGNOTELINE_MOUNTINGORDERL
              FOREIGN KEY (MOUNTINGORDERLINE_ID)
                             REFERENCES WORKORDERLINE ) ;

      /*
      CHANGE REPORT for Table WORKORDER
          - Adding a new relationship WORKORDER_WORKORDER_ID
          WARNING : Create FK statement may fail (existing data may violate the new FK rules: adding a new FK WORKORDER_WORKORDER_ID of table WORKORDER, which references table WORKORDER).
          - Adding column MOUNTINGORDER_ID
          - Adding column MOUNTINGORDERSALES
      ACTION is ALTER or modify Table WORKORDER
      */


ALTER TABLE WORKORDER ADD (MOUNTINGORDER_ID     NUMBER NULL);


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

CREATE INDEX XIF19WORKORDER ON WORKORDER
(
       MOUNTINGORDER_ID           ASC
);

ALTER TABLE WORKORDER
       ADD  ( CONSTRAINT WORKORDER_WORKORDER_ID
              FOREIGN KEY (MOUNTINGORDER_ID)
                             REFERENCES WORKORDER ) ;