ALTER TABLE FCT_TIPOORCAMENTO MODIFY IDGERACONTRATO DEFAULT 'S'
/
CREATE TABLE FCT_RELACESCOPOMODCONT (
  NRESCOPOMORCONT 			NUMBER 									NOT NULL,
  NRSEQMODCONTRA 			NUMBER 									NOT NULL,
  NRTIPOORCAMENTO 			NUMBER 									NOT NULL,
  NRORG                  		NUMBER          DEFAULT         SYS_CONTEXT('nrorg_ctx','nrorg') 	NOT NULL,	
  IDATIVO                		VARCHAR2(1)     DEFAULT 'S' 						NOT NULL
  CONSTRAINT CKC_IDATIVO_FCT_RELCSCPMDCONT   CHECK (IDATIVO IN ('S','N')),
  DTINCLUSAO             		DATE                       						    NULL,
  DTULTATU               		DATE                       						    NULL,
  NRORGINCLUSAO          		NUMBER          DEFAULT 1   						    NULL,
  CDOPERINCLUSAO         		VARCHAR2(12)    DEFAULT '1' 						    NULL,
  NRORGULTATU            		NUMBER          DEFAULT 1   						    NULL,
  CDOPERULTATU           		VARCHAR2(12)    DEFAULT '1'
)
/
ALTER TABLE FCT_RELACESCOPOMODCONT ADD CONSTRAINT PK_RELACESCOPOMODCONT PRIMARY KEY (NRESCOPOMORCONT)
/
CREATE INDEX FKSM00214 ON "FCT_RELACESCOPOMODCONT" ("NRSEQMODCONTRA" ASC)
/
ALTER TABLE FCT_RELACESCOPOMODCONT ADD CONSTRAINT FKSM00214MODCONT_ESCPMODCNT
  FOREIGN KEY (NRSEQMODCONTRA) REFERENCES FCT_MODELOCONTRATO(NRSEQMODCONTRA)
/
CREATE INDEX FKSM00215 ON "FCT_RELACESCOPOMODCONT" ("NRTIPOORCAMENTO" ASC)
/
ALTER TABLE FCT_RELACESCOPOMODCONT ADD CONSTRAINT FKSM00215ESCOPO_ESCPMODCNT
  FOREIGN KEY (NRTIPOORCAMENTO) REFERENCES FCT_TIPOORCAMENTO(NRTIPOORCAMENTO)
/
ALTER TABLE FCT_RELACESCOPOMODCONT ADD CONSTRAINT CKC_IDATIVO_ESCOPOMODCONT CHECK(IDATIVO IN('S', 'N'))
/
ALTER TABLE FCT_ORCAMENTOMODELO ADD NRSEQMODCONTRA NUMBER
/
CREATE INDEX FKSM00216 ON "FCT_ORCAMENTOMODELO" ("NRSEQMODCONTRA" ASC)
/
ALTER TABLE FCT_ORCAMENTOMODELO ADD CONSTRAINT FKSM00216MODCONT_ORCAMODEL
  FOREIGN KEY (NRSEQMODCONTRA) REFERENCES FCT_MODELOCONTRATO(NRSEQMODCONTRA)
/
ALTER TABLE FCT_PARAMFATITESC ADD CDTIPOOPERFATURA VARCHAR2(2)
/
ALTER TABLE FCT_PARAMFATITESC ADD CDSERIENF VARCHAR2(5)
/
ALTER TABLE FCT_PARAMFATITESC ADD CDEMPRESA VARCHAR2(2)
/
ALTER TABLE FCT_PARAMFATITESC ADD CDINSCESTA VARCHAR2(16)
/
ALTER TABLE FCT_PARAMFATITESC ADD CDINSCMUNI VARCHAR2(16)
/
ALTER TABLE FCT_CAPAPARAMFATESC ADD CDTIPOOPERFATURA VARCHAR2(2)
/
ALTER TABLE FCT_CAPAPARAMFATESC ADD CDSERIENF VARCHAR2(5)
/
ALTER TABLE FCT_CAPAPARAMFATESC ADD CDEMPRESA VARCHAR2(2)
/
ALTER TABLE FCT_CAPAPARAMFATESC ADD CDINSCESTA VARCHAR2(16)
/
ALTER TABLE FCT_CAPAPARAMFATESC ADD CDINSCMUNI VARCHAR2(16)