--ABS-113854
CREATE SEQUENCE SEQ_PACKINGNOTECONTAINERQTY 
START WITH 1
INCREMENT BY 1;

CREATE TABLE PACKINGNOTECONTAINERQTY
(
  PACKINGNOTECONTAINERQTY_ID NUMBER NOT NULL,
  PACKINGNOTECONTAINER_ID    NUMBER NOT NULL,
  PACKINGNOTELINE_ID         NUMBER NOT NULL,
  DELIVEREDQTY               NUMBER NOT NULL,
  SYSTEMUSER_ID              NUMBER NOT NULL,
  TIMESTAMP                  DATE NOT NULL
);
ALTER TABLE PACKINGNOTECONTAINERQTY
  ADD CONSTRAINT XPKPACKINGNOTECONTAINERQTY PRIMARY KEY (PACKINGNOTECONTAINERQTY_ID);
CREATE INDEX XIF1PNCONTAINERQTY ON PACKINGNOTECONTAINERQTY (PACKINGNOTECONTAINER_ID);
CREATE INDEX XIF2PNCONTAINERQTY ON PACKINGNOTECONTAINERQTY (PACKINGNOTELINE_ID);
CREATE UNIQUE INDEX XAK1PACKINGNOTECONTAINERQTY ON PACKINGNOTECONTAINERQTY
(PACKINGNOTELINE_ID ASC,PACKINGNOTECONTAINER_ID ASC);
ALTER TABLE PACKINGNOTECONTAINERQTY
  ADD CONSTRAINT PNCONTAINERQTYPNCONTAINER FOREIGN KEY (PACKINGNOTECONTAINER_ID)
  REFERENCES PACKINGNOTECONTAINER (PACKINGNOTECONTAINER_ID) ON DELETE CASCADE;
ALTER TABLE PACKINGNOTECONTAINERQTY
  ADD CONSTRAINT PNCONTAINERQTYPNLINE FOREIGN KEY (PACKINGNOTELINE_ID)
  REFERENCES PACKINGNOTELINE (PACKINGNOTELINE_ID) ON DELETE CASCADE;

