--- ABS-68455 / ABS-68809

----------- PACKINGNOTECONTAINERCONTENTS -----------
CREATE TABLE PACKINGNOTECONTAINERCONTENT
( PACKINGNOTECONTAINER_ID NUMBER NOT NULL,
  UNIQUEITEM_LINK_ID      NUMBER NOT NULL,
  SYSTEMUSER_ID           NUMBER NOT NULL,
  TIMESTAMP               DATE NOT NULL);

ALTER TABLE PACKINGNOTECONTAINERCONTENT
  ADD CONSTRAINT XPKPACKINGNOTECONTAINERCONTENT PRIMARY KEY (PACKINGNOTECONTAINER_ID, UNIQUEITEM_LINK_ID);

CREATE INDEX XIF1PNCONTAINERCONTENTS ON PACKINGNOTECONTAINERCONTENT (PACKINGNOTECONTAINER_ID ASC);
CREATE INDEX XIF2PNCONTAINERCONTENTS ON PACKINGNOTECONTAINERCONTENT (UNIQUEITEM_LINK_ID ASC);

ALTER TABLE PACKINGNOTECONTAINERCONTENT
  ADD CONSTRAINT PNCONTCONTENT_PNCONTAINER FOREIGN KEY (PACKINGNOTECONTAINER_ID)
  REFERENCES PACKINGNOTECONTAINER (PACKINGNOTECONTAINER_ID) ON DELETE CASCADE;
ALTER TABLE PACKINGNOTECONTAINERCONTENT
  ADD CONSTRAINT PNCONTCONTENT_UNIQUEITEM_LINK FOREIGN KEY (UNIQUEITEM_LINK_ID)
  REFERENCES UNIQUEITEM_LINK (UNIQUEITEM_LINK_ID);

----------- UHFBUNDLE -----------
ALTER TABLE UHFBUNDLE ADD (BUNDLEPRIMARYID VARCHAR2(24) NULL,
                           CREATIONDATE DATE NULL,
                           RELATEDCUSTOMER_ID NUMBER NULL);

COMMENT ON COLUMN UHFBUNDLE.BUNDLEPRIMARYID
  IS 'Identifier that can be used for printing on the bundle label.';
COMMENT ON COLUMN UHFBUNDLE.CREATIONDATE
  IS 'Can be printed on the bundle label.';

CREATE INDEX XIF4UHFBUNDLE ON UHFBUNDLE (RELATEDCUSTOMER_ID ASC);

ALTER TABLE UHFBUNDLE
  ADD CONSTRAINT UHFBUNDLE_CUSTOMER FOREIGN KEY (RELATEDCUSTOMER_ID)
  REFERENCES CUSTOMER (CUSTOMER_ID) ON DELETE SET NULL;

----------- WORKSTATION -----------
ALTER TABLE WORKSTATION MODIFY (CURRENTBATCHNO VARCHAR2(24));
