--Order 20011529.70

ALTER TABLE CLIENTDELIVERYNOTE
	ADD (CORRECTIONCLIENTDELNOTE_ID NUMBER NULL);

ALTER TABLE CLIENTDELIVERYNOTE
	ADD (STATUS NUMBER  DEFAULT 0 NOT NULL CONSTRAINT Status_valid3_1 CHECK (STATUS IN (0, 1)));

COMMENT ON COLUMN CLIENTDELIVERYNOTE.STATUS IS '0 = In progress
1 = Cancelled';

CREATE  INDEX XIF9CLIENTDELIVERYNOTE ON CLIENTDELIVERYNOTE
(CORRECTIONCLIENTDELNOTE_ID   ASC);

ALTER TABLE CLIENTDELIVERYNOTE
ADD CONSTRAINT CORRCLIENTDELNOTE_CLIENTDN FOREIGN KEY (CORRECTIONCLIENTDELNOTE_ID) REFERENCES CLIENTDELIVERYNOTE (CLIENTDELIVERYNOTE_ID) ON DELETE CASCADE;
