ALTER TABLE FPA_EVENTOH ADD IDREFATESTADO VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDREFATESTADO_EVENTOH CHECK (IDREFATESTADO IN ('S','N'))
/

UPDATE FPA_EVENTOH SET IDREFATESTADO = 'S' WHERE NREVENTOM IN (810,815,816,817)
/
 
--Proporcionaliza Evento: IDPROPORCEVENTO
ALTER TABLE FPA_EVENTOH ADD IDPROPORCEVENTO VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDPROPORCEVENTO_EVENTOH CHECK (IDPROPORCEVENTO IN ('S','N'))
/

--Pagto.Obrig: IDPAGTOOBRIG
ALTER TABLE FPA_EVENTOH ADD IDPAGTOOBRIG VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDPAGTOOBRIG_EVENTOH CHECK (IDPAGTOOBRIG IN ('S','N'))
/

--Ref. a 13: IDREFADECTERC
ALTER TABLE FPA_EVENTOH ADD IDREFADECTERC VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDREFADECTERC_EVENTOH CHECK (IDREFADECTERC IN ('S','N'))
/

UPDATE FPA_EVENTOH SET IDREFADECTERC = 'S' WHERE NREVENTOM IN (110,120,125,580,590,600)
/

--Ref.a Ferias: IDREFAFERIAS
ALTER TABLE FPA_EVENTOH ADD IDREFAFERIAS VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDREFAFERIAS_EVENTOH CHECK (IDREFAFERIAS IN ('S','N'))
/

UPDATE FPA_EVENTOH SET IDREFAFERIAS = 'S' WHERE NREVENTOM IN (210,211,212,213,220,222,223,230,231,232,240,242,250,251,260,261,270,271,276,280,285,500,505,510,515,520,521,522,523,530,531,532,533,540,550,551,552,553,554,555,556,557,558)
/

--Ref. Adiant: IDREFADIANT
ALTER TABLE FPA_EVENTOH ADD IDREFADIANT VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDREFADIANT_EVENTOH CHECK (IDREFADIANT IN ('S','N'))
/

UPDATE FPA_EVENTOH SET IDREFADIANT = 'S' WHERE NREVENTOM IN (470,475,1015,1020,1025)
/

--Incide para Periculosidade: IDINCIDEPERIC
ALTER TABLE FPA_EVENTOH ADD IDINCIDEPERIC VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDINCIDEPERIC_EVENTOH CHECK (IDINCIDEPERIC IN ('S','N'))
/

--Incide para Insalubridade: IDINCIDEINSALUB
ALTER TABLE FPA_EVENTOH ADD IDINCIDEINSALUB VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDINCIDEINSALUB_EVENTOH CHECK (IDINCIDEINSALUB IN ('S','N'))
/

--Incide para Pensao Alim.: IDINCIDEPENSALIM
ALTER TABLE FPA_EVENTOH ADD IDINCIDEPENSALIM VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDINCIDEPENSALIM_EVENTOH CHECK (IDINCIDEPENSALIM IN ('S','N'))
/

--Incide para Pensao Alim. Em Ferias: IDINCIDEPENSALIMFE
ALTER TABLE FPA_EVENTOH ADD IDINCIDEPENSALIMFE VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDINCIDEPENSALIMFE_EVENTOH CHECK (IDINCIDEPENSALIMFE IN ('S','N'))
/

--Incide p/ DSR H.Extra: IDINCIDEDSRHORAEXT
ALTER TABLE FPA_EVENTOH ADD IDINCIDEDSRHORAEXT VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDINCIDEDSRHORAEXT_EVENTOH CHECK (IDINCIDEDSRHORAEXT IN ('S','N'))
/

--Ref. Hora Extra: IDREFHORAEXTRA
ALTER TABLE FPA_EVENTOH ADD IDREFHORAEXTRA VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDREFHORAEXTRA_EVENTOH CHECK (IDREFHORAEXTRA IN ('S','N'))
/

UPDATE FPA_EVENTOH SET IDREFHORAEXTRA = 'S' WHERE NREVENTOM IN (70,71,72,73,74,80,81,82,83,84,90,91,92,93,94,95,96,97,98,99,100,970,971,972,973,974,980,981,982,983,984,990,991,992,993,994,995,996,997,998,999)
/

--Incide p/ DSR Adicional Noturno: IDINCIDEDSRADICNOT
ALTER TABLE FPA_EVENTOH ADD IDINCIDEDSRADICNOT VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDINCIDEDSRADICNOT_EVENTOH CHECK (IDINCIDEDSRADICNOT IN ('S','N'))
/

--Ref. Adicional Noturno: IDREFADICIONOTURN
ALTER TABLE FPA_EVENTOH ADD IDREFADICIONOTURN VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDREFADICIONOTURN_EVENTOH CHECK (IDREFADICIONOTURN IN ('S','N'))
/

UPDATE FPA_EVENTOH SET IDREFADICIONOTURN = 'S' WHERE NREVENTOM IN (40,41,42,43,44,940,941,942,943,944,946,947,948,949)
/

--Ref. Adic.T.Serv.: IDREFADICTSERV
ALTER TABLE FPA_EVENTOH ADD IDREFADICTSERV VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDREFADICTSERV_EVENTOH CHECK (IDREFADICTSERV IN ('S','N'))
/

UPDATE FPA_EVENTOH SET IDREFADICTSERV = 'S' WHERE NREVENTOM IN (810,815,816,817)
/

--Incide p/ C. Sindical: IDINCIDECSIND
ALTER TABLE FPA_EVENTOH ADD IDINCIDECSIND VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDINCIDECSIND_EVENTOH CHECK (IDINCIDECSIND IN ('S','N'))
/

UPDATE FPA_EVENTOH SET IDINCIDECSIND = 'S' WHERE NREVENTOM IN (820,830,840,850)
/

--Incide p/ Salario Familia: IDSALARIOFAMILIA
ALTER TABLE FPA_EVENTOH ADD IDSALARIOFAMILIA VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDSALARIOFAMILIA_EVENTOH CHECK (IDSALARIOFAMILIA IN ('S','N'))
/

--Ref. Seguro Vida: IDREFSEGUROVIDA
ALTER TABLE FPA_EVENTOH ADD IDREFSEGUROVIDA VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDREFSEGUROVIDA_EVENTOH CHECK (IDREFSEGUROVIDA IN ('S','N'))
/

--Deducao INSS: IDDEDUCAOINSS
ALTER TABLE FPA_EVENTOH ADD IDDEDUCAOINSS VARCHAR2(1) DEFAULT 'N' NOT NULL
/

ALTER TABLE FPA_EVENTOH ADD CONSTRAINT CKC_IDDEDUCAOINSS_EVENTOH CHECK (IDDEDUCAOINSS IN ('S','N'))
/