--Order 20015918.160

ALTER TABLE UNIQUEORPACKCONTENTS MODIFY (PACKSEQUENCE NULL);
ALTER TABLE UNIQUEORPACKCONTENTS ADD (ROWNUMBER NUMBER NULL);
ALTER TABLE UNIQUEORPACKCONTENTS ADD (POSITIONNUMBER NUMBER NULL);

DROP INDEX XAK1UNIQUEORPACKCONTENTS;
CREATE UNIQUE INDEX XAK1UNIQUEORPACKCONTENTS ON UNIQUEORPACKCONTENTS (UNIQUEITEM_ID, PACKSEQUENCE, PRODUCT_ID, SIZEDEFINITION_ID, FINISHINGMETHOD_ID, LOTNUMBER, ROWNUMBER, POSITIONNUMBER);

ALTER TABLE UNIQUEORPACKCONTENTS
  ADD CONSTRAINT UNIQUEORPACKCONT_VALID
  CHECK (( (PACKSEQUENCE IS NULL AND ROWNUMBER IS NOT NULL AND POSITIONNUMBER IS NOT NULL) OR (PACKSEQUENCE IS NOT NULL AND ROWNUMBER IS NULL AND POSITIONNUMBER IS NULL) ));
