/* order 502252 */      
      /*
      ACTION is CREATE Table TRUCKRELOAD
      */

CREATE SEQUENCE SEQ_TRUCKRELOAD
START WITH 1
INCREMENT BY 1;

CREATE TABLE TRUCKRELOAD (
       TRUCKRELOAD_ID       NUMBER NOT NULL,
       TRUCK_ID             NUMBER NOT NULL,
       PRODUCT_ID           NUMBER NOT NULL,
       SIZEDEFINITION_ID    NUMBER NOT NULL,
       STANDARDQTYINTRUCK   NUMBER NOT NULL,
       VIRTUALQTYINTRUCK    NUMBER NOT NULL,
       VARIATIONQTYINTRUCK  NUMBER NOT NULL,
       SYSTEMUSER_ID        NUMBER NOT NULL,
       TIMESTAMP            DATE NOT NULL
);

CREATE UNIQUE INDEX XAK1TRUCKRELOAD ON TRUCKRELOAD
(
       TRUCK_ID                       ,
       PRODUCT_ID                     ,
       SIZEDEFINITION_ID              
);

CREATE INDEX XIF1TRUCKRELOAD ON TRUCKRELOAD
(
       TRUCK_ID                       ASC
);

CREATE INDEX XIF2TRUCKRELOAD ON TRUCKRELOAD
(
       PRODUCT_ID                     ASC
);

CREATE INDEX XIF3TRUCKRELOAD ON TRUCKRELOAD
(
       SIZEDEFINITION_ID              ASC
);


ALTER TABLE TRUCKRELOAD
       ADD  ( CONSTRAINT XPKTRUCKRELOAD PRIMARY KEY (TRUCKRELOAD_ID) ) ;

      
      /*
      CHANGE REPORT for Table ROUTECONTROL
          - Adding column TRUCKRELOADCALCULATED
          - Adding index XIE2ROUTECONTROL
      ACTION is ALTER or modify Table ROUTECONTROL
      */

ALTER TABLE ROUTECONTROL ADD (TRUCKRELOADCALCULATED VARCHAR2(1) DEFAULT 'N' NOT 
    NULL
                                   CONSTRAINT YN_ValidationNew126
                                          CHECK (TRUCKRELOADCALCULATED IN ('Y', 
    'N')));

CREATE INDEX XIE2ROUTECONTROL ON ROUTECONTROL
(
       TRUCKRELOADCALCULATED          ASC
);

      
      /*
      CHANGE REPORT for Table STANDARDLOCATIONPERPRODUCT
          - Adding column STANDARDTRUCKLOAD
      ACTION is ALTER or modify Table STANDARDLOCATIONPERPRODUCT
      */

ALTER TABLE STANDARDLOCATIONPERPRODUCT ADD (STANDARDTRUCKLOAD    NUMBER DEFAULT 
    0 NOT NULL);

      
      /*
      CHANGE REPORT for Table STANDARDLOCATIONPERSIZE
          - Adding column STANDARDTRUCKLOAD
      ACTION is ALTER or modify Table STANDARDLOCATIONPERSIZE
      */

ALTER TABLE STANDARDLOCATIONPERSIZE ADD (STANDARDTRUCKLOAD    NUMBER DEFAULT 0 
    NOT NULL);


ALTER TABLE TRUCKRELOAD
       ADD  ( CONSTRAINT TRUCKRELOAD_SIZEDEFINITION_ID
              FOREIGN KEY (SIZEDEFINITION_ID)
                             REFERENCES SIZEDEFINITION ) ;


ALTER TABLE TRUCKRELOAD
       ADD  ( CONSTRAINT TRUCKRELOAD_PRODUCT_ID
              FOREIGN KEY (PRODUCT_ID)
                             REFERENCES PRODUCT ) ;


ALTER TABLE TRUCKRELOAD
       ADD  ( CONSTRAINT TRUCKRELOAD_TRUCK_ID
              FOREIGN KEY (TRUCK_ID)
                             REFERENCES TRUCK ) ;



