/*order 502581*/ 
      /*
      CHANGE REPORT for Table ONSITEINVENTORYADJUSTMENT
          - Adding a new relationship ONSITEINVENTORYADJUSTMENT_INVO
          WARNING : Create FK statement may fail (existing data may violate the new FK rules: adding a new FK ONSITEINVENTORYADJUSTMENT_INVO of table ONSITEINVENTORYADJUSTMENT, which references table INVOICEHEADER).
          - Adding column INVOICEHEADER_ID
          - Adding index XIF2ONSITEINVENTORYADJUSTMENT
      ACTION is ALTER or modify Table ONSITEINVENTORYADJUSTMENT
      */

ALTER TABLE ONSITEINVENTORYADJUSTMENT ADD (INVOICEHEADER_ID     NUMBER NULL);

CREATE INDEX XIF2ONSITEINVENTORYADJUSTMENT ON ONSITEINVENTORYADJUSTMENT
(
       INVOICEHEADER_ID               ASC
);


ALTER TABLE ONSITEINVENTORYADJUSTMENT
       ADD  ( CONSTRAINT ONSITEINVENTORYADJUSTMENT_INVO
              FOREIGN KEY (INVOICEHEADER_ID)
                             REFERENCES INVOICEHEADER
                                ON DELETE SET NULL) ;

