
-- ABS-35936
ALTER TABLE WASHINGPROCESSALTERNATIVE
  DROP CONSTRAINT XAK1WASHINGPROCESS CASCADE;

CREATE UNIQUE INDEX XAK1WASHINGPROCESSALTERNATIVE ON WASHINGPROCESSALTERNATIVE (WASHINGPROCESS_ID , ALTERNATIVEWASHINGPROCESS_ID);

-- ABS-30100
ALTER TABLE PICKEDUPCONTAINERS
  DROP CONSTRAINT XAK1PICKEDUPCONTAINERS CASCADE;

CREATE UNIQUE INDEX XAK1PICKEDUPCONTAINERS ON PICKEDUPCONTAINERS  (STOP_ID, DISTRIBUTIONPOINT_LINK_ID, CONTAINERTYPE_ID);

-- ABS-35937
ALTER TABLE MACHINE
  DROP CONSTRAINT XAK1MACHINE CASCADE;
  
CREATE UNIQUE INDEX XAK1MACHINE ON MACHINE (PLANT_ID, CODE);

ALTER TABLE MACHINECOMPARTMENT
  DROP CONSTRAINT MACHINECOMPARTMENT_MACHINE CASCADE;

CREATE UNIQUE INDEX XAK1MACHINECOMPARTMENT ON MACHINECOMPARTMENT (MACHINE_ID, CODE);

ALTER TABLE MACHINECOMPARTMENTLIMIT
  DROP CONSTRAINT XAKMACHINECOMPARTMENTLIMIT CASCADE;
  
CREATE UNIQUE INDEX XAK1MACHINECOMPARTMENTLIMIT ON MACHINECOMPARTMENTLIMIT (MACHINECOMPARTMENT_ID, LOWERWEIGHTLIMIT);

--ABS-7437

ALTER TABLE PRODUCTIONPROCESSBUFFER 
      DROP CONSTRAINT XAK1PRODUCTIONPROCESSBUFFER CASCADE;
      
CREATE UNIQUE INDEX XAK1PRODUCTIONPROCESSBUFFER ON PRODUCTIONPROCESSBUFFER (PLANT_ID, CODE);

ALTER TABLE PLANTOPERATINGHOURS
  DROP CONSTRAINT XAK1PLANTOPERATINGHOURS CASCADE;

CREATE UNIQUE INDEX XAK1PLANTOPERATINGHOURS ON PLANTOPERATINGHOURS (PLANT_ID, DAY_ID);
