--ABS-113748
UPDATE SQRESIDENTIALITEM SET CLIENTDELIVERYNOTE_ID=0 WHERE CLIENTDELIVERYNOTE_ID IS NULL;
ALTER TABLE SQRESIDENTIALITEM MODIFY CLIENTDELIVERYNOTE_ID DEFAULT 0 NOT NULL;

COMMENT ON COLUMN SQRESIDENTIALITEM.CLIENTDELIVERYNOTE_ID
  IS '0 (default) not linked
>0 linked clientdeliverynote_id
<0 status not to be processed';

CREATE INDEX XAK2_SQRESIDENTIALITEM ON SQRESIDENTIALITEM (CLIENTDELIVERYNOTE_ID);
