--Order 20014209.80

ALTER TABLE PICKLISTLINELOCATION
  ADD (FORCESTOCKCOUNT NUMBER  DEFAULT 0 NOT NULL CONSTRAINT FORCESTOCKCOUNT_VALID CHECK (FORCESTOCKCOUNT IN (0, 1)));

COMMENT ON COLUMN PICKLISTLINELOCATION.FORCESTOCKCOUNT IS '0 – No stock count needed (default) 1 – A stock count should be done';


ALTER TABLE PICKLISTPICKINGSEQUENCE
  ADD (FORCESTOCKCOUNT NUMBER  DEFAULT 0 NOT NULL CONSTRAINT FORCESTOCKCOUNT_VALID1 CHECK (FORCESTOCKCOUNT IN (0, 1, 2)));
  
  ALTER TABLE PICKLISTPICKINGSEQUENCE
  ADD (STOCKCOUNTDATE DATE NULL);

COMMENT ON COLUMN PICKLISTPICKINGSEQUENCE.FORCESTOCKCOUNT IS '0 – No stock count needed (default) 1 – A stock count should be done 2 – A stock count has been done ';

ALTER TABLE PICKLISTPICKINGSEQUENCE DROP CONSTRAINT PICKLISTPICKSEQ_PICKLISTLINE_I;
ALTER TABLE PICKLISTPICKINGSEQUENCE DROP CONSTRAINT PICKLISTPICKSEQ_PICKLISTLOC;
ALTER TABLE PICKLISTPICKINGSEQUENCE DROP CONSTRAINT PICKLISTPICKSEQ_PICKLISTORIGIN;

ALTER TABLE PICKLISTPICKINGSEQUENCE
  ADD CONSTRAINT PICKLISTPICKSEQ_PICKLISTLINE_I FOREIGN KEY (PICKLISTLINE_ID)
  REFERENCES PICKLISTLINE (PICKLISTLINE_ID) ON DELETE CASCADE;
  
ALTER TABLE PICKLISTPICKINGSEQUENCE
  ADD CONSTRAINT PICKLISTPICKSEQ_PICKLISTLOC FOREIGN KEY (PICKLISTLOCATION_ID)
  REFERENCES PICKLISTLINELOCATION (PICKLISTLOCATION_ID) ON DELETE CASCADE;
  
ALTER TABLE PICKLISTPICKINGSEQUENCE
  ADD CONSTRAINT PICKLISTPICKSEQ_PICKLISTORIGIN FOREIGN KEY (PICKLISTLINEORIGIN_ID)
  REFERENCES PICKLISTLINEORIGIN (PICKLISTLINEORIGIN_ID) ON DELETE CASCADE;