ALTER TABLE PLANPRODACABADO ADD CDFILAUXPRATORI VARCHAR2(4) NULL
/
ALTER TABLE PLANPRODACABADO ADD CDPRATOORI VARCHAR2(10) NULL
/
ALTER TABLE PLANPRODACABADO ADD CONSTRAINT FKPLA00997PRATO FOREIGN KEY (CDFILAUXPRATORI, CDPRATOORI) REFERENCES PRATO (CDFILAUXPRAT, CDPRATO)
/
CREATE INDEX FKPLA00997PRATO ON PLANPRODACABADO (CDFILAUXPRATORI, CDPRATOORI)
/
ALTER TABLE PLANPRODACABADO DROP CONSTRAINT CKC_IDORIGEM_PLANPRODACABADO
/
ALTER TABLE PLANPRODACABADO ADD CONSTRAINT CKC_IDORIGEM_PLANPRODACABADO CHECK (IDORIGEM IN ('MANUAL', 'SUBSTITUTO'))