-- ABS-127177/ ABS-127179

ALTER TABLE SORTBATCHDEFINITIONDETAIL
  DROP CONSTRAINT FK_SORTBATCHDEFDET_ROUTESTOP;
ALTER TABLE SORTBATCHDEFINITIONDETAIL
  ADD CONSTRAINT FK_SORTBATCHDEFDET_ROUTESTOP FOREIGN KEY (ROUTESTOP_ID)
  REFERENCES ROUTESTOP (ROUTESTOP_ID) ON DELETE CASCADE;

ALTER TABLE SORTBATCHDEFINITIONDETAIL
  DROP CONSTRAINT FK_SORTBATCHDEFDET_SORTBATCHDEF;
ALTER TABLE SORTBATCHDEFINITIONDETAIL
  ADD CONSTRAINT FK_SORTBATCHDEFDET_SORTBATCHDEF FOREIGN KEY (SORTBATCHDEFINITION_ID)
  REFERENCES SORTBATCHDEFINITION (SORTBATCHDEFINITION_ID) ON DELETE CASCADE;