ALTER TABLE AUTGRUPOP DROP CONSTRAINT CKC_IDAUTGRUPOP
/ 

ALTER TABLE AUTGRUPOP ADD CONSTRAINT CKC_IDAUTGRUPOP CHECK (  
   IDAUTGRUPOP IN ('PCMP','PROD','INAC','ALAC','ENAC','VIAC','INDF','STAR','VALI', 
                   'CONT','VPLA','VPLT','VERI','QUAL','VLIB','CINS','CANA','LLOT', 
                   'FINC','TARE','IRET','RCUS','MABD','BLPR','CARD','REIP','ENAF', 
                   'CAAF','ABAF','APRC','PLPR','CFEC','APBC','REBC','BSOL','BKGA', 
                   'ARRV','SFOS','LBPS','APCO','EFCO','CACO','ALCO','LCMR','LRCD', 
                   'EXBR','EXBP','PROP','APAF','GEAF','RECC','EXCP','EMAP','ACSA', 
                   'AAPR','ACRM','COIM','ACTF','ACPS','PSUP','MTRA','PAOC','INCT', 
                   'CMIS','CENA','GECO','ESVN','GEST','GGER','GAUD','CRMP','CRMR', 
                   'CDGE','ALAT','ACET','ATPR','CLOT','ADSO','APSG','BLOL','AUDP', 
                   'CPRC','SVOL','PROC','DELI','METC','CONF','LOGS','LOGC','PEOL', 
                   'EXAF','SBTP','ACEP','DPAP','ATLC','PEME','PRVE','PRVC','EEEA',
                   'BLIP','TPED','ALTC','ALTP','ALEE','ALEP','AUPA','ALAF','IINP', 
                   'LIRB','ALOP','CQTD','EXCA','IEIA','COFO'))
/

ALTER TABLE PARAMESTOQUE ADD CDGROPERATUEST VARCHAR2(2)
/

CREATE INDEX MAN02319_FK ON PARAMESTOQUE (CDGROPERATUEST ASC)
/

ALTER TABLE PARAMESTOQUE
  ADD CONSTRAINT FKMAN02319GRUPOPER FOREIGN KEY(CDGROPERATUEST)
    REFERENCES GRUPOPER (CDGRUPOPER)
/


ALTER TABLE ORDPRODUCAO ADD CDOPERADOR VARCHAR2(12)
/

CREATE INDEX MAN02320_FK ON ORDPRODUCAO (CDOPERADOR ASC)
/

ALTER TABLE ORDPRODUCAO
  ADD CONSTRAINT FKMAN02320PERADOR FOREIGN KEY(CDOPERADOR)
    REFERENCES OPERADOR(CDOPERADOR)
/

ALTER TABLE LANCTOESTOQ ADD CDOPERAUTORIZA VARCHAR2(12)
/

CREATE INDEX MAN02321_FK ON LANCTOESTOQ (CDOPERAUTORIZA ASC)
/
 
ALTER TABLE LANCTOESTOQ
  ADD CONSTRAINT FKMAN02321OPERADOR FOREIGN KEY(CDOPERAUTORIZA)
    REFERENCES OPERADOR(CDOPERADOR) 