--ABS-46884

---------------- CLEANROOMBATCHPKBOX ----------------
ALTER TABLE CLEANROOMBATCHPKBOX ADD (CLEANROOMBATCH_ID NUMBER NOT NULL);

DROP INDEX XAK1CLEANROOMBATCHPKBOX;
CREATE INDEX XAK1CLEANROOMBATCHPKBOX ON CLEANROOMBATCHPKBOX (CLEANROOMBATCH_ID ASC, BOXNUMBER ASC);

CREATE INDEX XIF2CLEANROOMBATCHPKBOX ON CLEANROOMBATCHPKBOX (CLEANROOMBATCH_ID ASC);

ALTER TABLE CLEANROOMBATCHPKBOX
  ADD CONSTRAINT CRBPKBOX_CRB FOREIGN KEY (CLEANROOMBATCH_ID)
  REFERENCES CLEANROOMBATCH (CLEANROOMBATCH_ID) ON DELETE CASCADE;


---------------- CLEANROOMBATCHPKBOXQTY ----------------
DROP INDEX XAK1CLEANROOMBATCHPKBOXQTY;

ALTER TABLE CLEANROOMBATCHPKBOXQTY DROP COLUMN SIZEDEFINITION_LINK_ID CASCADE CONSTRAINTS;

CREATE UNIQUE INDEX XAK1CLEANROOMBATCHPKBOXQTY ON CLEANROOMBATCHPKBOXQTY (CLEANROOMBATCHPKBOX_ID ASC, PRODUCT_LINK_ID ASC, FINISHINGMETHOD_ID ASC);
