diff --git a/src/db/migration/Desktop.ini b/src/db/migration/Desktop.ini new file mode 100644 index 000000000..ae60713df Binary files /dev/null and b/src/db/migration/Desktop.ini differ diff --git a/src/db/migration/migration/V20160105_1716__mantis7788.sql b/src/db/migration/migration/V20160105_1716__mantis7788.sql new file mode 100644 index 000000000..f4d2ebf00 --- /dev/null +++ b/src/db/migration/migration/V20160105_1716__mantis7788.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_PARAMPTOVTA ADD (TIPOPAGAMENTO VARCHAR2(1) DEFAULT ''B'')'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160721_1259__autorizacao.sql b/src/db/migration/migration/V20160721_1259__autorizacao.sql new file mode 100644 index 000000000..f7070fa61 --- /dev/null +++ b/src/db/migration/migration/V20160721_1259__autorizacao.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'update autorizacion set NOMBAUTORIZACION = ''AUT_AUMENTA_DISPONIBILIDAD'' where NOMBAUTORIZACION = ''AUT_AUMENTA_DISPONIB'''; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20160721_1640__mantis7677.sql b/src/db/migration/migration/V20160721_1640__mantis7677.sql new file mode 100644 index 000000000..3ebebbc83 --- /dev/null +++ b/src/db/migration/migration/V20160721_1640__mantis7677.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE DIAGRAMA_AUTOBUS ADD INDBARCO NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160726_1445__casetapeajeexcepcion.sql b/src/db/migration/migration/V20160726_1445__casetapeajeexcepcion.sql new file mode 100644 index 000000000..b7b0018e4 --- /dev/null +++ b/src/db/migration/migration/V20160726_1445__casetapeajeexcepcion.sql @@ -0,0 +1,42 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE + CASETA_PEAJE_EXCEPCION + ( + CASETAPEAJEEXCEPCION_ID NUMBER(7) NOT NULL, + CASETAPEAJE_ID NUMBER(7) NOT NULL, + FECHAVENTAINI DATE, + FECHAVENTAFIN DATE, + FECHORINICIO DATE, + FECHORFINAL DATE, + INDLUNES NUMBER(1), + INDMARTES NUMBER(1), + INDMIERCOLES NUMBER(1), + INDJUEVES NUMBER(1), + INDVIERNES NUMBER(1), + INDSABADO NUMBER(1), + INDDOMINGO NUMBER(1), + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRECIO NUMBER(7,2), + CONSTRAINT CASETA_PEAJE_EXCEPCION_PK PRIMARY KEY (CASETAPEAJEEXCEPCION_ID), + CONSTRAINT CASETAPEXCEPCION_CASETA_FK FOREIGN KEY (CASETAPEAJE_ID) REFERENCES + CASETA_PEAJE (CASETAPEAJE_ID), + CONSTRAINT NNC_CASETAPEAJEEXCEPCION_ID CHECK ("CASETAPEAJEEXCEPCION_ID" IS NOT NULL), + CONSTRAINT NNC_CASETAPEAJE_ID CHECK ("CASETAPEAJE_ID" IS NOT NULL) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE "CASETA_PEAJE_EXCEPCION_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20160727_1529__exibecorridabloqueada.sql b/src/db/migration/migration/V20160727_1529__exibecorridabloqueada.sql new file mode 100644 index 000000000..6b5b60a5e --- /dev/null +++ b/src/db/migration/migration/V20160727_1529__exibecorridabloqueada.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD (INDEXIBECORRIDABLOQ NUMBER(1,0) DEFAULT 0 NOT NULL ENABLE)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160727_1536__mantis7411.sql b/src/db/migration/migration/V20160727_1536__mantis7411.sql new file mode 100644 index 000000000..d6ce5be7c --- /dev/null +++ b/src/db/migration/migration/V20160727_1536__mantis7411.sql @@ -0,0 +1,16 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values + (FUNCION_SISTEMA_SEQ.NEXTVAL,''2'',''VDA > MANUTENÇÃO DE SERVIÇOS >> MODIFICAÇÕES DE SERVIÇO >>> INICIADO/FECHADO'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.MODIFICASERVICOINICIADOFECHADO'',''1'',SYSDATE,''1'')'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; diff --git a/src/db/migration/migration/V20160728_1459__autorizacao2.sql b/src/db/migration/migration/V20160728_1459__autorizacao2.sql new file mode 100644 index 000000000..06cb51dec --- /dev/null +++ b/src/db/migration/migration/V20160728_1459__autorizacao2.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'update autorizacion set NOMBAUTORIZACION = ''AUT_EXCEDE_TRANSFERENCIA'' where NOMBAUTORIZACION = ''AUT_CAMBIO_ULTIMA_HR'''; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'update autorizacion set activo = 0 where NOMBAUTORIZACION in (''AUT_BOL_ASIENTOS'',''AUT_CAMBIAR_FOLIO'',''AUT_CANCELA_PAGOTAR'',''AUT_ENTREGA_EXTRAVIA'',''AUT_EXCEDE_TRANSFERE'',''AUT_OTORGAR_CORTESIA'')'; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20160728_1738__inativarruta.sql b/src/db/migration/migration/V20160728_1738__inativarruta.sql new file mode 100644 index 000000000..cb432dfb9 --- /dev/null +++ b/src/db/migration/migration/V20160728_1738__inativarruta.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA ADD INDRUTACENLADA NUMERIC(1) default 0'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160729_1502__excepcionpeajevigencia.sql b/src/db/migration/migration/V20160729_1502__excepcionpeajevigencia.sql new file mode 100644 index 000000000..b852f157d --- /dev/null +++ b/src/db/migration/migration/V20160729_1502__excepcionpeajevigencia.sql @@ -0,0 +1,21 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EXCEPCION_PEAJE_VIGENCIA ADD (CASETAPEAJE_ID NUMBER(7))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE EXCEPCION_PEAJE_VIGENCIA ADD CONSTRAINT EXCPEAJEVIGENCIA_CASETA_FK FOREIGN KEY (CASETAPEAJE_ID) REFERENCES CASETA_PEAJE (CASETAPEAJE_ID)'; + + exception + when column_exists then null; + when except_02275 then null; +end; diff --git a/src/db/migration/migration/V20160729_1546__mantis7455.sql b/src/db/migration/migration/V20160729_1546__mantis7455.sql new file mode 100644 index 000000000..0e6401b0d --- /dev/null +++ b/src/db/migration/migration/V20160729_1546__mantis7455.sql @@ -0,0 +1,124 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + ' + CREATE TABLE MENSAJE ( + MENSAJE_ID NUMBER(7,0) NOT NULL ENABLE, + FECINI DATE, + FECFIN DATE, + DESCRIPCION VARCHAR2(500 BYTE), + INDTIPO NUMBER(1,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT "PK_MENSAJE" PRIMARY KEY ("MENSAJE_ID"), + CONSTRAINT "FK_MENSAJE_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID") + ) + '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + ' + CREATE TABLE MENSAJE_PUNTO_VENTA( + MENSAJE_PUNTO_VENTA_ID NUMBER(7,0) NOT NULL ENABLE, + MENSAJE_ID NUMBER(7,0), + PUNTOVENTA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT "PK_MENSAJE_PUNTO_VENTA" PRIMARY KEY ("MENSAJE_PUNTO_VENTA_ID"), + CONSTRAINT "FK_MENSAJE_PTO_VENTA_MENSAJE" FOREIGN KEY ("MENSAJE_ID") REFERENCES MENSAJE("MENSAJE_ID"), + CONSTRAINT "FK_MENSAJE_PTO_VENTA_PTO_VENTA" FOREIGN KEY ("PUNTOVENTA_ID") REFERENCES PUNTO_VENTA("PUNTOVENTA_ID"), + CONSTRAINT "FK_MENSAJE_PUNTO_VENTA_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID") + ) + '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + ' + CREATE TABLE MENSAJE_EMPRESA( + MENSAJE_EMPRESA_ID NUMBER(7,0) NOT NULL ENABLE, + MENSAJE_ID NUMBER(7,0), + EMPRESA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT "PK_MENSAJE_EMPRESA" PRIMARY KEY ("MENSAJE_EMPRESA_ID"), + CONSTRAINT "FK_MENSAJE_EMPRESA_MENSAJE" FOREIGN KEY ("MENSAJE_ID") REFERENCES MENSAJE("MENSAJE_ID"), + CONSTRAINT "FK_MENSAJE_EMPRESA_EMPRESA" FOREIGN KEY ("EMPRESA_ID") REFERENCES EMPRESA("EMPRESA_ID"), + CONSTRAINT "FK_MENSAJE_EMPRESA_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID") + ) + '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + ' + CREATE TABLE MENSAJE_USUARIO( + MENSAJE_USUARIO_ID NUMBER(7,0) NOT NULL ENABLE, + MENSAJE_ID NUMBER(7,0), + USUARIO_ID NUMBER(7,0), + FECLEIDO DATE, + ACTIVO NUMBER(1,0), + USUARIOMODIF_ID NUMBER(7,0), + FECMODIF DATE, + CONSTRAINT "PK_MENSAJE_USUARIO" PRIMARY KEY ("MENSAJE_USUARIO_ID"), + CONSTRAINT "FK_MENSAJE_USUARIO_MENSAJE" FOREIGN KEY ("MENSAJE_ID") REFERENCES MENSAJE("MENSAJE_ID"), + CONSTRAINT "FK_MENSAJE_USUARIO_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID"), + CONSTRAINT "FK_MENSAJE_USUMODIF_USUARIO" FOREIGN KEY ("USUARIOMODIF_ID") REFERENCES USUARIO("USUARIO_ID") + ) + '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE "MENSAJE_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE "MENSAJE_PUNTO_VENTA_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE "MENSAJE_EMPRESA_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE "MENSAJE_USUARIO_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160801_1033__mantis7781.sql b/src/db/migration/migration/V20160801_1033__mantis7781.sql new file mode 100644 index 000000000..f86741449 --- /dev/null +++ b/src/db/migration/migration/V20160801_1033__mantis7781.sql @@ -0,0 +1,24 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDGENNUMFOLIOVTAINTIMPOST NUMBER(1,0) DEFAULT 0 NOT NULL'; + exception + when column_exists then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA VALUES + ( + FUNCION_SISTEMA_SEQ.NEXTVAL, + 1, + ''ADM > CATALOGOS >> EMPRESA >> GERA NUMERO BILHETE VENDA INTERNET E IMP. POSTERIOR'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.EMPRESA.GENERAFOLIOSISTEMAVTAINTIMPPOSTERIOR'', + 1 , + sysdate, + 1 + )'; + + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160801_1449__txemarque.sql b/src/db/migration/migration/V20160801_1449__txemarque.sql new file mode 100644 index 000000000..f11e90705 --- /dev/null +++ b/src/db/migration/migration/V20160801_1449__txemarque.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXA_EMBARQUE_PARADA ADD (EMPRESA_ID NUMBER(7) DEFAULT -1 NOT NULL)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160801_1732__dropTarifaConstraint.sql b/src/db/migration/migration/V20160801_1732__dropTarifaConstraint.sql new file mode 100644 index 000000000..a1397d0c5 --- /dev/null +++ b/src/db/migration/migration/V20160801_1732__dropTarifaConstraint.sql @@ -0,0 +1,17 @@ +DECLARE + itemExists NUMBER; + column_exists exception; + pragma exception_init (column_exists , -01430); +BEGIN + itemExists := 0; + + SELECT COUNT(CONSTRAINT_NAME) INTO itemExists + FROM ALL_CONSTRAINTS + WHERE UPPER(CONSTRAINT_NAME) = UPPER('TARIFA_UNICA'); + + IF itemExists > 0 THEN + EXECUTE IMMEDIATE 'ALTER TABLE TARIFA DROP CONSTRAINT TARIFA_UNICA'; + END IF; + + exception when column_exists then null; +END; \ No newline at end of file diff --git a/src/db/migration/migration/V20160802_1636__dropTarifaOficialConstraint.sql b/src/db/migration/migration/V20160802_1636__dropTarifaOficialConstraint.sql new file mode 100644 index 000000000..b02cd7ffb --- /dev/null +++ b/src/db/migration/migration/V20160802_1636__dropTarifaOficialConstraint.sql @@ -0,0 +1,17 @@ +DECLARE + itemExists NUMBER; + column_exists exception; + pragma exception_init (column_exists , -01430); +BEGIN + itemExists := 0; + + SELECT COUNT(CONSTRAINT_NAME) INTO itemExists + FROM ALL_CONSTRAINTS + WHERE UPPER(CONSTRAINT_NAME) = UPPER('UNIQUE_TARIFA_OFICIAL'); + + IF itemExists > 0 THEN + EXECUTE IMMEDIATE 'ALTER TABLE TARIFA_OFICIAL DROP CONSTRAINT UNIQUE_TARIFA_OFICIAL'; + END IF; + + exception when column_exists then null; +END; \ No newline at end of file diff --git a/src/db/migration/migration/V20160804_1559__nullvalesruta.sql b/src/db/migration/migration/V20160804_1559__nullvalesruta.sql new file mode 100644 index 000000000..156e9a7dd --- /dev/null +++ b/src/db/migration/migration/V20160804_1559__nullvalesruta.sql @@ -0,0 +1,13 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update ruta set INDRUTACENLADA=0 where INDRUTACENLADA is null'; + exception when ja_existe then null; +end; +/ +declare +begin + execute immediate 'alter table ruta modify (INDRUTACENLADA not null)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160808_1702__alteracaoTabela.sql b/src/db/migration/migration/V20160808_1702__alteracaoTabela.sql new file mode 100644 index 000000000..0d74d1d72 --- /dev/null +++ b/src/db/migration/migration/V20160808_1702__alteracaoTabela.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table tarjeta_fidelidad modify numtarjeta NUMBER(14,0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160808_1858__mantis7808.sql b/src/db/migration/migration/V20160808_1858__mantis7808.sql new file mode 100644 index 000000000..d3e3d5300 --- /dev/null +++ b/src/db/migration/migration/V20160808_1858__mantis7808.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_ML2 ADD (COOVINCULADO VARCHAR2(9))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160811_1630__mantis7808.sql b/src/db/migration/migration/V20160811_1630__mantis7808.sql new file mode 100644 index 000000000..421cb0b15 --- /dev/null +++ b/src/db/migration/migration/V20160811_1630__mantis7808.sql @@ -0,0 +1,22 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE FISCAL_ENVIO_FISCO ( + FISCALENVIOFISCO_ID NUMBER(15) NOT NULL, + NUMSERIE20 VARCHAR2(20) NOT NULL, + DATAMOV VARCHAR2(8) NOT NULL, + ARQUIVO VARCHAR2(50) NOT NULL, + RETORNO VARCHAR2(50) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE FISCAL_ENVIO_FISCO_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160812_1845__mantis7808.sql b/src/db/migration/migration/V20160812_1845__mantis7808.sql new file mode 100644 index 000000000..cc3fd0dc9 --- /dev/null +++ b/src/db/migration/migration/V20160812_1845__mantis7808.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_ENVIO_FISCO ADD (TENTATIVAS NUMBER(2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160818_1000__increase_importe_peaje_scale.sql b/src/db/migration/migration/V20160818_1000__increase_importe_peaje_scale.sql new file mode 100644 index 000000000..7165caaab --- /dev/null +++ b/src/db/migration/migration/V20160818_1000__increase_importe_peaje_scale.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table peaje modify (importepeaje number(15, 10))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160819_1110__mantis7808.sql b/src/db/migration/migration/V20160819_1110__mantis7808.sql new file mode 100644 index 000000000..d6e1b0746 --- /dev/null +++ b/src/db/migration/migration/V20160819_1110__mantis7808.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA RENAME COLUMN INDGERAARQGT TO INDCTRL'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20160822_1410__mantis7808.sql b/src/db/migration/migration/V20160822_1410__mantis7808.sql new file mode 100644 index 000000000..53ad8fd46 --- /dev/null +++ b/src/db/migration/migration/V20160822_1410__mantis7808.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_ML2 ADD (COOCUPOMFISCAL VARCHAR2(9))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160822_1507__mantis7805.sql b/src/db/migration/migration/V20160822_1507__mantis7805.sql new file mode 100644 index 000000000..ebc36c463 --- /dev/null +++ b/src/db/migration/migration/V20160822_1507__mantis7805.sql @@ -0,0 +1,64 @@ +/* INSERINDO O EVENTO EXTRA DIFERENCA DE TRANSFERENCIA OCD */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate ' +INSERT +INTO TIPO_EVENTO_EXTRA + ( + TIPOEVENTOEXTRA_ID, + PARAMARTICULO_ID, + INDTIPO, + IMPMAX, + INDVALIDACORTE, + INDVALIDADOCUMENTO, + INDCONTRAPARTIDA, + INDBOLETO, + INDORDENSERVICIO, + PORCIVA, + FORMAPAGO_ID, + USUARIO_ID, + FECMODIF, + ACTIVO, + PARAMARTICULO2_ID, + INDTIPO2, + FORMAPAGO2_ID, + INDOPERACION, + DESCTIPOEVENTO, + PROVEEDOR, + IMPFISCALNUMOPERACAO, + NATUREZA, + CONTACONTABIL, + INDCONFERENCIAFISICACOMISSAO + ) + VALUES + ( + ''99978'', + NULL, + ''1'', + ''99999'', + NULL, + ''0'', + NULL, + ''0'', + NULL, + ''0'', + NULL, + ''6486'', + to_date(''22/08/2016 14:55:00'',''DD/MM/YYYY HH24:MI:SS''), + ''0'', + NULL, + NULL, + NULL, + ''1'', + ''DIFERENCA DE TRANSF. OCD'', + NULL, + NULL, + ''RECEITA'', + NULL, + NULL + ) + '; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20160822_1830__mantis7808.sql b/src/db/migration/migration/V20160822_1830__mantis7808.sql new file mode 100644 index 000000000..ea0603720 --- /dev/null +++ b/src/db/migration/migration/V20160822_1830__mantis7808.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_ML2 MODIFY (DESCTIPODOC VARCHAR2(18))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_ML2 MODIFY (DESCTIPODOC2 VARCHAR2(18))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160822_2033__reunpaulista.sql b/src/db/migration/migration/V20160822_2033__reunpaulista.sql new file mode 100644 index 000000000..0ae82b1b1 --- /dev/null +++ b/src/db/migration/migration/V20160822_2033__reunpaulista.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_KM MODIFY (KMATE NUMBER(7, 2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160824_1608__mantis7805.sql b/src/db/migration/migration/V20160824_1608__mantis7805.sql new file mode 100644 index 000000000..d42685a83 --- /dev/null +++ b/src/db/migration/migration/V20160824_1608__mantis7805.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE OCD_PARAM ADD (INDOCDTRANSFERENCIA NUMBER(1,0) DEFAULT 0 NOT NULL)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160825_1712__mantis7849.sql b/src/db/migration/migration/V20160825_1712__mantis7849.sql new file mode 100644 index 000000000..8a205cdf9 --- /dev/null +++ b/src/db/migration/migration/V20160825_1712__mantis7849.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE DIAGRAMA_AUTOBUS ADD (INDTIPO NUMBER(1))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE DIAGRAMA_AUTOBUS SET INDTIPO = INDBARCO + 1'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20160829_1530__mantis7808.sql b/src/db/migration/migration/V20160829_1530__mantis7808.sql new file mode 100644 index 000000000..f09d97cb4 --- /dev/null +++ b/src/db/migration/migration/V20160829_1530__mantis7808.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (INDGERAARQGT NUMBER(1))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE FISCAL_IMPRESSORA SET INDGERAARQGT = INDCTRL'; + exception when ja_existe then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160830_1614__mantis7879.sql b/src/db/migration/migration/V20160830_1614__mantis7879.sql new file mode 100644 index 000000000..daa5154e1 --- /dev/null +++ b/src/db/migration/migration/V20160830_1614__mantis7879.sql @@ -0,0 +1,23 @@ +declare +begin + execute immediate 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > INTEGRACION'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.INTEGRACION'',1,SYSDATE, -1)'; + + exception when others then null; +end; +/ +declare +begin + execute immediate 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > ANALITICO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.ANALITICO'',1,SYSDATE, -1)'; + + exception when others then null; +end; +/ +declare +begin + execute immediate 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > ANALITICO > BGM'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.ANALITICO.BGM'',1,SYSDATE,-1)'; + + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160901_1030__classeindicepeaj.sql b/src/db/migration/migration/V20160901_1030__classeindicepeaj.sql new file mode 100644 index 000000000..18b20b354 --- /dev/null +++ b/src/db/migration/migration/V20160901_1030__classeindicepeaj.sql @@ -0,0 +1,24 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CLASSE_INDICE_PEAJE ( + CLASSE_INDICE_PEAJE_ID INTEGER PRIMARY KEY, + ACTIVO NUMERIC(1), + CLASSE_SERVICIO_ID INTEGER, + ORGAOCONCEDENTE_ID INTEGER, + INDICE_PEAJE INTEGER, + FOREIGN KEY (CLASSE_SERVICIO_ID) REFERENCES CLASE_SERVICIO (CLASESERVICIO_ID), + FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "CLASSE_INDICE_PEAJE_SEQ" MINVALUE 1 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20160908_1058__mantis7788.sql b/src/db/migration/migration/V20160908_1058__mantis7788.sql new file mode 100644 index 000000000..5be295085 --- /dev/null +++ b/src/db/migration/migration/V20160908_1058__mantis7788.sql @@ -0,0 +1,174 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE INSCRICAO_ESTADUAL ADD (EQUIVALENCIAAG NUMBER(7))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD (INDINTEGRADOAG NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD (MOTIVONAOINTEGRADOAG VARCHAR2(256))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_CONTAS_RECEBER ( + AGCONTASRECEBER_ID NUMBER(7) NOT NULL, + ESTABELECIMENTO VARCHAR2(4) NOT NULL, + CENTRORESULTADOS VARCHAR2(10), + CLIENTE VARCHAR2(10) NOT NULL, + FCLIENTEIDWS VARCHAR2(30), + RECEITA VARCHAR2(250) NOT NULL, + DOCUMENTO VARCHAR2(20), + EMISSAO DATE NOT NULL, + OBSERVACAO VARCHAR2(60), + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(255), + IDWS VARCHAR2(30), + PRIMARY KEY (AGCONTASRECEBER_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_SERVICOS_CTAS_RECEBER ( + AGSERVICOSCTASRECEBER_ID NUMBER(7) NOT NULL, + AGCONTASRECEBER_ID NUMBER(7) NOT NULL, + SERVICO VARCHAR2(4) NOT NULL, + MODALIDADE VARCHAR2(2) NOT NULL, + VALOR NUMBER(12,2) NOT NULL, + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(255), + PRIMARY KEY (AGSERVICOSCTASRECEBER_ID), + CONSTRAINT FK_AG_SERVICOS_CTASRECEBER FOREIGN KEY (AGCONTASRECEBER_ID) REFERENCES AG_CONTAS_RECEBER (AGCONTASRECEBER_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER ( + AGVENCIMENTOSDIVCTASRECEBER_ID NUMBER(7) NOT NULL, + AGCONTASRECEBER_ID NUMBER(7) NOT NULL, + DATAVENCIMENTO DATE NOT NULL, + VALOR NUMBER(12,2) NOT NULL, + TIPODOCUMENTO VARCHAR2(3) NOT NULL, + TITULO VARCHAR2(20), + AGENTECOBRADOR VARCHAR2(4) NOT NULL, + DESCONTOPREVISTO NUMBER(12,2) DEFAULT 0 NOT NULL, + NUMBOLETO VARCHAR2(20) NOT NULL, + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(255), + PRIMARY KEY (AGVENCIMENTOSDIVCTASRECEBER_ID), + CONSTRAINT FK_AG_VENCDIV_CTASRECEBER FOREIGN KEY (AGCONTASRECEBER_ID) REFERENCES AG_CONTAS_RECEBER (AGCONTASRECEBER_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_RATEIO_CTAS_RECEBER ( + AGRATEIOCTASRECEBER_ID NUMBER(7) NOT NULL, + AGCONTASRECEBER_ID NUMBER(7) NOT NULL, + ESTABELECIMENTO VARCHAR2(4) NOT NULL, + CENTRORESULTADOS VARCHAR2(10), + RECEITA VARCHAR2(250) NOT NULL, + VALOR NUMBER(12,2) NOT NULL, + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(255), + PRIMARY KEY (AGRATEIOCTASRECEBER_ID), + CONSTRAINT FK_AG_RATEIO_CTASRECEBER FOREIGN KEY (AGCONTASRECEBER_ID) REFERENCES AG_CONTAS_RECEBER (AGCONTASRECEBER_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_VNCTO_CARTAO_CTAS_RECEBER ( + AGVNCTOCARTAOCTASRECEBER_ID NUMBER(7) NOT NULL, + AGCONTASRECEBER_ID NUMBER(7) NOT NULL, + REDE VARCHAR2(20) NOT NULL, + BANDEIRA VARCHAR2(20) NOT NULL, + VENCIMENTO DATE NOT NULL, + VALOR NUMBER(12,2) NOT NULL, + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(255), + PRIMARY KEY (AGVNCTOCARTAOCTASRECEBER_ID), + CONSTRAINT FK_AG_VENCCARTAO_CTASRECEBER FOREIGN KEY (AGCONTASRECEBER_ID) REFERENCES AG_CONTAS_RECEBER (AGCONTASRECEBER_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_CONTAS_PAGAR ( + AGCONTASPAGAR_ID NUMBER(7) NOT NULL, + ESTABELECIMENTO VARCHAR2(4) NOT NULL, + CENTRORESULTADOS VARCHAR2(10), + FORNECEDOR VARCHAR2(6) NOT NULL, + DESPESA VARCHAR2(10) NOT NULL, + DOCUMENTO VARCHAR2(40), + EMISSAO DATE NOT NULL, + ENTRADA DATE NOT NULL, + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(255), + IDWS VARCHAR2(30), + PRIMARY KEY (AGCONTASPAGAR_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_VENCIMENTOS_CTAS_PAGAR ( + AGVENCIMENTOSCTASPAGAR_ID NUMBER(7) NOT NULL, + AGCONTASPAGAR_ID NUMBER(7) NOT NULL, + VENCIMENTO DATE NOT NULL, + VALOR NUMBER(12,2) NOT NULL, + SEQNUMPARCELA NUMBER(3) DEFAULT 1, + TITULO VARCHAR2(20), + PRIMARY KEY (AGVENCIMENTOSCTASPAGAR_ID), + CONSTRAINT FK_AG_VENCPAGAR_CTASPAGAR FOREIGN KEY (AGCONTASPAGAR_ID) REFERENCES AG_CONTAS_PAGAR (AGCONTASPAGAR_ID) + )'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20160913_1649__classeindicepeaje.sql b/src/db/migration/migration/V20160913_1649__classeindicepeaje.sql new file mode 100644 index 000000000..581ddb78f --- /dev/null +++ b/src/db/migration/migration/V20160913_1649__classeindicepeaje.sql @@ -0,0 +1,15 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'DELETE FROM CLASSE_INDICE_PEAJE'; + exception when ja_existe then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE MODIFY (INDICE_PEAJE NUMERIC(7,2))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160921_0945__mantis7982.sql b/src/db/migration/migration/V20160921_0945__mantis7982.sql new file mode 100644 index 000000000..5ee07357e --- /dev/null +++ b/src/db/migration/migration/V20160921_0945__mantis7982.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table PUNTO_VENTA ADD (FECFECHAMENTO DATE, FECABERTURA DATE)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160923_1319__mantis7788.sql b/src/db/migration/migration/V20160923_1319__mantis7788.sql new file mode 100644 index 000000000..2c34de774 --- /dev/null +++ b/src/db/migration/migration/V20160923_1319__mantis7788.sql @@ -0,0 +1,55 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_ADIANTAMENTO_CLIENTE ( + AGADIANTAMENTOCLIENTE_ID NUMBER(7) NOT NULL, + CLIENTE VARCHAR2(10) NOT NULL, + ESTABELECIMENTO VARCHAR2(4) NOT NULL, + CENTRORESULTADOS VARCHAR2(10), + CONTADESPREC VARCHAR2(10) NOT NULL, + CONTAFINANCEIRA VARCHAR2(4), + DATA DATE NOT NULL, + VALOR NUMBER(12,2) NOT NULL, + IDWS VARCHAR2(30), + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(255), + PRIMARY KEY (AGADIANTAMENTOCLIENTE_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_BAIXA_VENCTOCARTAO ( + AGBAIXAVENCTOCARTAO_ID NUMBER(7) NOT NULL, + CONTARECEBER_ID VARCHAR2(11) NOT NULL, + SEQUENCIAL NUMBER(4) DEFAULT 1 NOT NULL , + DATA DATE NOT NULL, + VALOR NUMBER(12,2) NOT NULL, + TAXA NUMBER(12,2) DEFAULT 0 NOT NULL , + CONTAFINANCEIRA VARCHAR2(4), + HISTORICO VARCHAR2(80) NOT NULL, + CONTADESPRECTAXA VARCHAR2(10) NOT NULL, + EXPORTAAC NUMBER(7) NOT NULL, + IDWS VARCHAR2(30), + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(255), + PRIMARY KEY (AGBAIXAVENCTOCARTAO_ID) + )'; + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE INSTI_FINANCEIRA ADD (INTEGRACIONAG VARCHAR2(4))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160928_1427__mantis7788.sql b/src/db/migration/migration/V20160928_1427__mantis7788.sql new file mode 100644 index 000000000..8bba1f6d6 --- /dev/null +++ b/src/db/migration/migration/V20160928_1427__mantis7788.sql @@ -0,0 +1,79 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_CONTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_SERVICOS_CTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_VENCDIVCTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_RATEIO_CTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_VNCTCARTAOCTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_CONTAS_PAGAR_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_VENCIMENTOS_CTAS_PAGAR_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_BAIXA_VENCTOCARTAO_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_ADIANTAMENTO_CLIENTE_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTADO ADD (CENTRORESULTADOSAG NUMBER(1))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20160929_2027__mantis8030.sql b/src/db/migration/migration/V20160929_2027__mantis8030.sql new file mode 100644 index 000000000..c3d1f76ab --- /dev/null +++ b/src/db/migration/migration/V20160929_2027__mantis8030.sql @@ -0,0 +1,15 @@ +declare + col_count integer; + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + select count(*) + into col_count from FORMA_PAGO + where FORMAPAGO_ID = 35; + + if col_count = 0 then + execute immediate 'Insert into FORMA_PAGO (FORMAPAGO_ID,DESCPAGO,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,INDOPERACION,CVEPAGO,IMPFISCAL,INDCONFERENCIAFISICACOMISSAO) values (''35'',''GERACAO OCD'',null,''1'',sysdate,''1'',null,''GO'',null,''0'')'; + end if; + + exception when ja_existe then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20160930_1521__mantis7903.sql b/src/db/migration/migration/V20160930_1521__mantis7903.sql new file mode 100644 index 000000000..2a8d5fd92 --- /dev/null +++ b/src/db/migration/migration/V20160930_1521__mantis7903.sql @@ -0,0 +1,31 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDENVIAEMAILCOMISSAO NUMBER(1,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD EMAIL_PENDENCIA VARCHAR(50)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_CNTCORRENTE ADD INDEMAILENVIADO NUMBER(1,0)'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE FECHAMENTO_CNTCORRENTE SET INDEMAILENVIADO = 1'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20161003_1637__mantis7788.sql b/src/db/migration/migration/V20161003_1637__mantis7788.sql new file mode 100644 index 000000000..74144a4e8 --- /dev/null +++ b/src/db/migration/migration/V20161003_1637__mantis7788.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE INSTI_FINANCEIRA ADD (CONTAFINANCEIRAAG VARCHAR2(4))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161003_1730__mantis8046.sql b/src/db/migration/migration/V20161003_1730__mantis8046.sql new file mode 100644 index 000000000..e9dbeed44 --- /dev/null +++ b/src/db/migration/migration/V20161003_1730__mantis8046.sql @@ -0,0 +1,7 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'INSERT INTO MOTIVO_CANCELACION(MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO) VALUES(99,''GERACAO OCD'',''B'',1,SYSDATE,1,''GERACAO OCD'')'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20161004_1711__mantis8012.sql b/src/db/migration/migration/V20161004_1711__mantis8012.sql new file mode 100644 index 000000000..2ba9e7c1d --- /dev/null +++ b/src/db/migration/migration/V20161004_1711__mantis8012.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD NUMPORTAPINPAD NUMBER(2,0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161004_1718__mantis8069.sql b/src/db/migration/migration/V20161004_1718__mantis8069.sql new file mode 100644 index 000000000..6540c67d5 --- /dev/null +++ b/src/db/migration/migration/V20161004_1718__mantis8069.sql @@ -0,0 +1,9 @@ +declare +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''HABILITAR NOVO CLIENTE'', + ''COM.RJCONSULTORES.VENTABOLETOS.WEB.UTILERIAS.MENU.ITEM.VENTA.CLINETE.HABILITARNOVOCLIENTE'', + ''1'',to_date(''15/04/16'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20161005_1430__mantis8032.sql b/src/db/migration/migration/V20161005_1430__mantis8032.sql new file mode 100644 index 000000000..6a6d0779c --- /dev/null +++ b/src/db/migration/migration/V20161005_1430__mantis8032.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD HORARIOLIBERACAOVENDAPESSAGEM NUMBER(1,0) DEFAULT 1'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20161007_1709__mantis0000.sql b/src/db/migration/migration/V20161007_1709__mantis0000.sql new file mode 100644 index 000000000..65955fee7 --- /dev/null +++ b/src/db/migration/migration/V20161007_1709__mantis0000.sql @@ -0,0 +1,9 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update punto_venta set INDBLOQCANCIMPPOSTERIOR = 0 where INDBLOQCANCIMPPOSTERIOR is null'; + exception when ja_existe then null; +end; + + diff --git a/src/db/migration/migration/V20161010_1720__desconto.sql b/src/db/migration/migration/V20161010_1720__desconto.sql new file mode 100644 index 000000000..00dfda456 --- /dev/null +++ b/src/db/migration/migration/V20161010_1720__desconto.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table CONVENIO_DET ADD PORCOUTROS NUMBER(5,2)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161013_1159__mantis8098.sql b/src/db/migration/migration/V20161013_1159__mantis8098.sql new file mode 100644 index 000000000..77eabb730 --- /dev/null +++ b/src/db/migration/migration/V20161013_1159__mantis8098.sql @@ -0,0 +1,21 @@ +DECLARE + type namesarray IS VARRAY(13) OF VARCHAR2(20); + + names namesarray; + total integer; + existe integer; +BEGIN + names := namesarray('OCA', 'VISA', 'MASTERCARD', 'AMERICAN EXPRESS', 'CABAL', 'CREDITOS DIRECTOS','ANDA', 'CREDITEL', 'PASS CARD', 'DINERS', 'CLUB DEL ESTE', 'CTC', 'ASI'); + + total := names.count; + + FOR i in 1 .. total LOOP + select count(*) into existe from tarjeta_credito where DESCTARJETACREDITO = names(i); + if existe = 0 then + + INSERT INTO TARJETA_CREDITO (TARJETACREDITO_ID,DESCTARJETACREDITO,CANTMAXSINTASA,CANMAXCONTASA,TASA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES (TARJETA_CREDITO_seq.nextval,names(i),1,1,1,1,sysdate,-1); + end if; + END LOOP; +END; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20161017_1531__mantis7788.sql b/src/db/migration/migration/V20161017_1531__mantis7788.sql new file mode 100644 index 000000000..6ba050fc6 --- /dev/null +++ b/src/db/migration/migration/V20161017_1531__mantis7788.sql @@ -0,0 +1,13 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER MODIFY (CLIENTE VARCHAR2(14))'; + exception when column_exists then null; +end; +/ +declare +begin + execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE MODIFY (CLIENTE NULL)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20161017_1833__mantis8112.sql b/src/db/migration/migration/V20161017_1833__mantis8112.sql new file mode 100644 index 000000000..b4818ab09 --- /dev/null +++ b/src/db/migration/migration/V20161017_1833__mantis8112.sql @@ -0,0 +1,9 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table ESQUEMA_CORRIDA ADD AUTOBUS_ID NUMBER(7,0)'; + exception when column_exists then null; +end; + + diff --git a/src/db/migration/migration/V20161019_0934__mantis7907.sql b/src/db/migration/migration/V20161019_0934__mantis7907.sql new file mode 100644 index 000000000..fb0c92a0d --- /dev/null +++ b/src/db/migration/migration/V20161019_0934__mantis7907.sql @@ -0,0 +1,42 @@ +declare +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > COMISSAO >> TIPO INFORMATIVO'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.COMISSAO.MENU.TIPOINFORMATIVO'', + ''1'',to_date(''15/04/16'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE TIPO_INFORMATIVO ( + TIPOINFORMATIVO_ID NUMBER(7,0) NOT NULL ENABLE, + DESCTIPO VARCHAR2(500 BYTE), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT "PK_TIPOINFORMATIVO" PRIMARY KEY ("TIPOINFORMATIVO_ID"), + CONSTRAINT "FK_TIPOINFORMATIVO_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID") + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE TIPO_INFORMATIVO_SEQ'; + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD TIPOINFORMATIVOCOMISSAO_ID NUMBER(7,0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161019_0935__mantis7907.sql b/src/db/migration/migration/V20161019_0935__mantis7907.sql new file mode 100644 index 000000000..68c0d8bf4 --- /dev/null +++ b/src/db/migration/migration/V20161019_0935__mantis7907.sql @@ -0,0 +1,13 @@ +declare + dup_val_on_index exception; + except_02275 exception; + + pragma exception_init (dup_val_on_index , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD CONSTRAINT FK_LOGCONFERENCIA_TIPOINFOR FOREIGN KEY (TIPOINFORMATIVOCOMISSAO_ID) REFERENCES TIPO_INFORMATIVO (TIPOINFORMATIVO_ID)'; + + exception + when dup_val_on_index then null; + when except_02275 then null; +end; diff --git a/src/db/migration/migration/V20161021_0930__mantis8128.sql b/src/db/migration/migration/V20161021_0930__mantis8128.sql new file mode 100644 index 000000000..0680c32fa --- /dev/null +++ b/src/db/migration/migration/V20161021_0930__mantis8128.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD(PORCCAMBIOEMBARCADO NUMBER (5,2) DEFAULT 0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161024_1430__mantis8120.sql b/src/db/migration/migration/V20161024_1430__mantis8120.sql new file mode 100644 index 000000000..a49ad288b --- /dev/null +++ b/src/db/migration/migration/V20161024_1430__mantis8120.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table fiscal_ml2 add (indvendamanual NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table fiscal_r4 add (indvendamanual NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161024_1728__mantis7904.sql b/src/db/migration/migration/V20161024_1728__mantis7904.sql new file mode 100644 index 000000000..2ed3fc341 --- /dev/null +++ b/src/db/migration/migration/V20161024_1728__mantis7904.sql @@ -0,0 +1,57 @@ +/* Sequence */ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE CONFERENCIA_PENDENCIA_SEQ INCREMENT BY 1 MAXVALUE 9999999 MINVALUE 1 CACHE 20'; + exception when object_exists then null; +end; +/ +/* Create */ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CONFERENCIA_PENDENCIA ( + CONFERENCIAPENDENCIA_ID NUMBER(7) NOT NULL, + DESCPENDENCIA VARCHAR2(50) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (CONFERENCIAPENDENCIA_ID) + )'; + exception when object_exists then null; +end; +/ +/* Alter table */ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD CONFERENCIAPENDENCIA_ID NUMBER(7) NULL'; + exception when column_exists then null; +end; +/ +declare + dup_val_on_index exception; + except_02275 exception; + + pragma exception_init (dup_val_on_index , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD CONSTRAINT FK_LOGCONFERENCIA_CONFPEN FOREIGN KEY (CONFERENCIAPENDENCIA_ID) REFERENCES CONFERENCIA_PENDENCIA (CONFERENCIAPENDENCIA_ID)'; + + exception + when dup_val_on_index then null; + when except_02275 then null; +end; +/ +/* Insert */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'INSERT INTO CONFERENCIA_PENDENCIA VALUES(CONFERENCIA_PENDENCIA_SEQ.NEXTVAL, ''MOVIMENTO SEM BILHETE FISICO'', 1, SYSDATE, 1)'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20161024_1920__mantis8120.sql b/src/db/migration/migration/V20161024_1920__mantis8120.sql new file mode 100644 index 000000000..83f72aefb --- /dev/null +++ b/src/db/migration/migration/V20161024_1920__mantis8120.sql @@ -0,0 +1,21 @@ +declare +begin + execute immediate + 'update fiscal_ml2 set indvendamanual = 1 where fiscalml2_id in ( + select ml2.fiscalml2_id + from fiscal_ml2 ml2 + join boleto b on b.boleto_id = ml2.boleto_id + where b.tipoventa_id = 3)'; + exception when others then null; +end; +/ +declare +begin + execute immediate + 'update fiscal_r4 set indvendamanual = 1 where fiscalr4_id in ( + select r4.fiscalr4_id + from fiscal_r4 r4 + join boleto b on b.boleto_id = r4.boleto_id + where b.tipoventa_id = 3)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20161026_1610__mantis8153.sql b/src/db/migration/migration/V20161026_1610__mantis8153.sql new file mode 100644 index 000000000..6aa87ac84 --- /dev/null +++ b/src/db/migration/migration/V20161026_1610__mantis8153.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_EMPRESA ADD INDIMPCOMPCARTAO NUMBER(1,0) DEFAULT 1'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161028_1111__mantis8171.sql b/src/db/migration/migration/V20161028_1111__mantis8171.sql new file mode 100644 index 000000000..3642f34bb --- /dev/null +++ b/src/db/migration/migration/V20161028_1111__mantis8171.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table caja add CCF VARCHAR2(6 BYTE)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table boleto add CCF VARCHAR2(6 BYTE)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161031_0916__mantis8168.sql b/src/db/migration/migration/V20161031_0916__mantis8168.sql new file mode 100644 index 000000000..4409175d3 --- /dev/null +++ b/src/db/migration/migration/V20161031_0916__mantis8168.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD IDADE_IDOSO NUMBER(2,0) DEFAULT 60 NOT NULL'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161103_1400__mantis8166.sql b/src/db/migration/migration/V20161103_1400__mantis8166.sql new file mode 100644 index 000000000..2f5cc4e57 --- /dev/null +++ b/src/db/migration/migration/V20161103_1400__mantis8166.sql @@ -0,0 +1,23 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD INDMESMODIA NUMBER(1,0)'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'INSERT INTO CONFERENCIA_PENDENCIA VALUES (CONFERENCIA_PENDENCIA_SEQ.NEXTVAL,''ENTRADA DE CORRECAO'', 1, current_date, 1)'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'INSERT INTO CONFERENCIA_PENDENCIA VALUES (CONFERENCIA_PENDENCIA_SEQ.NEXTVAL,''SAIDA DE CORRECAO'', 1, current_date, 1)'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20161104_1758__mantis8087.sql b/src/db/migration/migration/V20161104_1758__mantis8087.sql new file mode 100644 index 000000000..e560c1557 --- /dev/null +++ b/src/db/migration/migration/V20161104_1758__mantis8087.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''VDA > CAIXA >> CONSULTA DE BILHETES >> TROCA TITULARIDADE'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.CONSULTABOLETO.TROCATITULARIDADE'',''1'',to_date(''28-01-2015 17:15:17'',''DD-MM-YYYY HH24:MI:SS''),''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20161107_1622__mantis8212.sql b/src/db/migration/migration/V20161107_1622__mantis8212.sql new file mode 100644 index 000000000..860e094e0 --- /dev/null +++ b/src/db/migration/migration/V20161107_1622__mantis8212.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table corte_turno modify (corteturno_id number(10,0))'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20161108_1110__mantis8155.sql b/src/db/migration/migration/V20161108_1110__mantis8155.sql new file mode 100644 index 000000000..389037577 --- /dev/null +++ b/src/db/migration/migration/V20161108_1110__mantis8155.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table punto_venta add (indusataxaconversao NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161114_1645__mantis8121.sql b/src/db/migration/migration/V20161114_1645__mantis8121.sql new file mode 100644 index 000000000..31a97d626 --- /dev/null +++ b/src/db/migration/migration/V20161114_1645__mantis8121.sql @@ -0,0 +1,16 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE REGION_METROPOLITANA + ( + REGIONMETROPOLITANA_ID NUMBER(7,0) NOT NULL ENABLE, + DESCREGION VARCHAR2(100), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT REGION_METROPOLITANA_PK PRIMARY KEY (REGIONMETROPOLITANA_ID) + ENABLE)'; + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161114_1647__mantis8121.sql b/src/db/migration/migration/V20161114_1647__mantis8121.sql new file mode 100644 index 000000000..76b0354c7 --- /dev/null +++ b/src/db/migration/migration/V20161114_1647__mantis8121.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA ADD (REGIONMETROPOLITANA_ID NUMBER(7,0))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161116_1404__mantis8222.sql b/src/db/migration/migration/V20161116_1404__mantis8222.sql new file mode 100644 index 000000000..073b07865 --- /dev/null +++ b/src/db/migration/migration/V20161116_1404__mantis8222.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table estacion add(indterminalmultiplo number(1,0) default 0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161116_1440__mantis8120.sql b/src/db/migration/migration/V20161116_1440__mantis8120.sql new file mode 100644 index 000000000..523c367f8 --- /dev/null +++ b/src/db/migration/migration/V20161116_1440__mantis8120.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (NUMEROIDENTIFICACAO NUMBER(3))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161116_1559__mantis8225.sql b/src/db/migration/migration/V20161116_1559__mantis8225.sql new file mode 100644 index 000000000..6e0dccdb0 --- /dev/null +++ b/src/db/migration/migration/V20161116_1559__mantis8225.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (ICMSIMMATRICIAL NUMBER(7,2))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161117_1450__mantis8122.sql b/src/db/migration/migration/V20161117_1450__mantis8122.sql new file mode 100644 index 000000000..e035bc25b --- /dev/null +++ b/src/db/migration/migration/V20161117_1450__mantis8122.sql @@ -0,0 +1,9 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE REGION_METROPOLITANA_SEQ + MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 + START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20161117_1527__mantis7788.sql b/src/db/migration/migration/V20161117_1527__mantis7788.sql new file mode 100644 index 000000000..953840219 --- /dev/null +++ b/src/db/migration/migration/V20161117_1527__mantis7788.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_VNCTO_CARTAO_CTAS_RECEBER ADD (sequencial NUMBER(7) DEFAULT 1 NOT NULL)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161118_1035__mantis8123.sql b/src/db/migration/migration/V20161118_1035__mantis8123.sql new file mode 100644 index 000000000..8f531104f --- /dev/null +++ b/src/db/migration/migration/V20161118_1035__mantis8123.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM >> CATALOGOS > REGIAO METROPOLITANA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.REGIONMETROPOLITANA'',1,SYSDATE,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161123_1745__mantis7283.sql b/src/db/migration/migration/V20161123_1745__mantis7283.sql new file mode 100644 index 000000000..464d94f34 --- /dev/null +++ b/src/db/migration/migration/V20161123_1745__mantis7283.sql @@ -0,0 +1,127 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE add (INDICE_PEAJE2 NUMBER(7,3))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE2 = INDICE_PEAJE'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE = null'; + exception when ja_existe then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE drop column INDICE_PEAJE'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE add (INDICE_PEAJE NUMBER(7,3))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE = INDICE_PEAJE2'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE2 = null'; + exception when ja_existe then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE drop column INDICE_PEAJE2'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE add (INDICE_PEAJE2 NUMBER(7,3))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update ORGAO_CONCEDENTE set INDICE_PEAJE2 = INDICEPEAJE'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update ORGAO_CONCEDENTE set INDICEPEAJE = null'; + exception when ja_existe then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE drop column INDICEPEAJE'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE add (INDICEPEAJE NUMBER(7,3))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update ORGAO_CONCEDENTE set INDICEPEAJE = INDICE_PEAJE2'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update ORGAO_CONCEDENTE set INDICE_PEAJE2 = null'; + exception when ja_existe then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE drop column INDICE_PEAJE2'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161124_1500__mantis8120.sql b/src/db/migration/migration/V20161124_1500__mantis8120.sql new file mode 100644 index 000000000..814ee9f79 --- /dev/null +++ b/src/db/migration/migration/V20161124_1500__mantis8120.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (CODIGOCONTABILMUNICIPAL NUMBER(15))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (CODIGOCONTABILESTADUAL NUMBER(15))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161125_1645__mantis8120.sql b/src/db/migration/migration/V20161125_1645__mantis8120.sql new file mode 100644 index 000000000..dad94a2ea --- /dev/null +++ b/src/db/migration/migration/V20161125_1645__mantis8120.sql @@ -0,0 +1,7 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'INSERT INTO AIDF_ESPECIE (AIDFESP_ID, DECESPECIE, ACTIVO, FECMODIF, USUARIO_ID) VALUES (3, ''RMD'', 1, TIMESTAMP ''2016-11-25 16:45:00'', 1)'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20161128_1022__mantis8287.sql b/src/db/migration/migration/V20161128_1022__mantis8287.sql new file mode 100644 index 000000000..6fcc3e5ad --- /dev/null +++ b/src/db/migration/migration/V20161128_1022__mantis8287.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDNAOPERMITECONFSEMMALOTE NUMBER(1,0) DEFAULT 0 NOT NULL)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161128_1105__mantis7788.sql b/src/db/migration/migration/V20161128_1105__mantis7788.sql new file mode 100644 index 000000000..8234b40f6 --- /dev/null +++ b/src/db/migration/migration/V20161128_1105__mantis7788.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (CLIENTECNPJCPF VARCHAR2(20))'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (CLIENTEIDWS VARCHAR2(30))'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (OBSERVACAO VARCHAR2(255))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20161128_1115__mantis8120.sql b/src/db/migration/migration/V20161128_1115__mantis8120.sql new file mode 100644 index 000000000..97581a860 --- /dev/null +++ b/src/db/migration/migration/V20161128_1115__mantis8120.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (RMD_ID NUMBER(15))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161129_0925__mantis7978.sql b/src/db/migration/migration/V20161129_0925__mantis7978.sql new file mode 100644 index 000000000..01f285495 --- /dev/null +++ b/src/db/migration/migration/V20161129_0925__mantis7978.sql @@ -0,0 +1,37 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD EMPRESA_ID NUMBER(7,0)'; + exception when column_exists then null; +end; +/ +declare + dup_val_on_index exception; + except_02275 exception; + + pragma exception_init (dup_val_on_index , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD CONSTRAINT FK_CONF_REST_CV_EMPRESA FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA(EMPRESA_ID)'; + + exception + when dup_val_on_index then null; + when except_02275 then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD FECINICIOVIGENCIA DATE'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD FECFINVIGENCIA DATE'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161129_1446__mantis8306.sql b/src/db/migration/migration/V20161129_1446__mantis8306.sql new file mode 100644 index 000000000..1adee072b --- /dev/null +++ b/src/db/migration/migration/V20161129_1446__mantis8306.sql @@ -0,0 +1,19 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE MOTIVO_CANCEL_VENDA_PACOTE_SEQ + MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 + START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE MOTIVO_CANCEL_VENDA_PACOTE + ADD (TIPOMOTIVOCANCEL VARCHAR2(20))'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20161129_1657__mantis8309.sql b/src/db/migration/migration/V20161129_1657__mantis8309.sql new file mode 100644 index 000000000..4c8ac5648 --- /dev/null +++ b/src/db/migration/migration/V20161129_1657__mantis8309.sql @@ -0,0 +1,127 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE add (INDICE_PEAJE2 NUMBER(7,4))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE2 = INDICE_PEAJE'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE = null'; + exception when ja_existe then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE drop column INDICE_PEAJE'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE add (INDICE_PEAJE NUMBER(7,4))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE = INDICE_PEAJE2'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE2 = null'; + exception when ja_existe then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE drop column INDICE_PEAJE2'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE add (INDICE_PEAJE2 NUMBER(7,4))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update ORGAO_CONCEDENTE set INDICE_PEAJE2 = INDICEPEAJE'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update ORGAO_CONCEDENTE set INDICEPEAJE = null'; + exception when ja_existe then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE drop column INDICEPEAJE'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE add (INDICEPEAJE NUMBER(7,4))'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update ORGAO_CONCEDENTE set INDICEPEAJE = INDICE_PEAJE2'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update ORGAO_CONCEDENTE set INDICE_PEAJE2 = null'; + exception when ja_existe then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE drop column INDICE_PEAJE2'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161130_1625__mantis8225.sql b/src/db/migration/migration/V20161130_1625__mantis8225.sql new file mode 100644 index 000000000..0df81f971 --- /dev/null +++ b/src/db/migration/migration/V20161130_1625__mantis8225.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (ICMSMATRICIAL NUMBER(7,2))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161130_1731__mantis8314.sql b/src/db/migration/migration/V20161130_1731__mantis8314.sql new file mode 100644 index 000000000..5e62ea419 --- /dev/null +++ b/src/db/migration/migration/V20161130_1731__mantis8314.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MOTIVO_CANCEL_VENDA_PACOTE ADD (PORCMULTA NUMBER(5,2) DEFAULT 0 NOT NULL)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161130_2012__mantis8321.sql b/src/db/migration/migration/V20161130_2012__mantis8321.sql new file mode 100644 index 000000000..d711fed7c --- /dev/null +++ b/src/db/migration/migration/V20161130_2012__mantis8321.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE usuario ADD (DESCMAC VARCHAR2(25) )'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161201_1402__mantis8316.sql b/src/db/migration/migration/V20161201_1402__mantis8316.sql new file mode 100644 index 000000000..ca54223ef --- /dev/null +++ b/src/db/migration/migration/V20161201_1402__mantis8316.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_VENDA_PACOTE ADD (USUARIO_CANCELAMENTO_ID NUMBER(7,0), MOTIVOCANCELVENDAPACOTE_ID NUMBER(7,0), INDCANCELADO NUMBER(1,0), DATACANCELAMENTO DATE)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161201_1526__mantis7788.sql b/src/db/migration/migration/V20161201_1526__mantis7788.sql new file mode 100644 index 000000000..b9372c6ab --- /dev/null +++ b/src/db/migration/migration/V20161201_1526__mantis7788.sql @@ -0,0 +1,33 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_DEV_ADIANTAMENTO_CLIENTE ( + AGDEVADIANTAMENTOCLIENTE_ID NUMBER(7) NOT NULL, + CLIENTE VARCHAR2(10), + ESTABELECIMENTO VARCHAR2(4) NOT NULL, + CENTRORESULTADOS VARCHAR2(10), + CONTADESPREC VARCHAR2(10) NOT NULL, + CONTAFINANCEIRA VARCHAR2(4), + DATA DATE NOT NULL, + VALOR NUMBER(12,2) NOT NULL, + IDWS VARCHAR2(30), + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(500), + CLIENTECNPJCPF VARCHAR2(20), + CLIENTEIDWS VARCHAR2(30), + OBSERVACAO VARCHAR2(255), + PRIMARY KEY (AGDEVADIANTAMENTOCLIENTE_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_DEVADIANTAMENTO_CLIENTE_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20161202_0958__mantis7788.sql b/src/db/migration/migration/V20161202_0958__mantis7788.sql new file mode 100644 index 000000000..240a004dd --- /dev/null +++ b/src/db/migration/migration/V20161202_0958__mantis7788.sql @@ -0,0 +1,29 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AG_DEPOSITOS_DIVERSOS ( + AGDEPOSITOSDIVERSOS_ID NUMBER(7) NOT NULL, + DATADEPOSITO DATE NOT NULL, + CREIDWS VARCHAR2(30) NOT NULL, + IDWS VARCHAR2(30), + REFERENCIABANCO VARCHAR2(200), + SEQUENCIA NUMBER(7) DEFAULT 1, + SEQUENCIAVENCIMENTO NUMBER(7) DEFAULT 1, + VALOR NUMBER(12,2) NOT NULL, + INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL, + FECINTEGRACION DATE, + MOTIVONAOINTEGRADO VARCHAR2(255), + PRIMARY KEY (AGDEPOSITOSDIVERSOS_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "AG_DEPOSITOS_DIVERSOS_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20161202_1033__mantis7788.sql b/src/db/migration/migration/V20161202_1033__mantis7788.sql new file mode 100644 index 000000000..a56a94144 --- /dev/null +++ b/src/db/migration/migration/V20161202_1033__mantis7788.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER ADD (TIPOCONTARECEBER NUMBER(1) DEFAULT 1)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161202_1124__mantis7788.sql b/src/db/migration/migration/V20161202_1124__mantis7788.sql new file mode 100644 index 000000000..bbde662c9 --- /dev/null +++ b/src/db/migration/migration/V20161202_1124__mantis7788.sql @@ -0,0 +1,13 @@ +declare + dup_val_on_index exception; + except_01451 exception; + + pragma exception_init (dup_val_on_index , -01430); + pragma exception_init (except_01451 , -01451); +begin + execute immediate 'ALTER TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER MODIFY (NUMBOLETO NULL)'; + + exception + when dup_val_on_index then null; + when except_01451 then null; +end; diff --git a/src/db/migration/migration/V20161202_1459__mantis8321.sql b/src/db/migration/migration/V20161202_1459__mantis8321.sql new file mode 100644 index 000000000..80ba6fc8b --- /dev/null +++ b/src/db/migration/migration/V20161202_1459__mantis8321.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''VDA > ESTOQUE DE PASSAGENS >> TROCA DE ESTOQUE'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUTROCAFOLIO'',''1'',to_date(''02-12-2016 14:59:00'',''DD-MM-YYYY HH24:MI:SS''),''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20161202_1546__mantis7788.sql b/src/db/migration/migration/V20161202_1546__mantis7788.sql new file mode 100644 index 000000000..0b088a7d8 --- /dev/null +++ b/src/db/migration/migration/V20161202_1546__mantis7788.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEV_ADIANTAMENTO_CLIENTE ADD (AGCONTASRECEBER_ID NUMBER(7))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161202_1621__mantis7788.sql b/src/db/migration/migration/V20161202_1621__mantis7788.sql new file mode 100644 index 000000000..b41190826 --- /dev/null +++ b/src/db/migration/migration/V20161202_1621__mantis7788.sql @@ -0,0 +1,175 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_BAIXA_VENCTOCARTAO ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_BAIXA_VENCTOCARTAO ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEV_ADIANTAMENTO_CLIENTE ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEV_ADIANTAMENTO_CLIENTE ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_RATEIO_CTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_RATEIO_CTAS_RECEBER ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_SERVICOS_CTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_SERVICOS_CTAS_RECEBER ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_VENCIMENTOS_CTAS_PAGAR ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_VENCIMENTOS_CTAS_PAGAR ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_VNCTO_CARTAO_CTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_VNCTO_CARTAO_CTAS_RECEBER ADD (DATAFIM DATE NOT NULL)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161202_1727__mantis7788.sql b/src/db/migration/migration/V20161202_1727__mantis7788.sql new file mode 100644 index 000000000..8a7901a85 --- /dev/null +++ b/src/db/migration/migration/V20161202_1727__mantis7788.sql @@ -0,0 +1,23 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (BANCO VARCHAR2(3))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (AGENCIA VARCHAR2(50))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (CONTACORRENTE VARCHAR2(50))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161203_1116__mantis8307.sql b/src/db/migration/migration/V20161203_1116__mantis8307.sql new file mode 100644 index 000000000..949782bd6 --- /dev/null +++ b/src/db/migration/migration/V20161203_1116__mantis8307.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM >> CONFIG COMERCIAL > MOTIVO DO CANCELAMENTO VENDA PACOTE'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.MOTIVOSDELACANCELVENDAPACOTE'',1,SYSDATE,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161205_1604__mantis8325.sql b/src/db/migration/migration/V20161205_1604__mantis8325.sql new file mode 100644 index 000000000..38c8b4c36 --- /dev/null +++ b/src/db/migration/migration/V20161205_1604__mantis8325.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > CATALOGOS >> EMPRESA >> RESTRINGE VENDA SE RED. Z NAO EMITIDA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.EMPRESA.RESTRIGEVENDAREDUCAOZ'',1,SYSDATE,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161205_1840__consumoboleto.sql b/src/db/migration/migration/V20161205_1840__consumoboleto.sql new file mode 100644 index 000000000..3f2fb3b4e --- /dev/null +++ b/src/db/migration/migration/V20161205_1840__consumoboleto.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table consumo_boleto modify (CORTETURNO_ID number(10,0))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161206_1811__mantis8339.sql b/src/db/migration/migration/V20161206_1811__mantis8339.sql new file mode 100644 index 000000000..edf331edb --- /dev/null +++ b/src/db/migration/migration/V20161206_1811__mantis8339.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table boleto modify NUMASIENTOVINCULADO varchar(12)'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20161209_0944__mantis7788.sql b/src/db/migration/migration/V20161209_0944__mantis7788.sql new file mode 100644 index 000000000..fd6a1335b --- /dev/null +++ b/src/db/migration/migration/V20161209_0944__mantis7788.sql @@ -0,0 +1,17 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate + 'insert into constante values ( + constante_seq.nextval, + ''URL_WS_AG'', + ''URL_WS_AG'', + 1, + ''http://177.22.36.181:8081/cgi-bin/AGWS.exe/wsdl/IAG'', + 1, + 1, + sysdate, + 1)'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20161209_1343__mantis8396.sql b/src/db/migration/migration/V20161209_1343__mantis8396.sql new file mode 100644 index 000000000..e4aad35bc --- /dev/null +++ b/src/db/migration/migration/V20161209_1343__mantis8396.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD (TIPO_PAGO NUMBER(2,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161209_1500__mantis8393.sql b/src/db/migration/migration/V20161209_1500__mantis8393.sql new file mode 100644 index 000000000..64566f653 --- /dev/null +++ b/src/db/migration/migration/V20161209_1500__mantis8393.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (FECHORVENTA_H DATE)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS ADD (FECHORVTA_H DATE)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161209_1705__mantis8360.sql b/src/db/migration/migration/V20161209_1705__mantis8360.sql new file mode 100644 index 000000000..d39a1635b --- /dev/null +++ b/src/db/migration/migration/V20161209_1705__mantis8360.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table EMBARCADA_SINCRONISMO add NUMDIV NUMBER(11)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161211_1046__mantis8396.sql b/src/db/migration/migration/V20161211_1046__mantis8396.sql new file mode 100644 index 000000000..3ec334b6a --- /dev/null +++ b/src/db/migration/migration/V20161211_1046__mantis8396.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DET_PAGO ADD (OCD_ID NUMBER(15,0), NOTACREDITOVENDAPACOTE_ID NUMBER(7,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161212_1839__mantis8405.sql b/src/db/migration/migration/V20161212_1839__mantis8405.sql new file mode 100644 index 000000000..7941ec0a6 --- /dev/null +++ b/src/db/migration/migration/V20161212_1839__mantis8405.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA MODIFY (CVECATEGORIA VARCHAR2(3 BYTE) )'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20161213_1012__mantis8389.sql b/src/db/migration/migration/V20161213_1012__mantis8389.sql new file mode 100644 index 000000000..e216aa1fa --- /dev/null +++ b/src/db/migration/migration/V20161213_1012__mantis8389.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PACOTE_TARIFA ADD (INDVENDAWEB NUMBER(1,0) DEFAULT 1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161216_0926__mantis8389.sql b/src/db/migration/migration/V20161216_0926__mantis8389.sql new file mode 100644 index 000000000..13c3954a3 --- /dev/null +++ b/src/db/migration/migration/V20161216_0926__mantis8389.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PACOTE_TARIFA ADD (CATEGORIA_ID NUMBER(7,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161216_0945__mantis8389.sql b/src/db/migration/migration/V20161216_0945__mantis8389.sql new file mode 100644 index 000000000..8d3e3f4ee --- /dev/null +++ b/src/db/migration/migration/V20161216_0945__mantis8389.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE PACOTE_TARIFA ADD CONSTRAINT FK_CATEGORIA FOREIGN KEY (CATEGORIA_ID) REFERENCES CATEGORIA (CATEGORIA_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; diff --git a/src/db/migration/migration/V20161219_1645__mantis8360.sql b/src/db/migration/migration/V20161219_1645__mantis8360.sql new file mode 100644 index 000000000..700c5c84f --- /dev/null +++ b/src/db/migration/migration/V20161219_1645__mantis8360.sql @@ -0,0 +1,51 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE "VENDA_EMBARCADA" + ("VENDAEMBARCADA_ID" NUMBER(15,0), + "NUMEROBILHETE" NUMBER(15,0), + "NUMSERIE20" VARCHAR2(20 BYTE), + "DISPOSITIVO_ID" VARCHAR2(15 BYTE), + "ORIGEM_ID" NUMBER(7,0), + "DESTINO_ID" NUMBER(7,0), + "CORRIDA_ID" NUMBER(7,0), + "VEICULO_ID" NUMBER(7,0), + "PDA_ID" NUMBER(7,0), + "LINHA_ID" NUMBER(7,0), + "OPERADOR_ID" NUMBER(7,0), + "SESSAO_ID" NUMBER(4,0), + "VENDA_ID" VARCHAR2(12 BYTE), + "DATAABERTURAVIAGEM" DATE, + "DATAABERTURAVENDA" DATE, + "DATAABERTURACAIXA" DATE, + "HORAABERTURAVENDA" VARCHAR2(8 BYTE), + "HORAABERTURACAIXA" VARCHAR2(8 BYTE), + "DATAVIAGEM" DATE, + "DATAFECHAMENTO" DATE, + "HORAFECHAMENTO" VARCHAR2(8 BYTE), + "TIPOVENDA" VARCHAR2(2 BYTE), + "VALORTOTALBILHETE" NUMBER(7,2), + "VALORTAXAEMBARQUE" NUMBER(7,2), + "VALORSEGURO" NUMBER(7,2), + "VALORPEDAGIO" NUMBER(7,2), + "VALOROUTROS" NUMBER(7,2), + "DOCUMENTORG" VARCHAR2(45 BYTE), + "DOCUMENTOCPF" VARCHAR2(45 BYTE), + "NOMEPASSAGEIRO" VARCHAR2(180 BYTE), + "CLASSE" VARCHAR2(25 BYTE), + "EMPRESA" VARCHAR2(50 BYTE), + "DESCRICAODESTINO" VARCHAR2(180 BYTE), + "DESCRICAOORIGEM" VARCHAR2(180 BYTE), + "DESCRICAOLINHA" VARCHAR2(60 BYTE), + "OPERADORCVE" VARCHAR2(45 BYTE), + "CANCELADO" NUMBER(1,0), + "ACTIVO" NUMBER(1,0), + "FECMODIF" DATE, + "USUARIO_ID" NUMBER(7,0), + "IMPRESSO" NUMBER(1,0), + "NUMDIV" VARCHAR2(11 BYTE) + )'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20161222_1130__mantis8120.sql b/src/db/migration/migration/V20161222_1130__mantis8120.sql new file mode 100644 index 000000000..d31bf4a03 --- /dev/null +++ b/src/db/migration/migration/V20161222_1130__mantis8120.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS > EXPORTACAO FISCAL'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.EXPORTACAO.RMDECF'',1,SYSDATE, -1)'; + + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161222_1456__mantis8456.sql b/src/db/migration/migration/V20161222_1456__mantis8456.sql new file mode 100644 index 000000000..d3542d18e --- /dev/null +++ b/src/db/migration/migration/V20161222_1456__mantis8456.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE OCD_PARAM ADD (INDTOTALBILHETE NUMBER(1,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161223_1717__mantis8458.sql b/src/db/migration/migration/V20161223_1717__mantis8458.sql new file mode 100644 index 000000000..2fda67be0 --- /dev/null +++ b/src/db/migration/migration/V20161223_1717__mantis8458.sql @@ -0,0 +1,24 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE OCD_DATOS_PAGAMENTO ( + OCDDATOSPAGAMENTO_ID NUMBER(7) NOT NULL, + OCD_ID NUMBER(15) NULL, + NOTACREDITOVENDAPACOTE_ID NUMBER(7) NULL, + TITULARCUENTA VARCHAR2(50) NULL, + IDENTIFICACION VARCHAR2(20) NULL, + BANCO VARCHAR2(20) NULL, + CUENTABANCO VARCHAR2(20) NULL, + AGENCIA VARCHAR2(10) NULL, + EMAIL VARCHAR2(50) NULL, + TELEFONO VARCHAR2(14) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (OCDDATOSPAGAMENTO_ID), + FOREIGN KEY (OCD_ID) REFERENCES OCD, + FOREIGN KEY (NOTACREDITOVENDAPACOTE_ID) REFERENCES NOTA_CREDITO_VENDA_PACOTE + )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161223_1718__mantis8458.sql b/src/db/migration/migration/V20161223_1718__mantis8458.sql new file mode 100644 index 000000000..e4e55842a --- /dev/null +++ b/src/db/migration/migration/V20161223_1718__mantis8458.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE OCD_DATOS_PAGAMENTO_SEQ INCREMENT BY 1 MAXVALUE 9999999 MINVALUE 1 CACHE 20'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161226_1522__mantis8122.sql b/src/db/migration/migration/V20161226_1522__mantis8122.sql new file mode 100644 index 000000000..8f531104f --- /dev/null +++ b/src/db/migration/migration/V20161226_1522__mantis8122.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM >> CATALOGOS > REGIAO METROPOLITANA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.REGIONMETROPOLITANA'',1,SYSDATE,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161227_1622__mantis8465.sql b/src/db/migration/migration/V20161227_1622__mantis8465.sql new file mode 100644 index 000000000..b6b7b83a5 --- /dev/null +++ b/src/db/migration/migration/V20161227_1622__mantis8465.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE OCD ADD (SALDO_PAGAR NUMBER(7,2))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161227_1623__mantis8465.sql b/src/db/migration/migration/V20161227_1623__mantis8465.sql new file mode 100644 index 000000000..6b5a3fa49 --- /dev/null +++ b/src/db/migration/migration/V20161227_1623__mantis8465.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE NOTA_CREDITO_VENDA_PACOTE ADD (SALDO_PAGAR NUMBER(7,2) DEFAULT 1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161228_0845__mantis8122.sql b/src/db/migration/migration/V20161228_0845__mantis8122.sql new file mode 100644 index 000000000..6325bab49 --- /dev/null +++ b/src/db/migration/migration/V20161228_0845__mantis8122.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ADM > RELATORIOS >> IMPRESSAO RMD'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.IMPRESSAORMD'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161228_1030__mantis8120.sql b/src/db/migration/migration/V20161228_1030__mantis8120.sql new file mode 100644 index 000000000..5f69d0f20 --- /dev/null +++ b/src/db/migration/migration/V20161228_1030__mantis8120.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (CODESTABELECIMENTO NUMBER(4))'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20161228_1031__mantis8120.sql b/src/db/migration/migration/V20161228_1031__mantis8120.sql new file mode 100644 index 000000000..e7f9c88b4 --- /dev/null +++ b/src/db/migration/migration/V20161228_1031__mantis8120.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (TRIBUTACAOIMPORTACAO NUMBER(5,2))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161228_1032__mantis8120.sql b/src/db/migration/migration/V20161228_1032__mantis8120.sql new file mode 100644 index 000000000..1a8484a98 --- /dev/null +++ b/src/db/migration/migration/V20161228_1032__mantis8120.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTADO ADD (CODESTABELECIMENTO NUMBER(4))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161228_1746__mantis7788.sql b/src/db/migration/migration/V20161228_1746__mantis7788.sql new file mode 100644 index 000000000..45d551f1c --- /dev/null +++ b/src/db/migration/migration/V20161228_1746__mantis7788.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEV_ADIANTAMENTO_CLIENTE MODIFY (CONTAFINANCEIRA VARCHAR2(6))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161228_1811__mantis7788.sql b/src/db/migration/migration/V20161228_1811__mantis7788.sql new file mode 100644 index 000000000..c2be22fdf --- /dev/null +++ b/src/db/migration/migration/V20161228_1811__mantis7788.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE MODIFY (CONTAFINANCEIRA VARCHAR2(6))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20161229_1144__mantis8465.sql b/src/db/migration/migration/V20161229_1144__mantis8465.sql new file mode 100644 index 000000000..4bc4a8de2 --- /dev/null +++ b/src/db/migration/migration/V20161229_1144__mantis8465.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE NOTA_CREDITO_VENDA_PACOTE ADD + ( + PUNTOVENTA_ID NUMBER(7,0), + PUNTOVENTAPAGAMENTO_ID NUMBER(7,0), + USUARIOPAGAMENTO_ID NUMBER(7,0), + DATANOTACREDITO DATE + )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161229_1145__mantis8465.sql b/src/db/migration/migration/V20161229_1145__mantis8465.sql new file mode 100644 index 000000000..085e0b3d9 --- /dev/null +++ b/src/db/migration/migration/V20161229_1145__mantis8465.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE NOTA_CREDITO_VENDA_PACOTE ADD CONSTRAINT FK_PUNTOVENTA_NC FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; diff --git a/src/db/migration/migration/V20161229_1146__mantis8465.sql b/src/db/migration/migration/V20161229_1146__mantis8465.sql new file mode 100644 index 000000000..9c73d5cf5 --- /dev/null +++ b/src/db/migration/migration/V20161229_1146__mantis8465.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE NOTA_CREDITO_VENDA_PACOTE ADD CONSTRAINT FK_PUNTOVENTA_NC_PAG FOREIGN KEY (PUNTOVENTAPAGAMENTO_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; diff --git a/src/db/migration/migration/V20161229_1147__mantis8465.sql b/src/db/migration/migration/V20161229_1147__mantis8465.sql new file mode 100644 index 000000000..c59409eea --- /dev/null +++ b/src/db/migration/migration/V20161229_1147__mantis8465.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE NOTA_CREDITO_VENDA_PACOTE ADD CONSTRAINT FK_USUARIO_NC_PAG FOREIGN KEY (USUARIOPAGAMENTO_ID) REFERENCES USUARIO (USUARIO_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; diff --git a/src/db/migration/migration/V20161229_1515__mantis8120.sql b/src/db/migration/migration/V20161229_1515__mantis8120.sql new file mode 100644 index 000000000..6ff5ecae2 --- /dev/null +++ b/src/db/migration/migration/V20161229_1515__mantis8120.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -00001); +begin + execute immediate 'UPDATE EMPRESA_IMPOSTO SET CODESTABELECIMENTO = NULL'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO MODIFY (CODESTABELECIMENTO VARCHAR2(4))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161229_1516__mantis8120.sql b/src/db/migration/migration/V20161229_1516__mantis8120.sql new file mode 100644 index 000000000..a2238105b --- /dev/null +++ b/src/db/migration/migration/V20161229_1516__mantis8120.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -00001); +begin + execute immediate 'UPDATE EMPRESA_IMPOSTO SET CODIGOCONTABILMUNICIPAL = NULL'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO MODIFY (CODIGOCONTABILMUNICIPAL VARCHAR2(15))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161229_1517__mantis8120.sql b/src/db/migration/migration/V20161229_1517__mantis8120.sql new file mode 100644 index 000000000..290008266 --- /dev/null +++ b/src/db/migration/migration/V20161229_1517__mantis8120.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -00001); +begin + execute immediate 'UPDATE EMPRESA_IMPOSTO SET CODIGOCONTABILESTADUAL = NULL'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO MODIFY (CODIGOCONTABILESTADUAL VARCHAR2(15))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161229_1518__mantis8120.sql b/src/db/migration/migration/V20161229_1518__mantis8120.sql new file mode 100644 index 000000000..249a31b85 --- /dev/null +++ b/src/db/migration/migration/V20161229_1518__mantis8120.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -00001); +begin + execute immediate 'UPDATE ESTADO SET CODESTABELECIMENTO = NULL'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTADO MODIFY (CODESTABELECIMENTO VARCHAR2(4))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161229_1519__mantis8120.sql b/src/db/migration/migration/V20161229_1519__mantis8120.sql new file mode 100644 index 000000000..463e17588 --- /dev/null +++ b/src/db/migration/migration/V20161229_1519__mantis8120.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -00001); +begin + execute immediate 'UPDATE FISCAL_IMPRESSORA SET NUMEROIDENTIFICACAO = NULL'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA MODIFY (NUMEROIDENTIFICACAO VARCHAR2(3))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20161230_1417__mantis7788.sql b/src/db/migration/migration/V20161230_1417__mantis7788.sql new file mode 100644 index 000000000..3885f4683 --- /dev/null +++ b/src/db/migration/migration/V20161230_1417__mantis7788.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_01451 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); +begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER MODIFY (CLIENTE NULL)'; + + exception + when object_exists then null; + when except_01451 then null; +end; diff --git a/src/db/migration/migration/V20161231_1540__mantis7983.sql b/src/db/migration/migration/V20161231_1540__mantis7983.sql new file mode 100644 index 000000000..100aa71b8 --- /dev/null +++ b/src/db/migration/migration/V20161231_1540__mantis7983.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD INDLIBERCARD NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170102_1615__mantis8485.sql b/src/db/migration/migration/V20170102_1615__mantis8485.sql new file mode 100644 index 000000000..dc508047b --- /dev/null +++ b/src/db/migration/migration/V20170102_1615__mantis8485.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (TIPODESCCOMPPRECO NUMBER(1,0), + DESCCOMPPRECO NUMBER(5,2))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170106_1026__mantis8367.sql b/src/db/migration/migration/V20170106_1026__mantis8367.sql new file mode 100644 index 000000000..4247a6b2d --- /dev/null +++ b/src/db/migration/migration/V20170106_1026__mantis8367.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''HABILITAR REIMPRESSAO OCD'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.CANCELARBOLETOS.REIMPRESSAOCD'',1,SYSDATE,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170109_1439__mantis8500.sql b/src/db/migration/migration/V20170109_1439__mantis8500.sql new file mode 100644 index 000000000..18891866d --- /dev/null +++ b/src/db/migration/migration/V20170109_1439__mantis8500.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE VENDA_PACOTE ADD (FECMODIF DATE)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170109_1517__mantis7788.sql b/src/db/migration/migration/V20170109_1517__mantis7788.sql new file mode 100644 index 000000000..18cd528ca --- /dev/null +++ b/src/db/migration/migration/V20170109_1517__mantis7788.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_01451 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); +begin + execute immediate 'ALTER TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER MODIFY (AGENTECOBRADOR NULL)'; + + exception + when object_exists then null; + when except_01451 then null; +end; diff --git a/src/db/migration/migration/V20170110_1710__mantis8522.sql b/src/db/migration/migration/V20170110_1710__mantis8522.sql new file mode 100644 index 000000000..24e373d33 --- /dev/null +++ b/src/db/migration/migration/V20170110_1710__mantis8522.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table caja add SERIEIMPFISCALORIGINAL VARCHAR2(6 BYTE)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table boleto add SERIEIMPFISCALORIGINAL VARCHAR2(6 BYTE)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170111_0955__mantis8340.sql b/src/db/migration/migration/V20170111_0955__mantis8340.sql new file mode 100644 index 000000000..79adeeec0 --- /dev/null +++ b/src/db/migration/migration/V20170111_0955__mantis8340.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,EQUIVALENCIAELEKTRA_ID,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO) values (''96'',''RESERVADA'',''B'',null,null,''1'',sysdate,''-3'',''RESERVADA'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170111_1121__mantis8340.sql b/src/db/migration/migration/V20170111_1121__mantis8340.sql new file mode 100644 index 000000000..3a73f72b0 --- /dev/null +++ b/src/db/migration/migration/V20170111_1121__mantis8340.sql @@ -0,0 +1,13 @@ +declare + + dup_val_on_index exception; + + pragma exception_init (dup_val_on_index , -00001); + +begin + + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,EQUIVALENCIAELEKTRA_ID,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO) values (''97'',''OCUPADA'',''B'',null,null,''1'',sysdate,''-3'',''OCUPADA'')'; + + exception when dup_val_on_index then null; + +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170111_1122__mantis8340.sql b/src/db/migration/migration/V20170111_1122__mantis8340.sql new file mode 100644 index 000000000..47451724a --- /dev/null +++ b/src/db/migration/migration/V20170111_1122__mantis8340.sql @@ -0,0 +1,13 @@ +declare + + dup_val_on_index exception; + + pragma exception_init (dup_val_on_index , -00001); + +begin + + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,EQUIVALENCIAELEKTRA_ID,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO) values (''98'',''LIBERADA'',''B'',null,null,''1'',sysdate,''-3'',''LIBERADA'')'; + + exception when dup_val_on_index then null; + +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170111_1926__mantis8340.sql b/src/db/migration/migration/V20170111_1926__mantis8340.sql new file mode 100644 index 000000000..cd0117165 --- /dev/null +++ b/src/db/migration/migration/V20170111_1926__mantis8340.sql @@ -0,0 +1,14 @@ + +declare + + dup_val_on_index exception; + + pragma exception_init (dup_val_on_index , -00001); + +begin + + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,EQUIVALENCIAELEKTRA_ID,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO) values (95,''POLTRONA_EXCLUSIVA'',''B'',null,null,''1'',sysdate,''-3'',''POLTRONA_EXCLUSIVA'')'; + + exception when dup_val_on_index then null; + +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170112_1109__mantis7788.sql b/src/db/migration/migration/V20170112_1109__mantis7788.sql new file mode 100644 index 000000000..9ebc0e2c1 --- /dev/null +++ b/src/db/migration/migration/V20170112_1109__mantis7788.sql @@ -0,0 +1,31 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (INDINTEGRADOAG NUMBER(1))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_CNTCORRENTE ADD (INDINTEGRADOAG NUMBER(1))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONTA_CORRENTE_PTOVTA ADD (INDINTEGRADOAG NUMBER(1))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_CCT_DEPOSITO ADD (INDINTEGRADOAG NUMBER(1))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170112_1659__mantis8529.sql b/src/db/migration/migration/V20170112_1659__mantis8529.sql new file mode 100644 index 000000000..f37988488 --- /dev/null +++ b/src/db/migration/migration/V20170112_1659__mantis8529.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_TARJETA MODIFY (NSU VARCHAR2(30 BYTE))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170113_0942__mantis7788.sql b/src/db/migration/migration/V20170113_0942__mantis7788.sql new file mode 100644 index 000000000..5f05f72e0 --- /dev/null +++ b/src/db/migration/migration/V20170113_0942__mantis7788.sql @@ -0,0 +1,79 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_BAIXA_VENCTOCARTAO MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_DEV_ADIANTAMENTO_CLIENTE MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_RATEIO_CTAS_RECEBER MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_SERVICOS_CTAS_RECEBER MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_VNCTO_CARTAO_CTAS_RECEBER MODIFY (MOTIVONAOINTEGRADO VARCHAR2(600))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170113_1123__mantis8533.sql b/src/db/migration/migration/V20170113_1123__mantis8533.sql new file mode 100644 index 000000000..1d6a75580 --- /dev/null +++ b/src/db/migration/migration/V20170113_1123__mantis8533.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE OCD_PARAM ADD (TIEMPOLIMITEPENALIZACION NUMBER(5,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170113_1757__mantis8466.sql b/src/db/migration/migration/V20170113_1757__mantis8466.sql new file mode 100644 index 000000000..5c39fa452 --- /dev/null +++ b/src/db/migration/migration/V20170113_1757__mantis8466.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS ADD (NOTACREDITOVENDAPACOTE_ID NUMBER(7,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170113_1758__mantis8466.sql b/src/db/migration/migration/V20170113_1758__mantis8466.sql new file mode 100644 index 000000000..154bb4e74 --- /dev/null +++ b/src/db/migration/migration/V20170113_1758__mantis8466.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS ADD CONSTRAINT FK_NC_PACOTE FOREIGN KEY (NOTACREDITOVENDAPACOTE_ID) REFERENCES NOTA_CREDITO_VENDA_PACOTE (NOTACREDITOVENDAPACOTE_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; diff --git a/src/db/migration/migration/V20170116_1644__mantis7788.sql b/src/db/migration/migration/V20170116_1644__mantis7788.sql new file mode 100644 index 000000000..a81c94ccc --- /dev/null +++ b/src/db/migration/migration/V20170116_1644__mantis7788.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER ADD (FECHAMENTOCNTCORRENTE_ID NUMBER(7))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170117_1400__GravaR7.sql b/src/db/migration/migration/V20170117_1400__GravaR7.sql new file mode 100644 index 000000000..bd2af05f4 --- /dev/null +++ b/src/db/migration/migration/V20170117_1400__GravaR7.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_R7 ADD (BOLETO_ID NUMBER(15))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170117_1419__mantis8367.sql b/src/db/migration/migration/V20170117_1419__mantis8367.sql new file mode 100644 index 000000000..cba64881a --- /dev/null +++ b/src/db/migration/migration/V20170117_1419__mantis8367.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE OCD ADD (CANT_REIMPRESION NUMBER(5) DEFAULT 1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170119_1058__mantis8360.sql b/src/db/migration/migration/V20170119_1058__mantis8360.sql new file mode 100644 index 000000000..23518c3b6 --- /dev/null +++ b/src/db/migration/migration/V20170119_1058__mantis8360.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE EMBARCADA_LIMITES (EMBARCADA_LIMITES_ID NUMBER(15) NOT NULL, LIMITE_BILHETE NUMBER(15) NOT NULL, LIMITE_DIV NUMBER(15) NOT NULL, LIMITE_DIAS NUMBER(15) NOT NULL, AVISO_BILHETE NUMBER(15) NOT NULL,AVISO_DIV NUMBER(15) NOT NULL,AVISO_DIAS NUMBER(15) NOT NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE EMBARCADA_LIMITES_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170120_1031__mantis8360.sql b/src/db/migration/migration/V20170120_1031__mantis8360.sql new file mode 100644 index 000000000..8cf622971 --- /dev/null +++ b/src/db/migration/migration/V20170120_1031__mantis8360.sql @@ -0,0 +1,15 @@ + +declare +begin + execute immediate 'Insert into EMBARCADA_LIMITES ( + EMBARCADA_LIMITES_ID , + LIMITE_BILHETE , + LIMITE_DIV , + LIMITE_DIAS , + AVISO_BILHETE , + AVISO_DIV , + AVISO_DIAS + ) values (1,2000,15,20,1000,10,10)'; + + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170120_1136__mantis8360.sql b/src/db/migration/migration/V20170120_1136__mantis8360.sql new file mode 100644 index 000000000..d65008737 --- /dev/null +++ b/src/db/migration/migration/V20170120_1136__mantis8360.sql @@ -0,0 +1,24 @@ +declare +begin + execute immediate 'Insert into CONSTANTE ( + CONSTANTE_ID, + NOMBCONSTANTE, + DESCCONSTANTE, + INDTIPOCONSTANTE, + VALORCONSTANTE, + INDMANTENIMIENTOUSUARIO, + ACTIVO, + FECMODIF, + USUARIO_ID) +values ( + CONSTANTE_SEQ.nextval, + ''EMBARCADA_CHECKBOX_SEGUROOPCIONAL'', + ''EMBARCADA_CHECKBOX_SEGUROOPCIONAL'', + ''1'', + ''false'', + ''1'', + ''1'', + to_date(sysdate,''DD/MM/YYYY HH24:MI:SS''), + ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170203_0930__mantis8360.sql b/src/db/migration/migration/V20170203_0930__mantis8360.sql new file mode 100644 index 000000000..8febea60e --- /dev/null +++ b/src/db/migration/migration/V20170203_0930__mantis8360.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EMBARCADA_SINCRONISMO ADD (FECHADO NUMBER(1))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170203_1428__mantis8371.sql b/src/db/migration/migration/V20170203_1428__mantis8371.sql new file mode 100644 index 000000000..35ef68d50 --- /dev/null +++ b/src/db/migration/migration/V20170203_1428__mantis8371.sql @@ -0,0 +1,24 @@ +declare +begin + execute immediate 'Insert into CONSTANTE ( + CONSTANTE_ID, + NOMBCONSTANTE, + DESCCONSTANTE, + INDTIPOCONSTANTE, + VALORCONSTANTE, + INDMANTENIMIENTOUSUARIO, + ACTIVO, + FECMODIF, + USUARIO_ID) +values ( + CONSTANTE_SEQ.nextval, + ''HORA_EXEC_CONFERENCIA_MOVIMENTO'', + ''HORA_EXEC_CONFERENCIA_MOVIMENTO'', + 1, + NULL, + 1, + 1, + sysdate, + 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170208_1030__mantis8613.sql b/src/db/migration/migration/V20170208_1030__mantis8613.sql new file mode 100644 index 000000000..4da86017a --- /dev/null +++ b/src/db/migration/migration/V20170208_1030__mantis8613.sql @@ -0,0 +1,114 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00955); +begin + execute immediate 'CREATE TABLE COMISSAO ( + COMISSAO_ID NUMBER(7) NOT NULL , + COMPETENCIA VARCHAR2(7 BYTE) NULL , + ACTIVO NUMBER(1) NULL , + FECMODIF DATE NULL , + DATAPAGAMENTO DATE NULL , + INDPAGO NUMBER(1) NULL , + PUNTOVENTA_ID NUMBER(7) NULL , + EMPRESA_ID NUMBER(7) NULL , + USUARIO_ID NUMBER(7) NULL , + USUARIOPAGAMENTO_ID NUMBER(7) NULL , + COMISSAO_BPR NUMBER(7,2) NULL , + RECEITA_EXCESSOBAGAGEM NUMBER(7,2) NULL , + RECEITA_SEGUROOPCIONAL NUMBER(7,2) NULL , + DESCONTOS_FIXOS NUMBER(7,2) NULL , + DESCONTOS_EVENTUAIS NUMBER(7,2) NULL , + ROYATIES NUMBER(7,2) NULL , + ISS_RETIDO NUMBER(7,2) NULL , + BONIFICACAO_METAS NUMBER(7,2) NULL , + ENTREGAS_PASSAGEM NUMBER(7,2) NULL , + RECEITA_OUTROS NUMBER(7) NULL + )'; + exception when dup_val_on_index then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD CHECK (COMISSAO_ID IS NOT NULL)'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_02260 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02260 , -02260); +begin + execute immediate 'ALTER TABLE COMISSAO ADD PRIMARY KEY (COMISSAO_ID)'; + + exception + when object_exists then null; + when except_02260 then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE COMISSAO ADD FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE COMISSAO ADD FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO (USUARIO_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE COMISSAO ADD FOREIGN KEY (USUARIOPAGAMENTO_ID) REFERENCES USUARIO (USUARIO_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE COMISSAO ADD FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA (EMPRESA_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE COMISSAO_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170208_1138__mantis8613.sql b/src/db/migration/migration/V20170208_1138__mantis8613.sql new file mode 100644 index 000000000..407568bd9 --- /dev/null +++ b/src/db/migration/migration/V20170208_1138__mantis8613.sql @@ -0,0 +1,16 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD (INDINTEGRADOAG NUMBER(1) DEFAULT 0 NOT NULL)'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD CHECK (INDINTEGRADOAG IS NOT NULL)'; + exception when dup_val_on_index then null; +end; + diff --git a/src/db/migration/migration/V20170208_1500__Correcao_Indice_FiscalEnvioFisco.sql b/src/db/migration/migration/V20170208_1500__Correcao_Indice_FiscalEnvioFisco.sql new file mode 100644 index 000000000..907d4f182 --- /dev/null +++ b/src/db/migration/migration/V20170208_1500__Correcao_Indice_FiscalEnvioFisco.sql @@ -0,0 +1,11 @@ +declare + column_exists exception; + object_exists exception; + pragma exception_init (object_exists , -02260); + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_ENVIO_FISCO ADD CONSTRAINT FISCAL_ENVIO_FISCO_PK PRIMARY KEY (FISCALENVIOFISCO_ID) ENABLE'; + exception + when object_exists then null; + when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170208_1501__Correcao_Indice_FiscalEnvioFisco.sql b/src/db/migration/migration/V20170208_1501__Correcao_Indice_FiscalEnvioFisco.sql new file mode 100644 index 000000000..797c99a25 --- /dev/null +++ b/src/db/migration/migration/V20170208_1501__Correcao_Indice_FiscalEnvioFisco.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_01408 exception; + + pragma exception_init (object_exists , -00955); + pragma exception_init (except_01408 , -01408); +begin + execute immediate 'CREATE INDEX IDX_FISCAL_FISCO ON FISCAL_ENVIO_FISCO (NUMSERIE20, DATAMOV) COMPRESS'; + + exception + when object_exists then null; + when except_01408 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170210_1418__mantis8616.sql b/src/db/migration/migration/V20170210_1418__mantis8616.sql new file mode 100644 index 000000000..eee8773ba --- /dev/null +++ b/src/db/migration/migration/V20170210_1418__mantis8616.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA ADD INDNAOUSAASSENTO NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170210_1439__mantis8614.sql b/src/db/migration/migration/V20170210_1439__mantis8614.sql new file mode 100644 index 000000000..37e466ee1 --- /dev/null +++ b/src/db/migration/migration/V20170210_1439__mantis8614.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (BOLETOANTERIOR_ID NUMBER(15,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170210_1440__mantis8614.sql b/src/db/migration/migration/V20170210_1440__mantis8614.sql new file mode 100644 index 000000000..49e7cb6d0 --- /dev/null +++ b/src/db/migration/migration/V20170210_1440__mantis8614.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD ( + TRANSACAO_ID NUMBER(15,0), + TRANSACAOORIGINAL_ID NUMBER(15,0), + DESCNUMDOC VARCHAR2(45 BYTE), + DESCNUMDOC2 VARCHAR2(45 BYTE), + DESCTIPODOC VARCHAR2(15 BYTE), + DESCTIPODOC2 VARCHAR2(15 BYTE), + DESCTELEFONO VARCHAR2(15 BYTE) + )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170210_1814__mantis8371.sql b/src/db/migration/migration/V20170210_1814__mantis8371.sql new file mode 100644 index 000000000..b462f0991 --- /dev/null +++ b/src/db/migration/migration/V20170210_1814__mantis8371.sql @@ -0,0 +1,7 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CONSTANTE SET VALORCONSTANTE = NULL WHERE NOMBCONSTANTE = ''HORA_GENERACION_CORRIDA'''; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20170213_1430__mantis8360.sql b/src/db/migration/migration/V20170213_1430__mantis8360.sql new file mode 100644 index 000000000..a469f1aa7 --- /dev/null +++ b/src/db/migration/migration/V20170213_1430__mantis8360.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE VENDA_EMBARCADA ADD (boletoId NUMBER(20))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170213_1500__mantis8585.sql b/src/db/migration/migration/V20170213_1500__mantis8585.sql new file mode 100644 index 000000000..d1f10f44e --- /dev/null +++ b/src/db/migration/migration/V20170213_1500__mantis8585.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE DET_ABASTO_BOLETO ADD (AIDF_ID NUMBER(15))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170214_1030__mantis8585.sql b/src/db/migration/migration/V20170214_1030__mantis8585.sql new file mode 100644 index 000000000..e47fa84ac --- /dev/null +++ b/src/db/migration/migration/V20170214_1030__mantis8585.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (AIDF_ID NUMBER(15))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170214_1034__mantis8613.sql b/src/db/migration/migration/V20170214_1034__mantis8613.sql new file mode 100644 index 000000000..03fead13a --- /dev/null +++ b/src/db/migration/migration/V20170214_1034__mantis8613.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR ADD (ISSBASE NUMBER(12,2))'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR ADD (ISSVALOR NUMBER(12,2))'; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20170214_1035__mantis8585.sql b/src/db/migration/migration/V20170214_1035__mantis8585.sql new file mode 100644 index 000000000..244a87e63 --- /dev/null +++ b/src/db/migration/migration/V20170214_1035__mantis8585.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (AIDF_ID NUMBER(15))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170214_1121__mantis8613.sql b/src/db/migration/migration/V20170214_1121__mantis8613.sql new file mode 100644 index 000000000..5fd623fa5 --- /dev/null +++ b/src/db/migration/migration/V20170214_1121__mantis8613.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR ADD (COMPETENCIA VARCHAR2(10))'; + exception when dup_val_on_index then null; +end; + + + diff --git a/src/db/migration/migration/V20170215_1630__mantis8613.sql b/src/db/migration/migration/V20170215_1630__mantis8613.sql new file mode 100644 index 000000000..4c09ec509 --- /dev/null +++ b/src/db/migration/migration/V20170215_1630__mantis8613.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR MODIFY (FORNECEDOR VARCHAR2(30))'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170215_1755__mantis8613.sql b/src/db/migration/migration/V20170215_1755__mantis8613.sql new file mode 100644 index 000000000..ce46683fa --- /dev/null +++ b/src/db/migration/migration/V20170215_1755__mantis8613.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -01430); +begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR ADD (COMISSAO_ID NUMBER(7))'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170216_0949__mantis8530.sql b/src/db/migration/migration/V20170216_0949__mantis8530.sql new file mode 100644 index 000000000..4b95cd627 --- /dev/null +++ b/src/db/migration/migration/V20170216_0949__mantis8530.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_TARJETA MODIFY (NSU VARCHAR2(45 BYTE))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170217_1453__8638.sql b/src/db/migration/migration/V20170217_1453__8638.sql new file mode 100644 index 000000000..ad0881b1b --- /dev/null +++ b/src/db/migration/migration/V20170217_1453__8638.sql @@ -0,0 +1,7 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update autorizacion set NOMBAUTORIZACION = ''AUT_AUMENTA_DISPONIBILIDAD'' where NOMBAUTORIZACION = ''AUT_AUMENTA_DISPONIB'''; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20170217_1523__erro_constante_corrida.sql b/src/db/migration/migration/V20170217_1523__erro_constante_corrida.sql new file mode 100644 index 000000000..b53b1cc3e --- /dev/null +++ b/src/db/migration/migration/V20170217_1523__erro_constante_corrida.sql @@ -0,0 +1,15 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CONSTANTE SET VALORCONSTANTE = NULL WHERE NOMBCONSTANTE = ''HORA_EXEC_CONFERENCIA_MOVIMENTO'''; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CONSTANTE SET VALORCONSTANTE = ''03:00'' WHERE NOMBCONSTANTE = ''HORA_GENERACION_CORRIDA'' and VALORCONSTANTE is null'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20170222_1556__mantis8614.sql b/src/db/migration/migration/V20170222_1556__mantis8614.sql new file mode 100644 index 000000000..5c8ec7888 --- /dev/null +++ b/src/db/migration/migration/V20170222_1556__mantis8614.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE INTEGRACAO_SAP (CAJA_ID NUMBER(15,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170223_1128__mantis8614.sql b/src/db/migration/migration/V20170223_1128__mantis8614.sql new file mode 100644 index 000000000..7449ce4c3 --- /dev/null +++ b/src/db/migration/migration/V20170223_1128__mantis8614.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE DADOSPAGTO_SEQ INCREMENT BY 1 MAXVALUE 9999999 MINVALUE 1 CACHE 20'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170223_1520__mantis8662.sql b/src/db/migration/migration/V20170223_1520__mantis8662.sql new file mode 100644 index 000000000..72fa1475b --- /dev/null +++ b/src/db/migration/migration/V20170223_1520__mantis8662.sql @@ -0,0 +1,19 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'create table OCD_PTOVTA_PARAM (OCDPTOVTAPARAM_ID NUMBER(15,0), +OCDPARAM_ID NUMBER(15,0), +PUNTOVENTA_ID NUMBER(15,0), +ACTIVO NUMBER(1,0), +FECMODIF DATE, +USUARIO_ID NUMBER(7,0), +PRIMARY KEY ("OCDPTOVTAPARAM_ID"), +FOREIGN KEY ("OCDPARAM_ID") +REFERENCES "OCD_PARAM"("OCDPARAM_ID"), +FOREIGN KEY ("PUNTOVENTA_ID") +REFERENCES "PUNTO_VENTA"("PUNTOVENTA_ID") +)'; + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170223_1521__mantis8662.sql b/src/db/migration/migration/V20170223_1521__mantis8662.sql new file mode 100644 index 000000000..14803c8d7 --- /dev/null +++ b/src/db/migration/migration/V20170223_1521__mantis8662.sql @@ -0,0 +1,9 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE OCD_PTOVTA_PARAM_SEQ + MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 + START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170307_1744__mantis8438.sql b/src/db/migration/migration/V20170307_1744__mantis8438.sql new file mode 100644 index 000000000..9856a650d --- /dev/null +++ b/src/db/migration/migration/V20170307_1744__mantis8438.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDOBRIGANOMEPASSAGEIRO NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170309_1543__mantis8749.sql b/src/db/migration/migration/V20170309_1543__mantis8749.sql new file mode 100644 index 000000000..6c8953c4e --- /dev/null +++ b/src/db/migration/migration/V20170309_1543__mantis8749.sql @@ -0,0 +1,14 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE OPERADORA_CARTAO ( + OPERADORACARTAO_ID NUMBER(7) NOT NULL, + DESCOPERADORACARTAO VARCHAR2(50) NULL, + ACTIVO NUMBER(1) NULL, + USUARIO_ID NUMBER(7) NULL, + FECMODIF DATE NULL, + PRIMARY KEY (OPERADORACARTAO_ID) + )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170309_1544__mantis8749.sql b/src/db/migration/migration/V20170309_1544__mantis8749.sql new file mode 100644 index 000000000..6ca270fb0 --- /dev/null +++ b/src/db/migration/migration/V20170309_1544__mantis8749.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE OPERADORA_CARTAO_SEQ INCREMENT BY 1 MAXVALUE 9999999 MINVALUE 1 CACHE 20'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170309_1545__mantis8749.sql b/src/db/migration/migration/V20170309_1545__mantis8749.sql new file mode 100644 index 000000000..6d3b67c16 --- /dev/null +++ b/src/db/migration/migration/V20170309_1545__mantis8749.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_TARJETA ADD DESCOPERADORACARTAO VARCHAR2(50)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170310_1815__mantis0008366.sql b/src/db/migration/migration/V20170310_1815__mantis0008366.sql new file mode 100644 index 000000000..8e563ea9e --- /dev/null +++ b/src/db/migration/migration/V20170310_1815__mantis0008366.sql @@ -0,0 +1,165 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AUDIT_MODULE ( + AUDITMODULE_ID NUMBER(7,0) NOT NULL, + NAMEMODULE VARCHAR2(180 BYTE) NOT NULL, + INDAUDITABLE NUMBER(1,0) DEFAULT 0, + PRIMARY KEY ("AUDITMODULE_ID") + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AUDIT_SERVICE ( + AUDITSERVICE_ID NUMBER(7,0) NOT NULL, + NAMESERVICE VARCHAR2(180 BYTE), + AUDITMODULE_ID NUMBER(7,0) NOT NULL, + FUNCIONSISTEMA_ID NUMBER(7,0), + PRIMARY KEY ("AUDITSERVICE_ID"), + CONSTRAINT "FK_SERVICEAUDIT_MODULEAUDIT" FOREIGN KEY ("AUDITMODULE_ID") REFERENCES AUDIT_MODULE("AUDITMODULE_ID"), + CONSTRAINT "FK_FUNCIONSISTEMA_AUDITSERVICE" FOREIGN KEY ("FUNCIONSISTEMA_ID") REFERENCES FUNCION_SISTEMA("FUNCIONSISTEMA_ID") + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AUDIT_ACTION ( + AUDITACTION_ID NUMBER(2,0) NOT NULL, + ACTIONNAME VARCHAR2(180 BYTE) NOT NULL, + PRIMARY KEY ("AUDITACTION_ID") + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AUDIT_LOG ( + AUDITLOG_ID NUMBER(7,0) NOT NULL, + AUDITACTION_ID NUMBER(2,0) NOT NULL, + SISTEMA_ID NUMBER(7,0) NOT NULL, + CREATED_DATE DATE NOT NULL, + ENTITY_NAME VARCHAR2(180 BYTE) NOT NULL, + USUARIO_ID NUMBER(7,0) NOT NULL, + ENTITY_DETAIL VARCHAR2(4000 BYTE) NOT NULL, + AUDITSERVICE_ID NUMBER(7,0) NOT NULL, + PRIMARY KEY ("AUDITLOG_ID"), + CONSTRAINT "FK_AUDITACTION_AUDITLOG" FOREIGN KEY ("AUDITACTION_ID") REFERENCES AUDIT_ACTION("AUDITACTION_ID"), + CONSTRAINT "FK_SISTEMA_AUDITLOG" FOREIGN KEY ("SISTEMA_ID") REFERENCES SISTEMA("SISTEMA_ID"), + CONSTRAINT "FK_USUARIO_AUDITLOG" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID"), + CONSTRAINT "FK_AUDITSERVICE_AUDITLOG" FOREIGN KEY ("AUDITSERVICE_ID") REFERENCES AUDIT_SERVICE("AUDITSERVICE_ID") + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE AUDIT_LOG_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_ACTION (AUDITACTION_ID,ACTIONNAME) values (''1'',''Cria��o de Registro'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_ACTION (AUDITACTION_ID,ACTIONNAME) values (''2'',''Altera��o de registro'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_ACTION (AUDITACTION_ID,ACTIONNAME) values (''3'',''Exclus�o de Registro'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_MODULE (AUDITMODULE_ID,NAMEMODULE,INDAUDITABLE) values (''1'',''Cria��o/ Altera��o de Servi�o'',''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_MODULE (AUDITMODULE_ID,NAMEMODULE,INDAUDITABLE) values (''2'',''Altera��o de Pre�o'',''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_MODULE (AUDITMODULE_ID,NAMEMODULE,INDAUDITABLE) values (''3'',''Bloqueio dos servi�os'',''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_MODULE (AUDITMODULE_ID,NAMEMODULE,INDAUDITABLE) values (''4'',''Cria��o e altera��o de usu�rios'',''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_MODULE (AUDITMODULE_ID,NAMEMODULE,INDAUDITABLE) values (''5'',''Linha'',''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_MODULE (AUDITMODULE_ID,NAMEMODULE,INDAUDITABLE) values (''6'',''Altera��o de Perfil'',''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_MODULE (AUDITMODULE_ID,NAMEMODULE,INDAUDITABLE) values (''7'',''Manuten��o de servi�os'',''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_SERVICE (AUDITSERVICE_ID,NAMESERVICE,AUDITMODULE_ID,FUNCIONSISTEMA_ID) values (''1'',''/Ajustar_corridas/CancelarCorridas'',''1'',null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_SERVICE (AUDITSERVICE_ID,NAMESERVICE,AUDITMODULE_ID,FUNCIONSISTEMA_ID) values (''2'',''/Ajustar_corridas/ExcluirCorridas'',''1'',null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_SERVICE (AUDITSERVICE_ID,NAMESERVICE,AUDITMODULE_ID,FUNCIONSISTEMA_ID) values (''3'',''/Ajustar_corridas/ReactivarCorridas'',''1'',null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_SERVICE (AUDITSERVICE_ID,NAMESERVICE,AUDITMODULE_ID,FUNCIONSISTEMA_ID) values (''5'',null,''4'',''193'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into AUDIT_SERVICE (AUDITSERVICE_ID,NAMESERVICE,AUDITMODULE_ID,FUNCIONSISTEMA_ID) values (''6'',null,''2'',''180'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170314_1545__mantis8444.sql b/src/db/migration/migration/V20170314_1545__mantis8444.sql new file mode 100644 index 000000000..a50e9b954 --- /dev/null +++ b/src/db/migration/migration/V20170314_1545__mantis8444.sql @@ -0,0 +1,29 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD IDADE_MINIMA NUMBER(2,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD CATEGORIA_ID NUMBER(7,0)'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD CONSTRAINT FK_ORGAO_CONCEDENTE_CATEGORIA FOREIGN KEY (CATEGORIA_ID) REFERENCES CATEGORIA (CATEGORIA_ID)'; + + exception + when object_exists then null; + when except_02275 then null; +end; diff --git a/src/db/migration/migration/V20170314_1621__mantis8753.sql b/src/db/migration/migration/V20170314_1621__mantis8753.sql new file mode 100644 index 000000000..e4615c364 --- /dev/null +++ b/src/db/migration/migration/V20170314_1621__mantis8753.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'ALTER TABLE SECRETARIA MODIFY CVESECRETARIA VARCHAR2(14)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170314_1644__mantis8688.sql b/src/db/migration/migration/V20170314_1644__mantis8688.sql new file mode 100644 index 000000000..7c9d7bd34 --- /dev/null +++ b/src/db/migration/migration/V20170314_1644__mantis8688.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate ' INSERT INTO CATEGORIA(CATEGORIA_ID,DESCCATEGORIA,INDEMITETERMORECUSA,ACTIVO) VALUES (6,''PASAJERO_QUEDADO'', 0, 0)'; + + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170315_1343__mantis8754.sql b/src/db/migration/migration/V20170315_1343__mantis8754.sql new file mode 100644 index 000000000..66e3b71f3 --- /dev/null +++ b/src/db/migration/migration/V20170315_1343__mantis8754.sql @@ -0,0 +1,20 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CAJA_DET_DEPOSITO_PAGO ( + CAJADETDEPOSITOPAGO_ID NUMBER(15) NOT NULL, + IDENTIFICACAO_DEPOSITO VARCHAR2(50) NULL, + FECDEPOSITO DATE NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + IMPORTE NUMBER(7,2) NULL, + CAJADIVERSOSPAGO_ID NUMBER(15) NULL, + CAJAFORMAPAGO_ID NUMBER(15) NULL, + PRIMARY KEY (CAJADETDEPOSITOPAGO_ID), + FOREIGN KEY (CAJAFORMAPAGO_ID) REFERENCES CAJA_FORMAPAGO, + FOREIGN KEY (CAJADIVERSOSPAGO_ID) REFERENCES CAJA_DIVERSOS_PAGO + )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170315_1344__mantis8754.sql b/src/db/migration/migration/V20170315_1344__mantis8754.sql new file mode 100644 index 000000000..fe0f96d6c --- /dev/null +++ b/src/db/migration/migration/V20170315_1344__mantis8754.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE CAJA_DET_DEPOSITO_PAGO_SEQ INCREMENT BY 1 MAXVALUE 9999999 MINVALUE 1 CACHE 20'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170321_1627__mantis8786.sql b/src/db/migration/migration/V20170321_1627__mantis8786.sql new file mode 100644 index 000000000..4e3fde584 --- /dev/null +++ b/src/db/migration/migration/V20170321_1627__mantis8786.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + + 'CREATE TABLE "DIGITA_VENTA" + ( "DIGITAVENTA_ID" NUMBER(7,0) NOT NULL ENABLE, + "FECHORVENTA" DATE, + "USUARIO_ID" NUMBER(7,0) NOT NULL ENABLE, + "ESTACION_ID" NUMBER(7,0) NOT NULL ENABLE, + "IMPTOTAL" NUMBER(7,2) NOT NULL ENABLE, + CONSTRAINT "VENDA_PK" PRIMARY KEY ("DIGITAVENTA_ID") + USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS + STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 + PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) + TABLESPACE "USERS" ENABLE, + CONSTRAINT "VENDA_USUARIO_FK" FOREIGN KEY ("USUARIO_ID") + REFERENCES "USUARIO" ("USUARIO_ID") ENABLE + )'; +exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20170321_1705__mantis8786.sql b/src/db/migration/migration/V20170321_1705__mantis8786.sql new file mode 100644 index 000000000..00bec6430 --- /dev/null +++ b/src/db/migration/migration/V20170321_1705__mantis8786.sql @@ -0,0 +1,44 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + + 'CREATE TABLE "DIGITA_ITEM" + ( "DIGITAITEM_ID" NUMBER(3,0) NOT NULL ENABLE, + "DIGITAVENTA_ID" NUMBER(7,0) NOT NULL ENABLE, + "FORMAPAGO_ID" NUMBER(7,0), + "CORRIDA_ID" NUMBER NOT NULL ENABLE, + "FECCORRIDA" DATE NOT NULL ENABLE, + "FECHORVIAJE" DATE NOT NULL ENABLE, + "TIPOVENTA_ID" NUMBER(7,0), + "CANTPASAJE" NUMBER(3,0), + "SERIE" VARCHAR2(30 BYTE), + "SUBSERIE" VARCHAR2(30 BYTE), + "NUMINICIAL" NUMBER(7,0), + "PRECIO" NUMBER(7,2), + "DESCUENTO" NUMBER(7,2), + "IMPORTETAXAEMBARQUE" NUMBER(7,2), + "IMPORTEPEDAGIO" NUMBER(7,2), + "IMPORTEOUTROS" NUMBER(7,2), + "IMPORTESEGURO" NUMBER(7,2), + "CATEGORIA_ID" NUMBER(7,0), + CONSTRAINT "ITEMVENDA_PK" PRIMARY KEY ("DIGITAITEM_ID", "DIGITAVENTA_ID") + USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS + STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 + PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) + TABLESPACE "USERS" ENABLE, + CONSTRAINT "ITEMVENDA_CATEGORIA_FK" FOREIGN KEY ("CATEGORIA_ID") + REFERENCES "CATEGORIA" ("CATEGORIA_ID") ENABLE, + CONSTRAINT "ITEMVENDA_CORRIDA_FK" FOREIGN KEY ("CORRIDA_ID", "FECCORRIDA") + REFERENCES "CORRIDA" ("CORRIDA_ID", "FECCORRIDA") ENABLE, + CONSTRAINT "ITEMVENDA_VENDA_FK" FOREIGN KEY ("DIGITAVENTA_ID") + REFERENCES "DIGITA_VENTA" ("DIGITAVENTA_ID") ENABLE, + CONSTRAINT "DIGITA_ITEM_TIPO_VENTA_FK" FOREIGN KEY ("TIPOVENTA_ID") + REFERENCES "TIPO_VENTA" ("TIPOVENTA_ID") ENABLE, + CONSTRAINT "ITEMVENDA_FORMAPAGAMENTO_FK" FOREIGN KEY ("FORMAPAGO_ID") + REFERENCES "FORMA_PAGO" ("FORMAPAGO_ID") ENABLE + )'; +exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20170323_1108__mantis8450.sql b/src/db/migration/migration/V20170323_1108__mantis8450.sql new file mode 100644 index 000000000..5041dae5a --- /dev/null +++ b/src/db/migration/migration/V20170323_1108__mantis8450.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ADM > RELATORIOS >> KM PROGRAMADA'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOKMPROGRAMADA'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170323_1449__menuinterativositef.sql b/src/db/migration/migration/V20170323_1449__menuinterativositef.sql new file mode 100644 index 000000000..8b0fcf833 --- /dev/null +++ b/src/db/migration/migration/V20170323_1449__menuinterativositef.sql @@ -0,0 +1,10 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA> SITEF>> MENU SITEF'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUSITEF'', 1, + current_timestamp)'; + exception when others then null; +end; + + diff --git a/src/db/migration/migration/V20170324_1020__mantis8755.sql b/src/db/migration/migration/V20170324_1020__mantis8755.sql new file mode 100644 index 000000000..269e819cf --- /dev/null +++ b/src/db/migration/migration/V20170324_1020__mantis8755.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE VENDA_PACOTE ADD INDENCARGOVENTA NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170327_1550__mantis8755.sql b/src/db/migration/migration/V20170327_1550__mantis8755.sql new file mode 100644 index 000000000..63367aa1f --- /dev/null +++ b/src/db/migration/migration/V20170327_1550__mantis8755.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD INDENCARGOVENTA NUMBER(1,0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170328_0830__mantis8808.sql b/src/db/migration/migration/V20170328_0830__mantis8808.sql new file mode 100644 index 000000000..9a3d2894a --- /dev/null +++ b/src/db/migration/migration/V20170328_0830__mantis8808.sql @@ -0,0 +1,17 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTADO_CIVIL MODIFY (ESTADOCIVIL_ID NOT NULL)'; + exception when others then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTADO_CIVIL ADD CONSTRAINT ESTADO_CIVIL_PK PRIMARY KEY (ESTADOCIVIL_ID) ENABLE'; + exception when others then null; +end; + + diff --git a/src/db/migration/migration/V20170328_0944__mantis8808.sql b/src/db/migration/migration/V20170328_0944__mantis8808.sql new file mode 100644 index 000000000..949a61f3b --- /dev/null +++ b/src/db/migration/migration/V20170328_0944__mantis8808.sql @@ -0,0 +1,45 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (ESTADOCIVIL_ID NUMBER(2))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE BOLETO ADD CONSTRAINT BOLETO_ESTADOCIVIL_FK FOREIGN KEY (ESTADOCIVIL_ID) + REFERENCES ESTADO_CIVIL (ESTADOCIVIL_ID) ENABLE'; + + exception + when object_exists then null; + when except_02275 then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (ESTADOCIVIL_ID NUMBER(2))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CAJA ADD CONSTRAINT CAJA_ESTADOCIVIL_FK FOREIGN KEY (ESTADOCIVIL_ID) + REFERENCES ESTADO_CIVIL (ESTADOCIVIL_ID) ENABLE'; + + exception + when object_exists then null; + when except_02275 then null; +end; diff --git a/src/db/migration/migration/V20170329_0937__mantis8828.sql b/src/db/migration/migration/V20170329_0937__mantis8828.sql new file mode 100644 index 000000000..245931595 --- /dev/null +++ b/src/db/migration/migration/V20170329_0937__mantis8828.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CORRIDA_TRAMO MODIFY (DESCAUTOBUS VARCHAR2(10 BYTE) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170331_1042__mantis8660.sql b/src/db/migration/migration/V20170331_1042__mantis8660.sql new file mode 100644 index 000000000..98c793f15 --- /dev/null +++ b/src/db/migration/migration/V20170331_1042__mantis8660.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_seq.nextval,1,''CANCELAMENTO GRATUIDADE 100 PORCENTO'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.PERMITECANCELAMENTOGRATUIDADETOTAL'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170331_1713__mantis8659Create.sql b/src/db/migration/migration/V20170331_1713__mantis8659Create.sql new file mode 100644 index 000000000..24e3eecb4 --- /dev/null +++ b/src/db/migration/migration/V20170331_1713__mantis8659Create.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CONEXION_DESCUENTO + ( + CONEXIONDESCUENTO_ID NUMBER(15) PRIMARY KEY NOT NULL, + ACTIVO NUMBER(1), + CONEXION_ID NUMBER(15), + CLASSESERVICIO_ID NUMBER(15), + SECUENCIA NUMBER(2), + GRUPO NUMBER(3), + DESCUENTO NUMBER(7, 2), + FECMODIF DATE, + FOREIGN KEY (CONEXION_ID) REFERENCES CONEXION (CONEXION_ID), + FOREIGN KEY (CLASSESERVICIO_ID) REFERENCES CLASE_SERVICIO (CLASESERVICIO_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE CONEXION_DESCUENTO_SEQ START WITH 1'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170331_1716__mantis8659Insert.sql b/src/db/migration/migration/V20170331_1716__mantis8659Insert.sql new file mode 100644 index 000000000..72080940b --- /dev/null +++ b/src/db/migration/migration/V20170331_1716__mantis8659Insert.sql @@ -0,0 +1,83 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate + 'INSERT INTO CONEXION_DESCUENTO (CONEXIONDESCUENTO_ID, ACTIVO, CONEXION_ID, CLASSESERVICIO_ID, SECUENCIA, GRUPO, DESCUENTO, FECMODIF) + SELECT + CONEXION_DESCUENTO_SEQ.nextval, + cf.ACTIVO, + c.CONEXION_ID, + -1, + 1, + GRUPO, + PORSEC1, + cf.FECMODIF + FROM CONEXION_CONF cf INNER JOIN CONEXION c + ON c.NUMGRUPO = cf.GRUPO AND c.NUMSECUENCIA = 1 AND c.CONEXIONCTRL_ID = cf.CONEXIONCTRL_ID + WHERE PORSEC1 IS NOT NULL AND PORSEC1 >0 AND c.ACTIVO = 1'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate + 'INSERT INTO CONEXION_DESCUENTO (CONEXIONDESCUENTO_ID, ACTIVO, CONEXION_ID, CLASSESERVICIO_ID, SECUENCIA, GRUPO, DESCUENTO, FECMODIF) +SELECT + CONEXION_DESCUENTO_SEQ.nextval, + cf.ACTIVO, + c.CONEXION_ID, + -1, + 2, + GRUPO, + PORSEC2, + cf.FECMODIF +FROM CONEXION_CONF cf INNER JOIN CONEXION c + ON c.NUMGRUPO = cf.GRUPO AND c.NUMSECUENCIA = 2 AND c.CONEXIONCTRL_ID = cf.CONEXIONCTRL_ID +WHERE PORSEC2 IS NOT NULL AND PORSEC2 > 0 AND c.ACTIVO = 1'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate + 'INSERT INTO CONEXION_DESCUENTO (CONEXIONDESCUENTO_ID, ACTIVO, CONEXION_ID, CLASSESERVICIO_ID, SECUENCIA, GRUPO, DESCUENTO, FECMODIF) +SELECT + CONEXION_DESCUENTO_SEQ.nextval, + cf.ACTIVO, + c.CONEXION_ID, + -1, + 3, + GRUPO, + PORSEC3, + cf.FECMODIF +FROM CONEXION_CONF cf INNER JOIN CONEXION c + ON c.NUMGRUPO = cf.GRUPO AND c.NUMSECUENCIA = 3 AND c.CONEXIONCTRL_ID = cf.CONEXIONCTRL_ID +WHERE PORSEC3 IS NOT NULL AND PORSEC3 > 0 AND c.ACTIVO = 1'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate + 'INSERT INTO CONEXION_DESCUENTO (CONEXIONDESCUENTO_ID, ACTIVO, CONEXION_ID, CLASSESERVICIO_ID, SECUENCIA, GRUPO, DESCUENTO, FECMODIF) +SELECT + CONEXION_DESCUENTO_SEQ.nextval, + cf.ACTIVO, + c.CONEXION_ID, + -1, + 4, + GRUPO, + PORSEC4, + cf.FECMODIF +FROM CONEXION_CONF cf INNER JOIN CONEXION c + ON c.NUMGRUPO = cf.GRUPO AND c.NUMSECUENCIA = 4 AND c.CONEXIONCTRL_ID = cf.CONEXIONCTRL_ID +WHERE PORSEC4 IS NOT NULL AND PORSEC4 > 0 AND c.ACTIVO = 1'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20170404_1633__mantis7933.sql b/src/db/migration/migration/V20170404_1633__mantis7933.sql new file mode 100644 index 000000000..c7f0ede73 --- /dev/null +++ b/src/db/migration/migration/V20170404_1633__mantis7933.sql @@ -0,0 +1,39 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA ADD (INDRUTAINTERNACIONAL NUMBER(1,0) DEFAULT 0 NOT NULL ENABLE)'; + exception when column_exists then null; +end; +/ + +-- Placeholder +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONDUCTOR ADD (NACIONALIDAD VARCHAR2(30 BYTE))'; + exception when column_exists then null; +end; +/ + +-- Placeholder +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (NACIONALIDAD VARCHAR2(30 BYTE))'; + execute immediate 'ALTER TABLE BOLETO ADD (SEXO VARCHAR2(1 BYTE))'; + exception when column_exists then null; +end; +/ + +-- Placeholder +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (NACIONALIDAD VARCHAR2(30 BYTE))'; + execute immediate 'ALTER TABLE CAJA ADD (SEXO VARCHAR2(1 BYTE))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170407_1100__mantis8757.sql b/src/db/migration/migration/V20170407_1100__mantis8757.sql new file mode 100644 index 000000000..d7949e535 --- /dev/null +++ b/src/db/migration/migration/V20170407_1100__mantis8757.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate + 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.nextval,''URL_WS_LIMITE_CREDITO_CLI_SERRA_VERDE'',''Url WSLD verifica��o de limite de cr�dito Serra Verde.'',''1'',''http://a2xsistemas.ddns.net:81/servicessisare.dll/wsdl/IServicesSisare'',''1'',''1'',to_date(''07/04/17'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170411_1133__mantis8882.sql b/src/db/migration/migration/V20170411_1133__mantis8882.sql new file mode 100644 index 000000000..48820c734 --- /dev/null +++ b/src/db/migration/migration/V20170411_1133__mantis8882.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD CAJA_ID NUMBER(15,0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170411_1134__mantis8882.sql b/src/db/migration/migration/V20170411_1134__mantis8882.sql new file mode 100644 index 000000000..5eb3775d9 --- /dev/null +++ b/src/db/migration/migration/V20170411_1134__mantis8882.sql @@ -0,0 +1,17 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); +begin + execute immediate 'ALTER TABLE LOG_CONFERENCIA + ADD CONSTRAINT FK_LOGCONFERENCIA_CAJA FOREIGN KEY (CAJA_ID) + REFERENCES CAJA (CAJA_ID)'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; +end; diff --git a/src/db/migration/migration/V20170417_1553__mantis8746.sql b/src/db/migration/migration/V20170417_1553__mantis8746.sql new file mode 100644 index 000000000..b1b649f69 --- /dev/null +++ b/src/db/migration/migration/V20170417_1553__mantis8746.sql @@ -0,0 +1,9 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (funcion_sistema_seq.nextval,1,''CONTA CORRENTE AGENCIA > FECHAMENTO CONTA CORRENTE'',''COM.RJCONSULTORES.VENTABOLETOS.CONTACORRENTEAGENCIA.FECHAMENTOCONTACORRENTE'',1,SYSDATE,1)'; + exception when others then null; +end; + + + diff --git a/src/db/migration/migration/V20170417_1850__mantis8880.sql b/src/db/migration/migration/V20170417_1850__mantis8880.sql new file mode 100644 index 000000000..5ee84755a --- /dev/null +++ b/src/db/migration/migration/V20170417_1850__mantis8880.sql @@ -0,0 +1,17 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CORTE_TURNO ADD (NUMFECASESOR NUMBER(10))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE USUARIO ADD (NUMFECHAMENTO NUMBER(10))'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20170420_1727__motivonaointegrado.sql b/src/db/migration/migration/V20170420_1727__motivonaointegrado.sql new file mode 100644 index 000000000..e373da260 --- /dev/null +++ b/src/db/migration/migration/V20170420_1727__motivonaointegrado.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table AG_ADIANTAMENTO_CLIENTE modify motivonaointegrado varchar2(4000)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170424_1733__mantis8879.sql b/src/db/migration/migration/V20170424_1733__mantis8879.sql new file mode 100644 index 000000000..c1a63dc89 --- /dev/null +++ b/src/db/migration/migration/V20170424_1733__mantis8879.sql @@ -0,0 +1,24 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO_CHECKIN ADD INDANTECIPADO NUMBER(1,0)'; + exception when column_exists then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE BOLETO_CHECKIN SET INDANTECIPADO = 0'; + exception when ja_existe then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''PERMITE CHECKIN ANTECIPADO'', +''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUCHECKIN.CHECKINANTECIPADO'', +''1'',to_date(''24/04/17'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170424_1738__mantis8921.sql b/src/db/migration/migration/V20170424_1738__mantis8921.sql new file mode 100644 index 000000000..0eeba83d8 --- /dev/null +++ b/src/db/migration/migration/V20170424_1738__mantis8921.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS_PAGO ADD OCD_ID NUMBER(15,0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170424_1739__mantis8921.sql b/src/db/migration/migration/V20170424_1739__mantis8921.sql new file mode 100644 index 000000000..353dbe973 --- /dev/null +++ b/src/db/migration/migration/V20170424_1739__mantis8921.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS_PAGO + ADD CONSTRAINT FK_CAJA_DIVERSOS_PAGO_OCD FOREIGN KEY (OCD_ID) + REFERENCES OCD (OCD_ID)'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; +end; diff --git a/src/db/migration/migration/V20170424_1740__mantis8921.sql b/src/db/migration/migration/V20170424_1740__mantis8921.sql new file mode 100644 index 000000000..d28b0e7d1 --- /dev/null +++ b/src/db/migration/migration/V20170424_1740__mantis8921.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS_PAGO ADD NOTACREDITOVENDAPACOTE_ID NUMBER(7,0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170424_1741__mantis8921.sql b/src/db/migration/migration/V20170424_1741__mantis8921.sql new file mode 100644 index 000000000..accdadf46 --- /dev/null +++ b/src/db/migration/migration/V20170424_1741__mantis8921.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS_PAGO + ADD CONSTRAINT FK_CAJA_DIVERSOS_PAGO_NC FOREIGN KEY (NOTACREDITOVENDAPACOTE_ID) + REFERENCES NOTA_CREDITO_VENDA_PACOTE (NOTACREDITOVENDAPACOTE_ID)'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; +end; diff --git a/src/db/migration/migration/V20170426_0935__mantis8921.sql b/src/db/migration/migration/V20170426_0935__mantis8921.sql new file mode 100644 index 000000000..7b871b689 --- /dev/null +++ b/src/db/migration/migration/V20170426_0935__mantis8921.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PACOTE_FORMAPAGO ADD NOTACREDITOVENDAPACOTE_ID NUMBER(7,0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170426_0936__mantis8921.sql b/src/db/migration/migration/V20170426_0936__mantis8921.sql new file mode 100644 index 000000000..23a55fcab --- /dev/null +++ b/src/db/migration/migration/V20170426_0936__mantis8921.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); +begin + execute immediate 'ALTER TABLE PACOTE_FORMAPAGO + ADD CONSTRAINT FK_PACOTE_FORMAPAGO_NC FOREIGN KEY (NOTACREDITOVENDAPACOTE_ID) + REFERENCES NOTA_CREDITO_VENDA_PACOTE (NOTACREDITOVENDAPACOTE_ID)'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; +end; diff --git a/src/db/migration/migration/V20170426_0937__mantis8921.sql b/src/db/migration/migration/V20170426_0937__mantis8921.sql new file mode 100644 index 000000000..30e7c6bba --- /dev/null +++ b/src/db/migration/migration/V20170426_0937__mantis8921.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PACOTE_FORMAPAGO ADD OCD_ID NUMBER(7,0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170426_0938__mantis8921.sql b/src/db/migration/migration/V20170426_0938__mantis8921.sql new file mode 100644 index 000000000..64ff6cc0c --- /dev/null +++ b/src/db/migration/migration/V20170426_0938__mantis8921.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); +begin + execute immediate 'ALTER TABLE PACOTE_FORMAPAGO + ADD CONSTRAINT FK_PACOTE_FORMAPAGO_OCD FOREIGN KEY (OCD_ID) + REFERENCES OCD (OCD_ID)'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; +end; diff --git a/src/db/migration/migration/V20170426_1054__mantis8735.sql b/src/db/migration/migration/V20170426_1054__mantis8735.sql new file mode 100644 index 000000000..d37a86ff2 --- /dev/null +++ b/src/db/migration/migration/V20170426_1054__mantis8735.sql @@ -0,0 +1,8 @@ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDIMPRIMEGRATUIDADE NUMBER(1,0))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170426_1644__mantis8946.sql b/src/db/migration/migration/V20170426_1644__mantis8946.sql new file mode 100644 index 000000000..11de656c0 --- /dev/null +++ b/src/db/migration/migration/V20170426_1644__mantis8946.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE DESCONTO_COMISSAO RENAME COLUMN PRECO TO PRECO_OLD'; + + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170426_1645__mantis8946.sql b/src/db/migration/migration/V20170426_1645__mantis8946.sql new file mode 100644 index 000000000..1b2fdbdbb --- /dev/null +++ b/src/db/migration/migration/V20170426_1645__mantis8946.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE DESCONTO_COMISSAO ADD PRECO NUMBER(7,2)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170426_1646__mantis8946.sql b/src/db/migration/migration/V20170426_1646__mantis8946.sql new file mode 100644 index 000000000..0d31e8568 --- /dev/null +++ b/src/db/migration/migration/V20170426_1646__mantis8946.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE DESCONTO_COMISSAO SET PRECO = PRECO_OLD'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170426_1726__mantis8750.sql b/src/db/migration/migration/V20170426_1726__mantis8750.sql new file mode 100644 index 000000000..7011e2dd5 --- /dev/null +++ b/src/db/migration/migration/V20170426_1726__mantis8750.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ADM > RELATORIOS >> VENDAS PERCURSO'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASPERCURSO'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170426_1740__mantis8946.sql b/src/db/migration/migration/V20170426_1740__mantis8946.sql new file mode 100644 index 000000000..23d913242 --- /dev/null +++ b/src/db/migration/migration/V20170426_1740__mantis8946.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TIPO_EVENTO_EXTRA ADD CVETIPOEVENTO VARCHAR2(30)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170426_1758__mantis8946.sql b/src/db/migration/migration/V20170426_1758__mantis8946.sql new file mode 100644 index 000000000..25465d864 --- /dev/null +++ b/src/db/migration/migration/V20170426_1758__mantis8946.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE TIPO_EVENTO_EXTRA + SET CVETIPOEVENTO = ''SEGURO_OPCIONAL'' + WHERE TIPOEVENTOEXTRA_ID IN ( + SELECT VALORCONSTANTE + FROM CONSTANTE + WHERE NOMBCONSTANTE = ''TIPO_EE_SEGURO_OPCIONAL'' + )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170427_1142__mantis8946.sql b/src/db/migration/migration/V20170427_1142__mantis8946.sql new file mode 100644 index 000000000..74275c941 --- /dev/null +++ b/src/db/migration/migration/V20170427_1142__mantis8946.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD (RECEITA_BPR NUMBER(7,2), DEVOLVIDOS NUMBER(7,2))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170427_1649__mantis8946.sql b/src/db/migration/migration/V20170427_1649__mantis8946.sql new file mode 100644 index 000000000..08eca9823 --- /dev/null +++ b/src/db/migration/migration/V20170427_1649__mantis8946.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD (RECEITA_BRUTA_EXCESSOBAGAGEM NUMBER(7,2), RECEITA_BRUTA_SEGUROOPCIONAL NUMBER(7,2))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170428_1008__mantis8884.sql b/src/db/migration/migration/V20170428_1008__mantis8884.sql new file mode 100644 index 000000000..94c604427 --- /dev/null +++ b/src/db/migration/migration/V20170428_1008__mantis8884.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_01451 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); +begin + execute immediate 'ALTER TABLE FISCAL_T2 MODIFY (FISCALIMPRESSORA_ID NULL)'; + + exception + when object_exists then null; + when except_01451 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170428_1100__mantis8900.sql b/src/db/migration/migration/V20170428_1100__mantis8900.sql new file mode 100644 index 000000000..69a647642 --- /dev/null +++ b/src/db/migration/migration/V20170428_1100__mantis8900.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD (DATAMOVIMENTO DATE)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170428_1141__mantis8923.sql b/src/db/migration/migration/V20170428_1141__mantis8923.sql new file mode 100644 index 000000000..db9da1f1b --- /dev/null +++ b/src/db/migration/migration/V20170428_1141__mantis8923.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE VENDA_PACOTE ADD CLIENTE_ID NUMBER(7,0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170428_1430__mantis8900.sql b/src/db/migration/migration/V20170428_1430__mantis8900.sql new file mode 100644 index 000000000..ae164d992 --- /dev/null +++ b/src/db/migration/migration/V20170428_1430__mantis8900.sql @@ -0,0 +1,31 @@ +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE COMISSAO RENAME COLUMN RECEITA_OUTROS TO RECEITA_OUTROS_OLD'; + + exception + when object_exists then null; + when except_00957 then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD RECEITA_OUTROS NUMBER(7,2)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE COMISSAO SET RECEITA_OUTROS = RECEITA_OUTROS_OLD'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170503_0908__mantis8748.sql b/src/db/migration/migration/V20170503_0908__mantis8748.sql new file mode 100644 index 000000000..06e8ec5f1 --- /dev/null +++ b/src/db/migration/migration/V20170503_0908__mantis8748.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ADM > RELATORIOS >> BAIXAS VENDAS INTERNET'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOBAIXASVENDASINTERNET'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170504_1019__mantis8927.sql b/src/db/migration/migration/V20170504_1019__mantis8927.sql new file mode 100644 index 000000000..198a0768e --- /dev/null +++ b/src/db/migration/migration/V20170504_1019__mantis8927.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE OCD_PARAM ADD INDSEMPREGERARAPAGAR NUMBER(1,0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170504_1725__mantis8827.sql b/src/db/migration/migration/V20170504_1725__mantis8827.sql new file mode 100644 index 000000000..f1b31681d --- /dev/null +++ b/src/db/migration/migration/V20170504_1725__mantis8827.sql @@ -0,0 +1,43 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'ALTER TABLE BOLETO ADD (PONTUACAOFRAUDE NUMBER(3))'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'ALTER TABLE CAJA ADD (PONTUACAOFRAUDE NUMBER(3))'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (PONTUACAOFRAUDEINI NUMBER(3))'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (PONTUACAOFRAUDEFIM NUMBER(3))'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDFIDELIDADE NUMBER(1) DEFAULT 0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170505_1840__mantis8973.sql b/src/db/migration/migration/V20170505_1840__mantis8973.sql new file mode 100644 index 000000000..85d636112 --- /dev/null +++ b/src/db/migration/migration/V20170505_1840__mantis8973.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FOLIO_PREIMPRESO ADD (AIDF_ID NUMBER(15))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170508_1427__mantis9003.sql b/src/db/migration/migration/V20170508_1427__mantis9003.sql new file mode 100644 index 000000000..c0f2e7de9 --- /dev/null +++ b/src/db/migration/migration/V20170508_1427__mantis9003.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA MODIFY (PREFIXO VARCHAR2(16))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170509_1546__mantis8979.sql b/src/db/migration/migration/V20170509_1546__mantis8979.sql new file mode 100644 index 000000000..0abd9dc53 --- /dev/null +++ b/src/db/migration/migration/V20170509_1546__mantis8979.sql @@ -0,0 +1,26 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE HIST_PUNTOVENTA( + "HIST_PUNTOVENTA_ID" NUMBER(15,0) NOT NULL ENABLE, + "IND_BLOQUEIO" NUMBER (1,0), + "FEC_BLOQUEIO" DATE, + "PUNTOVENTA_ID" NUMBER(15,0), + "ACTIVO" NUMBER(1,0), + "FECMODIF" DATE, + "USUARIO_ID" NUMBER(7,0), + CONSTRAINT "PK_HIST_PUNTOVENDA" PRIMARY KEY ("HIST_PUNTOVENTA_ID"), + CONSTRAINT "FK_HIST_PUNTOVENDA_PUNTOVENDA" FOREIGN KEY("PUNTOVENTA_ID") REFERENCES PUNTO_VENTA("PUNTOVENTA_ID") + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE HIST_PUNTOVENTA_SEQ START WITH 1'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170510_1120__mantis8900.sql b/src/db/migration/migration/V20170510_1120__mantis8900.sql new file mode 100644 index 000000000..2c20e4028 --- /dev/null +++ b/src/db/migration/migration/V20170510_1120__mantis8900.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_COMISSAO ADD (INDRETERCOMISSAO NUMBER(1))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170511_1025__mantis9003.sql b/src/db/migration/migration/V20170511_1025__mantis9003.sql new file mode 100644 index 000000000..4dd6c08e6 --- /dev/null +++ b/src/db/migration/migration/V20170511_1025__mantis9003.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA MODIFY (PREFIXO VARCHAR2(20))'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA MODIFY (PREFIXOAUXILIAR VARCHAR2(20))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170511_1200__mantis8996.sql b/src/db/migration/migration/V20170511_1200__mantis8996.sql new file mode 100644 index 000000000..fa3d9983a --- /dev/null +++ b/src/db/migration/migration/V20170511_1200__mantis8996.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (FECVENTADIGITA DATE)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (FECVENTADIGITA DATE)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE DIGITA_ITEM ADD (FECVENTADIGITA DATE)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170512_1537__mantis9014.sql b/src/db/migration/migration/V20170512_1537__mantis9014.sql new file mode 100644 index 000000000..22b2ed907 --- /dev/null +++ b/src/db/migration/migration/V20170512_1537__mantis9014.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ENTREGAR BOLETO FORA DO INTERVALO'', + ''COM.RJCONSULTORES.VENTABOLETOS.ENTREGARBOLETOALEMINTERVALO'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170512_1718__mantis8978.sql b/src/db/migration/migration/V20170512_1718__mantis8978.sql new file mode 100644 index 000000000..7980c9b41 --- /dev/null +++ b/src/db/migration/migration/V20170512_1718__mantis8978.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FOLIO_PREIMPRESO ADD (ESTACIONIMPRESORA_ID NUMBER(7,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170513_0946__mantis9033.sql b/src/db/migration/migration/V20170513_0946__mantis9033.sql new file mode 100644 index 000000000..292bf578f --- /dev/null +++ b/src/db/migration/migration/V20170513_0946__mantis9033.sql @@ -0,0 +1,24 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE PARADA_COD_ORGAOCONCEDENTE ( + PARADACODORGAOCONCEDENTE_ID NUMBER(7), + PARADA_ID NUMBER(7), + ORGAOCONCEDENTE_ID NUMBER(7), + CODIGO VARCHAR2(5), + CONSTRAINT FK_PARADACODORGCONC_PARADA FOREIGN KEY (PARADA_ID) REFERENCES PARADA (PARADA_ID), + CONSTRAINT FK_PARADACODORGCONC_ORGAO FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID) +)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE PARADA_CODORGAOCONCEDENTE_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; + + diff --git a/src/db/migration/migration/V20170514_1755__mantis9032.sql b/src/db/migration/migration/V20170514_1755__mantis9032.sql new file mode 100644 index 000000000..aeba1932c --- /dev/null +++ b/src/db/migration/migration/V20170514_1755__mantis9032.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA_SECUENCIA ADD (CANTKMENTRADASAIDA NUMBER(7,2))'; + exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20170516_1442__mantis9037.sql b/src/db/migration/migration/V20170516_1442__mantis9037.sql new file mode 100644 index 000000000..1fb5f3eb0 --- /dev/null +++ b/src/db/migration/migration/V20170516_1442__mantis9037.sql @@ -0,0 +1,17 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE PRECIO_FIXO_PEDAGIO (PRECIOFIXO_ID NUMBER(15) NOT NULL, PRACA_PEDAGIO_ID NUMBER(15) NOT NULL, ORGAO_CONCEDENTE_ID NUMBER(15), CLASSE_SERVICO_ID NUMBER(15), VALOR_FIXO NUMBER(7,2) NOT NULL)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE PRECIO_FIXO_PEDAGIO_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; + \ No newline at end of file diff --git a/src/db/migration/migration/V20170517_1435__mantis8900.sql b/src/db/migration/migration/V20170517_1435__mantis8900.sql new file mode 100644 index 000000000..ce3faa4b7 --- /dev/null +++ b/src/db/migration/migration/V20170517_1435__mantis8900.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_OPERACION_CC (TIPOOPERACIONCC_ID, DESCTIPO, CVETIPO, INDCREDITO, ACTIVO, FECMODIF, USUARIO_ID) VALUES (5, ''COMISSAO'', ''CM'', 1, 1, SYSDATE, 99)'; + + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170519_1130__mantis9052.sql b/src/db/migration/migration/V20170519_1130__mantis9052.sql new file mode 100644 index 000000000..cc758cf26 --- /dev/null +++ b/src/db/migration/migration/V20170519_1130__mantis9052.sql @@ -0,0 +1,96 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate ' + CREATE TABLE ESQUEMA_CORRIDA_EMBRQ_DESEMBRQ ( + ESQUEMACORRIDAEMBRQDESEMBRQ_ID NUMBER(7,0) NOT NULL, + ESQUEMACORRIDA_ID NUMBER(7,0) NOT NULL, + PARADA_ID NUMBER(7,0) NOT NULL, + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_ESQ_CORR_EMBRQ_DESEMBRQ PRIMARY KEY(ESQUEMACORRIDAEMBRQDESEMBRQ_ID), + CONSTRAINT FK_ESQ_CORR_EMBRQ_DESEMBRQ_COR FOREIGN KEY (ESQUEMACORRIDA_ID) REFERENCES ESQUEMA_CORRIDA(ESQUEMACORRIDA_ID), + CONSTRAINT FK_ESQ_CORR_EMBRQ_DESEMBRQ_PAR FOREIGN KEY (PARADA_ID) REFERENCES PARADA(PARADA_ID), + CONSTRAINT FK_ESQ_CORR_EMBRQ_DESEMBRQ_USU FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO(USUARIO_ID) + ) +'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate ' + CREATE TABLE RUTA_EMBRQ_DESEMBRQ ( + RUTAEMBRQDESEMBRQ_ID NUMBER(7,0) NOT NULL, + RUTA_ID NUMBER(7,0) NOT NULL, + PARADA_ID NUMBER(7,0) NOT NULL, + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_RUTA_EMBRQ_DESEMBRQ PRIMARY KEY(RUTAEMBRQDESEMBRQ_ID), + CONSTRAINT FK_RUTA_EMBRQ_DESEMBRQ_RUTA FOREIGN KEY (RUTA_ID) REFERENCES RUTA(RUTA_ID), + CONSTRAINT FK_RUTA_EMBRQ_DESEMBRQ_PARADA FOREIGN KEY (PARADA_ID) REFERENCES PARADA(PARADA_ID), + CONSTRAINT FK_RUTA_EMBRQ_DESEMBRQ_USUARIO FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO(USUARIO_ID) + ) +'; + exception when object_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD EMBARQUE_ID NUMBER(7,0) CONSTRAINT FK_BOLETO_EMBARQUE REFERENCES PARADA(PARADA_ID)'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD DESEMBARQUE_ID NUMBER(7,0) CONSTRAINT FK_BOLETO_DESEMBARQUE REFERENCES PARADA(PARADA_ID)'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD EMBARQUE_ID NUMBER(7,0) CONSTRAINT FK_CAJA_EMBARQUE REFERENCES PARADA(PARADA_ID)'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD DESEMBARQUE_ID NUMBER(7,0) CONSTRAINT FK_CAJA_DESEMBARQUE REFERENCES PARADA(PARADA_ID)'; + exception when column_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "RUTA_EMBRQ_DESEMBRQ_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "ESQUEMA_CORRIDA_EMB_DESEM_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170520_1227__mantis9077.sql b/src/db/migration/migration/V20170520_1227__mantis9077.sql new file mode 100644 index 000000000..851dadb35 --- /dev/null +++ b/src/db/migration/migration/V20170520_1227__mantis9077.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PRICING_ESPECIFICO_OCUPACION ADD (DESCUENTO NUMBER(5,2))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170523_1110__mantis8900.sql b/src/db/migration/migration/V20170523_1110__mantis8900.sql new file mode 100644 index 000000000..17e0bac7a --- /dev/null +++ b/src/db/migration/migration/V20170523_1110__mantis8900.sql @@ -0,0 +1,40 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE PTOVTA_EMPRESA_CONTABANCARIA ( + PTOVTAEMPRESACONTABANCARIA_ID NUMBER(7) NOT NULL, + PTOVTAEMPRESA_ID NUMBER(7) NOT NULL, + EMPRESACONTABANCARIA_ID NUMBER(7) NOT NULL, + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + CONSTRAINT PTOVTAEMPCONBAN_PK PRIMARY KEY (PTOVTAEMPRESACONTABANCARIA_ID) ENABLE)'; + + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE PTOVTAEMPCONBAN_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; +/ + +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate + 'insert into PTOVTA_EMPRESA_CONTABANCARIA (PTOVTAEMPRESACONTABANCARIA_ID, PTOVTAEMPRESA_ID, EMPRESACONTABANCARIA_ID, ACTIVO, FECMODIF, USUARIO_ID) + select PTOVTAEMPCONBAN_SEQ.nextval, PTOVTAEMPRESA_ID, EMPRESACONTABANCARIA_ID, ACTIVO, FECMODIF, USUARIO_ID from ( + select PTOVTAEMPRESA_ID, EMPRESACONTABANCARIA_ID, ACTIVO, FECMODIF, USUARIO_ID from PTOVTA_EMPRESA where EMPRESACONTABANCARIA_ID is not null)'; + + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20170523_1500__mantis8900.sql b/src/db/migration/migration/V20170523_1500__mantis8900.sql new file mode 100644 index 000000000..a3caa7d17 --- /dev/null +++ b/src/db/migration/migration/V20170523_1500__mantis8900.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -02275); +begin + execute immediate 'ALTER TABLE PTOVTA_EMPRESA_CONTABANCARIA ADD FOREIGN KEY (EMPRESACONTABANCARIA_ID) REFERENCES EMPRESA_CONTABANCARIA (EMPRESACONTABANCARIA_ID)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -02260); +begin + execute immediate 'ALTER TABLE PTOVTA_EMPRESA ADD CONSTRAINT PTOVTA_EMPRESA_PK PRIMARY KEY (PTOVTAEMPRESA_ID)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -02275); +begin + execute immediate 'ALTER TABLE PTOVTA_EMPRESA_CONTABANCARIA ADD FOREIGN KEY (PTOVTAEMPRESA_ID) REFERENCES PTOVTA_EMPRESA (PTOVTAEMPRESA_ID)'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170524_1105__mantis9088.sql b/src/db/migration/migration/V20170524_1105__mantis9088.sql new file mode 100644 index 000000000..bcb35e4fc --- /dev/null +++ b/src/db/migration/migration/V20170524_1105__mantis9088.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CATEGORIA_BLOQ_IMPPOSTERIOR ( + CATBLOQUEIOIMPPOSTERIOR_ID NUMBER(7) NOT NULL, + PUNTOVENTA_ID NUMBER(7) NOT NULL, + CATEGORIA_ID NUMBER(7) NOT NULL, + PRIMARY KEY (CATBLOQUEIOIMPPOSTERIOR_ID), + CONSTRAINT FK_CATBLOQIMPPOSTERIOR_PTOVTA FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID), + CONSTRAINT FK_CATBLOQIMPPOSTERIOR_CATEG FOREIGN KEY (CATEGORIA_ID) REFERENCES CATEGORIA (CATEGORIA_ID) )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE CAT_BLOQ_IMPPOSTERIOR_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; + + diff --git a/src/db/migration/migration/V20170524_1500__mantis9087.sql b/src/db/migration/migration/V20170524_1500__mantis9087.sql new file mode 100644 index 000000000..9c023a121 --- /dev/null +++ b/src/db/migration/migration/V20170524_1500__mantis9087.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PRICING_ESPECIFICO ADD (EXIBEVENDA NUMBER(1,0))'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PRICING ADD (EXIBEVENDA NUMBER(1,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170525_1528__mantis9028.sql b/src/db/migration/migration/V20170525_1528__mantis9028.sql new file mode 100644 index 000000000..a2e23611a --- /dev/null +++ b/src/db/migration/migration/V20170525_1528__mantis9028.sql @@ -0,0 +1,24 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARJETA_CREDITO ADD (EMPRESA_ID NUMBER(7))'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); +begin + execute immediate 'ALTER TABLE TARJETA_CREDITO ADD CONSTRAINT TARJETA_CREDITO_FK_EMPRESA FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA (EMPRESA_ID) ENABLE'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; +end; diff --git a/src/db/migration/migration/V20170525_1803__mantis9037.sql b/src/db/migration/migration/V20170525_1803__mantis9037.sql new file mode 100644 index 000000000..94bde8c8e --- /dev/null +++ b/src/db/migration/migration/V20170525_1803__mantis9037.sql @@ -0,0 +1,102 @@ +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE PRECIO_FIXO_PEDAGIO RENAME COLUMN PRECIOFIXO_ID TO PRECIOFIXOPEDAGIO_ID'; + + exception + when object_exists then null; + when except_00957 then null; +end; +/ + +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE PRECIO_FIXO_PEDAGIO RENAME COLUMN PRACA_PEDAGIO_ID TO PRACAPEDAGIO_ID'; + + exception + when object_exists then null; + when except_00957 then null; +end; +/ + +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE PRECIO_FIXO_PEDAGIO RENAME COLUMN ORGAO_CONCEDENTE_ID TO ORGAOCONCEDENTE_ID'; + + exception + when object_exists then null; + when except_00957 then null; +end; +/ + +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE PRECIO_FIXO_PEDAGIO RENAME COLUMN CLASSE_SERVICO_ID TO CLASSESERVICO_ID'; + + exception + when object_exists then null; + when except_00957 then null; +end; +/ + +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE PRECIO_FIXO_PEDAGIO RENAME COLUMN VALOR_FIXO TO VALORFIXO'; + + exception + when object_exists then null; + when except_00957 then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); + + begin + execute immediate 'ALTER TABLE PRECIO_FIXO_PEDAGIO ADD (ACTIVO NUMBER(1))'; + exception when object_exists then null; + end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); + + begin + execute immediate 'ALTER TABLE PRECIO_FIXO_PEDAGIO ADD (FECMODIF DATE)'; + exception when object_exists then null; + end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); + + begin + execute immediate 'ALTER TABLE PRECIO_FIXO_PEDAGIO ADD (USUARIO_ID NUMBER(7))'; + exception when object_exists then null; + end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20170526_1715__mantis8977.sql b/src/db/migration/migration/V20170526_1715__mantis8977.sql new file mode 100644 index 000000000..f67c35e63 --- /dev/null +++ b/src/db/migration/migration/V20170526_1715__mantis8977.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (FOLIORMD VARCHAR2(20))'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20170526_1731__mantis9035.sql b/src/db/migration/migration/V20170526_1731__mantis9035.sql new file mode 100644 index 000000000..234bb09d1 --- /dev/null +++ b/src/db/migration/migration/V20170526_1731__mantis9035.sql @@ -0,0 +1,52 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_MINIMA ADD (VIGENCIATARIFA_ID NUMBER(7) )'; + exception when others then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_MINIMA ADD CONSTRAINT TARIFA_MINIMA_FK_VIGENCIA FOREIGN KEY (VIGENCIATARIFA_ID ) REFERENCES VIGENCIA_TARIFA( VIGENCIATARIFA_ID ) ENABLE'; + exception when others then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_MINIMA ADD (RUTA_ID NUMBER(7) )'; + exception when others then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_MINIMA ADD CONSTRAINT TARIFA_MINIMA_FK_RUTA FOREIGN KEY (RUTA_ID ) REFERENCES RUTA (RUTA_ID) ENABLE'; + exception when others then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_MINIMA ADD (REGIONMETROPOLITANA_ID NUMBER(7) )'; + exception when others then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_MINIMA ADD CONSTRAINT TARIFA_MINIMA_FK_REGION FOREIGN KEY (REGIONMETROPOLITANA_ID) REFERENCES REGION_METROPOLITANA (REGIONMETROPOLITANA_ID) ENABLE'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170528_1153__mantis9037.sql b/src/db/migration/migration/V20170528_1153__mantis9037.sql new file mode 100644 index 000000000..342984aaf --- /dev/null +++ b/src/db/migration/migration/V20170528_1153__mantis9037.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE + TABLE PRICING_ESP_PUNTO_VENTA ( + PRICINGESPPUNTOVENTA_ID NUMBER(15) NOT NULL, + PUNTOVENTA_ID NUMBER(15) NOT NULL, + PRICINGESPECIFICO_ID NUMBER(15) NOT NULL , + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + CONSTRAINT PRICINGESPPUNTOVENTA_PK PRIMARY KEY (PRICINGESPPUNTOVENTA_ID) ENABLE)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE PRICING_ESP_PUNTOV_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; + \ No newline at end of file diff --git a/src/db/migration/migration/V20170529_1008__mantis9090.sql b/src/db/migration/migration/V20170529_1008__mantis9090.sql new file mode 100644 index 000000000..911c9c947 --- /dev/null +++ b/src/db/migration/migration/V20170529_1008__mantis9090.sql @@ -0,0 +1,55 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDSEGUNDA NUMBER(1) DEFAULT 1)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDTERCA NUMBER(1) DEFAULT 1)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDQUARTA NUMBER(1) DEFAULT 1)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDQUINTA NUMBER(1) DEFAULT 1)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDSEXTA NUMBER(1) DEFAULT 1)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDSABADO NUMBER(1) DEFAULT 1)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDDOMINGO NUMBER(1) DEFAULT 1)'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170529_1319__mantis9036.sql b/src/db/migration/migration/V20170529_1319__mantis9036.sql new file mode 100644 index 000000000..fc4746063 --- /dev/null +++ b/src/db/migration/migration/V20170529_1319__mantis9036.sql @@ -0,0 +1,176 @@ +declare + except_04043 exception; + + pragma exception_init (except_04043, -04043); +begin + execute immediate 'DROP FUNCTION FN_ARREDONDAMENTO_TARIFA'; + + exception + when except_04043 then null; +end; +/ +create or replace FUNCTION "FN_ARREDONDAMENTO_TARIFA"(pTarifa IN NUMBER, + pOrgaoConcedenteId IN NUMBER, + pImporteSeguro IN NUMBER, + pImporteTaxaEmbarque IN NUMBER, + pImportePedagio IN NUMBER, + pImporteOutros IN NUMBER, + pTxEmbarque IN INTEGER) + RETURN NUMBER AS + + lStrPrecoTotal VARCHAR(15); + lUltimoNumero NUMBER; + lStrPenlultimoNumero VARCHAR(2); + lStrParteInteira VARCHAR(10); + lPrecoTotallArredondado NUMBER; + lPrecoTotal NUMBER; + lDiferencaArredondamento NUMBER; + lCentavos NUMBER; + lDoisUltimos NUMBER; + lTresUltimos NUMBER; + lStrAntePenlultimoNumero NUMBER; + + BEGIN + + IF pTxEmbarque = 1 + THEN + lPrecoTotal := + coalesce(pTarifa, 0) + coalesce(pImporteSeguro, 0) + coalesce(pImporteTaxaEmbarque, 0) + + coalesce(pImportePedagio, 0) + coalesce(pImporteOutros, 0); + ELSE + lPrecoTotal := + coalesce(pTarifa, 0) + coalesce(pImporteSeguro, 0) + coalesce(pImportePedagio, 0) + + coalesce(pImporteOutros, 0); + END IF; + + lPrecoTotallArredondado := lPrecoTotal; + + + lStrPrecoTotal := to_char(lPrecoTotal, '99999.99'); + lUltimoNumero := to_number(substr(lStrPrecoTotal, -1), '9'); + lStrPenlultimoNumero := substr(lStrPrecoTotal, length(lStrPrecoTotal) - 1, 1); + lStrParteInteira := trim(substr(lStrPrecoTotal, 0, length(lStrPrecoTotal) - 3)); + lCentavos := to_number(substr(lStrPrecoTotal, -2, 2), '99'); + + -- SINFRA - MA - tarifas arredondadas a cada R$ 0,50 - com a seguinte regra, de 0,01 a 0,24 e de 0,51 a 0,74, arredonda para baixo, e de 0,25 a 0,49 e de 0,75 a 0,99, arredonda para cima. + IF pOrgaoConcedenteId = 17 + THEN + IF lCentavos BETWEEN 1 AND 24 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '00', '99999.99'); + END IF; + + IF (lCentavos BETWEEN 51 AND 74) OR (lCentavos BETWEEN 25 AND 49) + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '50', '99999.99'); + END IF; + + IF lCentavos BETWEEN 75 AND 99 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '00', '99999.99') + 1; + END IF; + END IF; + + -- SETRANS - PI - tarifas arredondadas a cada R$ 0,10 - sendo de 0,01 a 0,04 arredonda para baixo, de 0,05 a 0,09, arredonda para cima. + IF pOrgaoConcedenteId = 18 OR pOrgaoConcedenteId = 10 + THEN + IF lUltimoNumero BETWEEN 1 AND 4 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '0', + '99999.99'); + END IF; + + IF lUltimoNumero BETWEEN 5 AND 9 + THEN + lPrecoTotallArredondado := + to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '0', '99999.99') + 0.1; + END IF; + END IF; + + --DER-MG -- DER-PB e DETRAN-CE: mesma regra para os dois, tarifas arredondadas a cada R$ 0,05, sendo de 0,01 a 0,024 e 0,051 a 0,074 arredonda para baixo e de 0,025 a 0,049 e de 0,075 a 0,099 arredonda para cima. + IF pOrgaoConcedenteId = 19 OR pOrgaoConcedenteId = 20 OR pOrgaoConcedenteId = 6 + THEN + lStrPrecoTotal := to_char(lPrecoTotal, '99999.999'); + lUltimoNumero := to_number(substr(lStrPrecoTotal, -1), '9'); + lStrAntePenlultimoNumero := substr(lStrPrecoTotal, -3, 1); + lStrParteInteira := trim(substr(lStrPrecoTotal, 0, length(lStrPrecoTotal) - 4)); + lDoisUltimos := to_number(substr(lStrPrecoTotal, -2, 2), '99'); + + IF lDoisUltimos BETWEEN 10 AND 24 + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || lStrAntePenlultimoNumero || '00', '99999.999'); + END IF; + + IF (lDoisUltimos BETWEEN 51 AND 74) OR (lDoisUltimos BETWEEN 25 AND 49) + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || lStrAntePenlultimoNumero || '50', '99999.999'); + END IF; + + IF lDoisUltimos BETWEEN 75 AND 99 + THEN + lPrecoTotallArredondado := + to_number(lStrParteInteira || '.' || lStrAntePenlultimoNumero || '00', '99999.999') + 0.1; + END IF; + END IF; + + --ARTESP + IF pOrgaoConcedenteId = 21 + THEN + --regra 1 + IF lUltimoNumero BETWEEN 1 AND 2 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '0', + '99999.99'); + END IF; + + --regras 2 e 3 + IF (lUltimoNumero BETWEEN 3 AND 4) OR (lUltimoNumero BETWEEN 6 AND 7) + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '5', + '99999.99'); + END IF; + + --regra 5 + IF lCentavos BETWEEN 98 AND 99 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '00', '99999.99') + 1; + --regra 4 + ELSIF lUltimoNumero BETWEEN 8 AND 9 + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || (to_number(substr(lCentavos, -2, 1), '9') + 1), + '99999.99'); + END IF; + END IF; + + IF pOrgaoConcedenteId= 9 or pOrgaoConcedenteId = 22 + THEN + lStrPrecoTotal := to_char(lPrecoTotal, '99999.9999'); + lStrAntePenlultimoNumero := substr(lStrPrecoTotal, -4, 1); + lStrParteInteira := trim(substr(lStrPrecoTotal, 0, length(lStrPrecoTotal) - 5)); + lTresUltimos := to_number(substr(lStrPrecoTotal, -3, 3), '999'); + + IF lTresUltimos BETWEEN 001 and 254 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrAntePenlultimoNumero || '000', '99999.9999'); + END IF; + IF lTresUltimos BETWEEN 255 AND 754 + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || lStrAntePenlultimoNumero || '500', '99999.9999'); + END IF; + IF lTresUltimos BETWEEN 755 AND 999 + THEN + lPrecoTotallArredondado := + to_number(lStrParteInteira || '.' || lStrAntePenlultimoNumero || '000', '99999.9999') + 0.1; + END IF; + END IF; + + lDiferencaArredondamento := lPrecoTotallArredondado - lPrecoTotal; + + RETURN pTarifa + ldiferencaarredondamento; + + END FN_ARREDONDAMENTO_TARIFA; + / \ No newline at end of file diff --git a/src/db/migration/migration/V20170529_1419__mantis9091.sql b/src/db/migration/migration/V20170529_1419__mantis9091.sql new file mode 100644 index 000000000..93a9d3dfe --- /dev/null +++ b/src/db/migration/migration/V20170529_1419__mantis9091.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD(TAXACONVENIENCIAPORC NUMBER(7,2), + MAXIMOTAXACONVENIENCIA NUMBER(7,2))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170529_2202__mantis9035.sql b/src/db/migration/migration/V20170529_2202__mantis9035.sql new file mode 100644 index 000000000..f7ceff177 --- /dev/null +++ b/src/db/migration/migration/V20170529_2202__mantis9035.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_MINIMA ADD (COEFICIENTETARIFA_ID NUMBER(7) )'; + exception when others then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_MINIMA ADD CONSTRAINT TARIFA_MINIMA_FK_COEFICIENTE FOREIGN KEY (COEFICIENTETARIFA_ID) REFERENCES COEFICIENTE_TARIFA (COEFICIENTETARIFA_ID) ENABLE'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170531_1010__mantis9105.sql b/src/db/migration/migration/V20170531_1010__mantis9105.sql new file mode 100644 index 000000000..17588630d --- /dev/null +++ b/src/db/migration/migration/V20170531_1010__mantis9105.sql @@ -0,0 +1,47 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE SECRETARIA ADD (INDSERIESUBSERIE NUMBER(1,0) DEFAULT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CUPON_SECRETARIA ADD (SERIE VARCHAR(30) DEFAULT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CUPON_SECRETARIA ADD (SUBSERIE VARCHAR(30) DEFAULT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DET_PAGO ADD (SERIESUBSERIE VARCHAR2(30) DEFAULT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DET_PAGO ADD (CAJADIVERSOS_ID NUMBER(15,0) DEFAULT NULL)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DET_PAGO ADD (CAJADIVERSOSPAGO_ID NUMBER(15,0) DEFAULT NULL)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170601_1137__mantis9091.sql b/src/db/migration/migration/V20170601_1137__mantis9091.sql new file mode 100644 index 000000000..b2db53164 --- /dev/null +++ b/src/db/migration/migration/V20170601_1137__mantis9091.sql @@ -0,0 +1,35 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TIPO_EVENTO_EXTRA ADD( CVESISTEMA VARCHAR2(30))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'alter table TIPO_EVENTO_EXTRA add constraint uniq_cvesistema unique("CVESISTEMA")'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; +/ +declare +begin + execute immediate 'alter session set nls_numeric_characters = '',.'' '; + execute immediate 'Insert into TIPO_EVENTO_EXTRA (TIPOEVENTOEXTRA_ID,PARAMARTICULO_ID,INDTIPO,IMPMAX,INDVALIDACORTE,INDVALIDADOCUMENTO,INDCONTRAPARTIDA,INDBOLETO,INDORDENSERVICIO,PORCIVA,FORMAPAGO_ID,USUARIO_ID,FECMODIF,ACTIVO,PARAMARTICULO2_ID,INDTIPO2,FORMAPAGO2_ID,INDOPERACION,DESCTIPOEVENTO,PROVEEDOR,IMPFISCALNUMOPERACAO,NATUREZA,CONTACONTABIL,INDCONFERENCIAFISICACOMISSAO,CVETIPOEVENTO,CVESISTEMA) +values (TIPO_EVENTO_EXTRA_SEQ.nextval,null,''1'',''99999,99'',null,''0'',null,''0'',null,''0'',null,''1'',sysdate,''1'',null,null,null,''1'',''TAXA DE CONVENIENCIA TARIFA'',null,null,''RECEITA'',null,null,null,''TAXA_CONVENIENCIA_TARIFA'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170601_1355__mantis9052.sql b/src/db/migration/migration/V20170601_1355__mantis9052.sql new file mode 100644 index 000000000..abd2b27fa --- /dev/null +++ b/src/db/migration/migration/V20170601_1355__mantis9052.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA_EMBRQ_DESEMBRQ ADD (EMBARQUE NUMBER(1,0), DESEMBARQUE NUMBER(1,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA_EMBRQ_DESEMBRQ ADD (EMBARQUE NUMBER(1,0), DESEMBARQUE NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170601_1404__mantis9090.sql b/src/db/migration/migration/V20170601_1404__mantis9090.sql new file mode 100644 index 000000000..796135b7b --- /dev/null +++ b/src/db/migration/migration/V20170601_1404__mantis9090.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_BLOQ_IMPPOSTERIOR ADD (ACTIVO NUMBER(1) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_BLOQ_IMPPOSTERIOR ADD (FECMODIF DATE)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_BLOQ_IMPPOSTERIOR ADD (USUARIO_ID NUMBER(7))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170602_1051__mantis9138.sql b/src/db/migration/migration/V20170602_1051__mantis9138.sql new file mode 100644 index 000000000..97997afe4 --- /dev/null +++ b/src/db/migration/migration/V20170602_1051__mantis9138.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE USUARIO ADD (TEMPODEVOLUCAOPASSAGEM NUMBER(7))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170605_1444__mantis9071.sql b/src/db/migration/migration/V20170605_1444__mantis9071.sql new file mode 100644 index 000000000..8ed3a719b --- /dev/null +++ b/src/db/migration/migration/V20170605_1444__mantis9071.sql @@ -0,0 +1,8 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VTA>SITEFF>>ACESSO_MENU_SITEF'', + ''ACESSO_MENU_INTERATIVO_SITEF'', 1, + current_date, NULL)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170608_1701__mantis9149.sql b/src/db/migration/migration/V20170608_1701__mantis9149.sql new file mode 100644 index 000000000..a1052d596 --- /dev/null +++ b/src/db/migration/migration/V20170608_1701__mantis9149.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ALTERAR EMBARQUE DESEMBARQUE'', + ''COM.RJCONSULTORES.VENTABOLETOS.ALTERAREMBARQUEDESEMBARQUE'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170609_1701__mantis9181.sql b/src/db/migration/migration/V20170609_1701__mantis9181.sql new file mode 100644 index 000000000..fb5b1880c --- /dev/null +++ b/src/db/migration/migration/V20170609_1701__mantis9181.sql @@ -0,0 +1,27 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate' + CREATE TABLE MOTIVO_DEVOLUCAO_BILHETE +( + MOTIVODEVOLUCAOBILHETE_ID NUMBER(15) PRIMARY KEY NOT NULL, + DESCMOTIVO VARCHAR2(50) NULL, + ACTIVO NUMBER(1) NULL, + USUARIO_ID NUMBER(7) NULL, + FECMODIF DATE NULL + +)'; + exception when table_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE MOTIVO_DEVOLUCAO_BILHETE_SEQ + MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 + START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170609_1922__mantis9181.sql b/src/db/migration/migration/V20170609_1922__mantis9181.sql new file mode 100644 index 000000000..e6a15b810 --- /dev/null +++ b/src/db/migration/migration/V20170609_1922__mantis9181.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM >> CONFIG COMERCIAL > MOTIVO DEVOLUCAO BILHETE'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.MOTIVOSDELADEVOLUCAOBILHETE'',1,SYSDATE,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170613_1645__mantis9077.sql b/src/db/migration/migration/V20170613_1645__mantis9077.sql new file mode 100644 index 000000000..443d0c4b5 --- /dev/null +++ b/src/db/migration/migration/V20170613_1645__mantis9077.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'INSERT INTO PRICING_ESP_PUNTO_VENTA pe ( pe.PRICINGESPPUNTOVENTA_ID, pe.PUNTOVENTA_ID, pe.PRICINGESPECIFICO_ID, pe.ACTIVO, pe.FECMODIF, pe.USUARIO_ID ) + SELECT PRICING_ESP_PUNTOV_SEQ.nextval ,-1, p.PRICINGESPECIFICO_ID,1,sysdate,1 FROM PRICING_ESPECIFICO p WHERE ACTIVO=1'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170615_1352__mantis8834.sql b/src/db/migration/migration/V20170615_1352__mantis8834.sql new file mode 100644 index 000000000..594a84f9b --- /dev/null +++ b/src/db/migration/migration/V20170615_1352__mantis8834.sql @@ -0,0 +1,27 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table control_efectivo modify (controlefectivo_id number(8,0))'; + exception when column_exists then null; +end; +/ +declare + except_02289 exception; + pragma exception_init (except_02289, -02289); +begin + execute immediate 'drop sequence CONTROL_EFECTIVO_SEQ'; + exception when except_02289 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + + valor_atual number := 0; +begin + execute immediate 'select coalesce(max(controlefectivo_id),0)+1 from CONTROL_EFECTIVO' INTO valor_atual; + execute immediate 'CREATE SEQUENCE CONTROL_EFECTIVO_SEQ MINVALUE 0 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH ' || valor_atual || ' CACHE 20 NOORDER NOCYCLE' ; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170616_1046__constanteAuditoria.sql b/src/db/migration/migration/V20170616_1046__constanteAuditoria.sql new file mode 100644 index 000000000..27e6e2495 --- /dev/null +++ b/src/db/migration/migration/V20170616_1046__constanteAuditoria.sql @@ -0,0 +1,12 @@ +declare +begin + begin + execute immediate 'INSERT INTO CONSTANTE(CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + VALUES(CONSTANTE_SEQ.nextval,''AUDITAR_SISTEMA'',''Auditoria do sistema'',1,''false'',1,1,sysdate,1)'; + exception when others then null; + end; + begin + execute immediate 'UPDATE CONSTANTE SET VALORCONSTANTE = ''false'' WHERE NOMBCONSTANTE = ''AUDITAR_SISTEMA'''; + exception when others then null; + end; +end; diff --git a/src/db/migration/migration/V20170619_1834__importeContaCorrente.sql b/src/db/migration/migration/V20170619_1834__importeContaCorrente.sql new file mode 100644 index 000000000..58e1eceae --- /dev/null +++ b/src/db/migration/migration/V20170619_1834__importeContaCorrente.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table CONTA_CORRENTE_PTOVTA MODIFY ( IMPORTE number(12,2), +IMPORTETARIFA number(12,2), +IMPORTEPEDAGIO number(12,2), +IMPORTETAXAEMBARQUE number(12,2), +IMPORTESEGURO number(12,2), +IMPORTEINGRESO number(12,2), +IMPORTEEGRESO number(12,2), +IMPORTEDEVOLUCION number(12,2), +IMPORTETROCA number(12,2), +IMPORTETOTALEFECTIVO number(12,2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170621_0832__mantis9138.sql b/src/db/migration/migration/V20170621_0832__mantis9138.sql new file mode 100644 index 000000000..58bf812c3 --- /dev/null +++ b/src/db/migration/migration/V20170621_0832__mantis9138.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'UPDATE USUARIO SET TEMPODEVOLUCAOPASSAGEM = 0 WHERE TEMPODEVOLUCAOPASSAGEM IS NULL'; + exception when dup_val_on_index then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01442); +begin + execute immediate 'ALTER TABLE USUARIO MODIFY (TEMPODEVOLUCAOPASSAGEM DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170622_1417__mantis9182.sql b/src/db/migration/migration/V20170622_1417__mantis9182.sql new file mode 100644 index 000000000..08b2b2d8d --- /dev/null +++ b/src/db/migration/migration/V20170622_1417__mantis9182.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (MOTIVODEVOLUCAOBILHETE_ID NUMBER(7))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170623_1500__mantis9182.sql b/src/db/migration/migration/V20170623_1500__mantis9182.sql new file mode 100644 index 000000000..501a718ce --- /dev/null +++ b/src/db/migration/migration/V20170623_1500__mantis9182.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE MOTIVO_DEVOLUCAO_BILHETE ADD (TXTRELATORIO VARCHAR2(100))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170623_1530__mantis9150.sql b/src/db/migration/migration/V20170623_1530__mantis9150.sql new file mode 100644 index 000000000..dd797f740 --- /dev/null +++ b/src/db/migration/migration/V20170623_1530__mantis9150.sql @@ -0,0 +1,59 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE MD_CONTA ( + CONTA_ID NUMBER(7) NOT NULL, + CVECONTA VARCHAR2(50), + NOME VARCHAR2(100), + TIPO VARCHAR2(1), + CODIGOCONTABIL NUMBER(5), + DOCASSOCIADO NUMBER(1), + CANCELAMENTO NUMBER(1), + STATUS NUMBER(1), + ORIGEM VARCHAR2(2), + REFERENCIA VARCHAR2(100), + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (CONTA_ID) + )'; + + execute immediate + 'CREATE SEQUENCE MDCONTA_SEQ INCREMENT BY 1 START WITH 50 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE MD_TOTALIZADOR ( + TOTALIZADOR_ID NUMBER(12) NOT NULL, + FECCORTE DATE, + PUNTOVENTA_ID NUMBER(7), + EMPRESA_ID NUMBER(7), + CONTA_ID NUMBER(7), + IMPORTE NUMBER(12,2), + PRIMARY KEY (TOTALIZADOR_ID) + )'; + + execute immediate + 'CREATE SEQUENCE MDTOTALIZADOR_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -02275); +begin + execute immediate 'ALTER TABLE MD_TOTALIZADOR ADD FOREIGN KEY (CONTA_ID) REFERENCES MD_CONTA (CONTA_ID)'; + exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20170626_1130__mantis9150.sql b/src/db/migration/migration/V20170626_1130__mantis9150.sql new file mode 100644 index 000000000..9be17bddf --- /dev/null +++ b/src/db/migration/migration/V20170626_1130__mantis9150.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_TOTALIZADOR ADD (ACTIVO NUMBER(1))'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_TOTALIZADOR ADD (USUARIO_ID NUMBER(7))'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_TOTALIZADOR ADD (FECMODIF DATE)'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170627_1130__mantis9150.sql b/src/db/migration/migration/V20170627_1130__mantis9150.sql new file mode 100644 index 000000000..7f464d5db --- /dev/null +++ b/src/db/migration/migration/V20170627_1130__mantis9150.sql @@ -0,0 +1,30 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE MD_RESUMO_ECF ( + RESUMOECF_ID NUMBER(12) NOT NULL, + DATAMOV VARCHAR2(8), + PUNTOVENTA_ID NUMBER(7), + SERIE VARCHAR2(6), + SUBSERIE VARCHAR2(3), + TOTAL NUMBER(12,2), + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (RESUMOECF_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE MDRESUMOECF_SEQ INCREMENT BY 1 START WITH 50 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170627_1620__mantis9150.sql b/src/db/migration/migration/V20170627_1620__mantis9150.sql new file mode 100644 index 000000000..71e9aecab --- /dev/null +++ b/src/db/migration/migration/V20170627_1620__mantis9150.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EVENTO_EXTRA ADD (SERIEIMPFISCAL VARCHAR2(6))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170628_1630__mantis9150.sql b/src/db/migration/migration/V20170628_1630__mantis9150.sql new file mode 100644 index 000000000..2c4cd46b9 --- /dev/null +++ b/src/db/migration/migration/V20170628_1630__mantis9150.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ADM > CATALOGOS >> CONTAS MD'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGOS.CONTASMD'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170628_1636__mantis9233.sql b/src/db/migration/migration/V20170628_1636__mantis9233.sql new file mode 100644 index 000000000..5ee4471d3 --- /dev/null +++ b/src/db/migration/migration/V20170628_1636__mantis9233.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE OCD ADD(INDPUNTOVENTAESTORNO NUMBER(1,0) DEFAULT 0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170629_1501__mantis9233.sql b/src/db/migration/migration/V20170629_1501__mantis9233.sql new file mode 100644 index 000000000..baa161368 --- /dev/null +++ b/src/db/migration/migration/V20170629_1501__mantis9233.sql @@ -0,0 +1,38 @@ + +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'update ocd set INDPUNTOVENTAESTORNO = 1 where ocd_id in(select OCD.OCD_ID FROM + BOLETO B +INNER JOIN OCD OCD +ON + OCD.BOLETO_ID = B.BOLETO_ID +INNER JOIN MARCA M +ON + M.MARCA_ID = B.MARCA_ID +INNER JOIN EMPRESA E +ON + E.EMPRESA_ID = M.EMPRESA_ID +LEFT JOIN OCD_PARAM op +ON + op.EMPRESA_ID = E.EMPRESA_ID +AND op.ACTIVO = 1 +LEFT JOIN OCD_PTOVTA_PARAM opp +ON + opp.OCDPARAM_ID = op.OCDPARAM_ID +AND opp.ACTIVO = 1 +WHERE + OCD.FECINC >= to_date(''01/06/2017'',''dd/MM/yyyy'') +AND + ( + B.PTOVTAVENTA_ID = (select VALORCONSTANTE from CONSTANTE where NOMBCONSTANTE = ''PUNTO_VENTA_J3'') + OR B.PUNTOVENTA_ID = (select VALORCONSTANTE from CONSTANTE where NOMBCONSTANTE = ''PUNTO_VENTA_J3'') + OR + ( + B.PTOVTAVENTA_ID = opp.PUNTOVENTA_ID + OR B.PUNTOVENTA_ID = opp.PUNTOVENTA_ID + ) + ))'; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20170629_1821__mantis9261.sql b/src/db/migration/migration/V20170629_1821__mantis9261.sql new file mode 100644 index 000000000..3257a1ecb --- /dev/null +++ b/src/db/migration/migration/V20170629_1821__mantis9261.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDVALIDADESCONTOTARIFA NUMBER(1,0) DEFAULT 0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170702_1432__mantis9295.sql b/src/db/migration/migration/V20170702_1432__mantis9295.sql new file mode 100644 index 000000000..d19dce960 --- /dev/null +++ b/src/db/migration/migration/V20170702_1432__mantis9295.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_CAT_IND ADD (USUARIOBLOQUEADO_ID NUMBER(7) DEFAULT -1) '; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170702_1516__mantis9295.sql b/src/db/migration/migration/V20170702_1516__mantis9295.sql new file mode 100644 index 000000000..89b4b0820 --- /dev/null +++ b/src/db/migration/migration/V20170702_1516__mantis9295.sql @@ -0,0 +1,7 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'INSERT INTO USUARIO (USUARIO_ID, NOMBUSUARIO, CVEUSUARIO, activo) VALUES (-1, ''TODOS'', ''TODOS'', 1)'; + exception when ja_existe then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170703_1457__mantis9309.sql b/src/db/migration/migration/V20170703_1457__mantis9309.sql new file mode 100644 index 000000000..5bba18e1d --- /dev/null +++ b/src/db/migration/migration/V20170703_1457__mantis9309.sql @@ -0,0 +1,12 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_COMISSAO + ADD ( + INDBILHETESTROCADOS NUMBER (1,0) DEFAULT 1, + INDBILHETESTRANSFERIDOS NUMBER (1,0) DEFAULT 1, + INDBILHETESDEVCANORIGEM NUMBER (1,0) + )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170703_1921__mantis9107.sql b/src/db/migration/migration/V20170703_1921__mantis9107.sql new file mode 100644 index 000000000..5bb38de6a --- /dev/null +++ b/src/db/migration/migration/V20170703_1921__mantis9107.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (INDBLOQUEIOPTA NUMBER(1,0))'; + exception when column_exists then null; +end; + \ No newline at end of file diff --git a/src/db/migration/migration/V20170703_1948__mantis9316.sql b/src/db/migration/migration/V20170703_1948__mantis9316.sql new file mode 100644 index 000000000..357cb1733 --- /dev/null +++ b/src/db/migration/migration/V20170703_1948__mantis9316.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''FECHAMENTO_CONTA_CORRENTE_FIXO'',''FECHAMENTO_CONTA_CORRENTE_FIXO'',''1'',''-1'',''1'',''1'',to_date(''21-03-2015 10:24:00'',''DD-MM-YYYY HH24:MI:SS''),''1'')'; + exception when dup_val_on_index then null; +end; + diff --git a/src/db/migration/migration/V20170704_1505__mantis9320.sql b/src/db/migration/migration/V20170704_1505__mantis9320.sql new file mode 100644 index 000000000..504a06f1b --- /dev/null +++ b/src/db/migration/migration/V20170704_1505__mantis9320.sql @@ -0,0 +1,111 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update CATEGORIA_DESCUENTO set indSegunda = 1 where indSegunda is null'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update CATEGORIA_DESCUENTO set indTerca = 1 where indTerca is null'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update CATEGORIA_DESCUENTO set indQuarta = 1 where indQuarta is null'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update CATEGORIA_DESCUENTO set indQuinta = 1 where indQuinta is null'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update CATEGORIA_DESCUENTO set indSexta = 1 where indSexta is null'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update CATEGORIA_DESCUENTO set indSabado = 1 where indSabado is null'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update CATEGORIA_DESCUENTO set indDomingo = 1 where indDomingo is null'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (INDSEGUNDA NOT NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (INDTERCA NOT NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (INDQUARTA NOT NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (INDQUINTA NOT NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (INDSEXTA NOT NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (INDSABADO NOT NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (INDDOMINGO NOT NULL)'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170704_1650__mantis9290.sql b/src/db/migration/migration/V20170704_1650__mantis9290.sql new file mode 100644 index 000000000..cb8a27d71 --- /dev/null +++ b/src/db/migration/migration/V20170704_1650__mantis9290.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE USUARIO ADD (INDEXPIRASENHA NUMBER(1) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170704_2037__mantis9325.sql b/src/db/migration/migration/V20170704_2037__mantis9325.sql new file mode 100644 index 000000000..5ce1fa058 --- /dev/null +++ b/src/db/migration/migration/V20170704_2037__mantis9325.sql @@ -0,0 +1,161 @@ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''-1'',''TODOS'',''0'',''0'',to_date(''22-12-2012 18:10:18'',''DD-MM-YYYY HH24:MI:SS''),''1'',''1'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''1'',''DER/SP'',''0'',''0'',to_date(''24-03-2015 15:51:45'',''DD-MM-YYYY HH24:MI:SS''),''1'',''462'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''2'',''DER/PR'',''0'',''0'',to_date(''28-09-2015 14:07:00'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''3'',''ANTT'',''0'',''0'',to_date(''04-07-2017 16:40:36'',''DD-MM-YYYY HH24:MI:SS''),''1'',''462'',''04.898.488/0001-77'',''1'',''60'',''0,61'',null,''50'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''4'',''DER/MS'',''0'',''0'',to_date(''26-08-2015 14:42:56'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6486'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''5'',''DER/MT'',''0'',''0'',to_date(''02-10-2015 12:01:37'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''6'',''DER/MG'',''0'',''0'',to_date(''23-11-2016 17:04:46'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',''0'',''60'',''1,111'',null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''7'',''DER/BA'',''0'',''0'',to_date(''21-10-2016 09:36:14'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6405'',''04.898.488/0001-77'',''1'',''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''8'',''DER/CE/PB/PA'',''0'',''0'',to_date(''07-10-2015 11:16:58'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',''1'',''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''9'',''DER/RJ'',''0'',''0'',to_date(''11-05-2017 14:28:20'',''DD-MM-YYYY HH24:MI:SS''),''1'',''7089'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''10'',''DER/ES'',''0'',''0'',to_date(''07-10-2015 11:17:03'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',''1'',''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''11'',''INTERNACIONAL'',''0'',''0'',to_date(''21-08-2012 16:44:42'',''DD-MM-YYYY HH24:MI:SS''),''1'',''146'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''12'',''DER/TO'',''0'',''0'',to_date(''20-03-2015 15:12:24'',''DD-MM-YYYY HH24:MI:SS''),''1'',''4393'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''13'',''DER/CE'',''1'',''0'',to_date(''22-03-2017 14:05:15'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6486'',''04.898.488/0001-77'',''1'',''65'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''14'',''DER/PE'',''0'',''0'',to_date(''28-09-2015 15:26:12'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''15'',''DER/SC'',''0'',''0'',to_date(''28-09-2015 13:56:33'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''16'',''DER/GO'',''0'',''0'',to_date(''28-09-2015 17:16:14'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''17'',''SINFRA - MA'',''0'',''0'',to_date(''18-03-2015 14:51:54'',''DD-MM-YYYY HH24:MI:SS''),''1'',''2642'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''18'',''SETRANS - PI'',''0'',''0'',to_date(''31-01-2014 17:42:22'',''DD-MM-YYYY HH24:MI:SS''),''1'',''-1'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''19'',''DER-PB'',''0'',''0'',to_date(''02-10-2015 11:42:34'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''20'',''DETRAN-CE'',''0'',''0'',to_date(''23-02-2017 14:15:14'',''DD-MM-YYYY HH24:MI:SS''),''1'',''1861'',''04.898.488/0001-77'',''0'',''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''21'',''ARTESP'',''0'',''0'',to_date(''03-07-2017 12:55:52'',''DD-MM-YYYY HH24:MI:SS''),''1'',''7478'',''04.898.488/0001-77'',''1'',''60'',''24,3'',null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''22'',''DETRO/RJ'',''0'',''0'',to_date(''03-07-2017 11:39:48'',''DD-MM-YYYY HH24:MI:SS''),''1'',''7449'',''04.898.488/0001-77'',null,''60'',''1'',null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''23'',''Pref.Marilia'',''0'',''0'',to_date(''14-07-2015 17:47:00'',''DD-MM-YYYY HH24:MI:SS''),''1'',''146'',null,null,''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''24'',''EMTU'',''0'',''0'',to_date(''18-09-2015 12:02:38'',''DD-MM-YYYY HH24:MI:SS''),''1'',''1'',null,''0'',''60'',''0'',null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''25'',''Pref de Ibatiba'',''0'',''0'',to_date(''07-10-2015 11:17:03'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',''1'',''60'',null,null,null)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''26'',''Pref de Jo�o Neiva'',''0'',''0'',to_date(''07-10-2015 11:17:03'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',''1'',''60'',null,null,null)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170705_1828__mantis9309.sql b/src/db/migration/migration/V20170705_1828__mantis9309.sql new file mode 100644 index 000000000..94fb1cce2 --- /dev/null +++ b/src/db/migration/migration/V20170705_1828__mantis9309.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + except_00904 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00904 , -00904); +begin + execute immediate 'ALTER TABLE PTOVTA_COMISSAO + DROP ( + INDBILHETESTROCADOS, INDBILHETESTRANSFERIDOS + )'; + + exception + when object_exists then null; + when except_00904 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170706_1126__mantis9329.sql b/src/db/migration/migration/V20170706_1126__mantis9329.sql new file mode 100644 index 000000000..98eee411f --- /dev/null +++ b/src/db/migration/migration/V20170706_1126__mantis9329.sql @@ -0,0 +1,169 @@ +create or replace FUNCTION "FN_ARREDONDAMENTO_TARIFA"(pTarifa IN NUMBER, + pOrgaoConcedenteId IN NUMBER, + pImporteSeguro IN NUMBER, + pImporteTaxaEmbarque IN NUMBER, + pImportePedagio IN NUMBER, + pImporteOutros IN NUMBER, + pTxEmbarque IN INTEGER) + RETURN NUMBER AS + + lStrPrecoTotal VARCHAR(15); + lUltimoNumero NUMBER; + lStrPenlultimoNumero VARCHAR(2); + lStrParteInteira VARCHAR(10); + lPrecoTotallArredondado NUMBER; + lPrecoTotal NUMBER; + lDiferencaArredondamento NUMBER; + lCentavos NUMBER; + lDoisUltimos NUMBER; + lTresUltimos NUMBER; + lStrAntePenlultimoNumero NUMBER; + + BEGIN + + IF pTxEmbarque = 1 + THEN + lPrecoTotal := + coalesce(pTarifa, 0) + coalesce(pImporteSeguro, 0) + coalesce(pImporteTaxaEmbarque, 0) + + coalesce(pImportePedagio, 0) + coalesce(pImporteOutros, 0); + ELSE + lPrecoTotal := + coalesce(pTarifa, 0) + coalesce(pImporteSeguro, 0) + coalesce(pImportePedagio, 0) + + coalesce(pImporteOutros, 0); + END IF; + + --PARA A AGUIA BRANCA, O RGO 10 APENAS CONSIDERA TARIFA (TALVEZ VAI EXISTIR A NECESSIDADE DE PARAMETRIZAR POR EMPRESA + IF pOrgaoConcedenteId = 10 THEN + lPrecoTotal :=coalesce(pTarifa, 0); + END IF; + + lPrecoTotallArredondado := lPrecoTotal; + + + lStrPrecoTotal := to_char(lPrecoTotal, '99999.99'); + lUltimoNumero := to_number(substr(lStrPrecoTotal, -1), '9'); + lStrPenlultimoNumero := substr(lStrPrecoTotal, length(lStrPrecoTotal) - 1, 1); + lStrParteInteira := trim(substr(lStrPrecoTotal, 0, length(lStrPrecoTotal) - 3)); + lCentavos := to_number(substr(lStrPrecoTotal, -2, 2), '99'); + + -- SINFRA - MA - tarifas arredondadas a cada R$ 0,50 - com a seguinte regra, de 0,01 a 0,24 e de 0,51 a 0,74, arredonda para baixo, e de 0,25 a 0,49 e de 0,75 a 0,99, arredonda para cima. + IF pOrgaoConcedenteId = 17 + THEN + IF lCentavos BETWEEN 1 AND 24 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '00', '99999.99'); + END IF; + + IF (lCentavos BETWEEN 51 AND 74) OR (lCentavos BETWEEN 25 AND 49) + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '50', '99999.99'); + END IF; + + IF lCentavos BETWEEN 75 AND 99 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '00', '99999.99') + 1; + END IF; + END IF; + + -- SETRANS - PI - tarifas arredondadas a cada R$ 0,10 - sendo de 0,01 a 0,04 arredonda para baixo, de 0,05 a 0,09, arredonda para cima. + IF pOrgaoConcedenteId = 18 OR pOrgaoConcedenteId = 10 + THEN + IF lUltimoNumero BETWEEN 1 AND 4 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '0', + '99999.99'); + END IF; + + IF lUltimoNumero BETWEEN 5 AND 9 + THEN + lPrecoTotallArredondado := + to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '0', '99999.99') + 0.1; + END IF; + END IF; + + --DER-MG -- DER-PB e DETRAN-CE: mesma regra para os dois, tarifas arredondadas a cada R$ 0,05, sendo de 0,01 a 0,024 e 0,051 a 0,074 arredonda para baixo e de 0,025 a 0,049 e de 0,075 a 0,099 arredonda para cima. + IF pOrgaoConcedenteId = 19 OR pOrgaoConcedenteId = 20 OR pOrgaoConcedenteId = 6 + THEN + lStrPrecoTotal := to_char(lPrecoTotal, '99999.999'); + lUltimoNumero := to_number(substr(lStrPrecoTotal, -1), '9'); + lStrAntePenlultimoNumero := substr(lStrPrecoTotal, -3, 1); + lStrParteInteira := trim(substr(lStrPrecoTotal, 0, length(lStrPrecoTotal) - 4)); + lDoisUltimos := to_number(substr(lStrPrecoTotal, -2, 2), '99'); + + IF lDoisUltimos BETWEEN 10 AND 24 + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || lStrAntePenlultimoNumero || '00', '99999.999'); + END IF; + + IF (lDoisUltimos BETWEEN 51 AND 74) OR (lDoisUltimos BETWEEN 25 AND 49) + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || lStrAntePenlultimoNumero || '50', '99999.999'); + END IF; + + IF lDoisUltimos BETWEEN 75 AND 99 + THEN + lPrecoTotallArredondado := + to_number(lStrParteInteira || '.' || lStrAntePenlultimoNumero || '00', '99999.999') + 0.1; + END IF; + END IF; + + --ARTESP + IF pOrgaoConcedenteId = 21 + THEN + --regra 1 + IF lUltimoNumero BETWEEN 1 AND 2 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '0', + '99999.99'); + END IF; + + --regras 2 e 3 + IF (lUltimoNumero BETWEEN 3 AND 4) OR (lUltimoNumero BETWEEN 6 AND 7) + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '5', + '99999.99'); + END IF; + + --regra 5 + IF lCentavos BETWEEN 98 AND 99 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '00', '99999.99') + 1; + --regra 4 + ELSIF lUltimoNumero BETWEEN 8 AND 9 + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || (to_number(substr(lCentavos, -2, 1), '9') + 1), + '99999.99'); + END IF; + END IF; + + IF pOrgaoConcedenteId= 9 or pOrgaoConcedenteId = 22 + THEN + lStrPrecoTotal := to_char(lPrecoTotal, '99999.9999'); + lStrAntePenlultimoNumero := substr(lStrPrecoTotal, -4, 1); + lStrParteInteira := trim(substr(lStrPrecoTotal, 0, length(lStrPrecoTotal) - 5)); + lTresUltimos := to_number(substr(lStrPrecoTotal, -3, 3), '999'); + + IF lTresUltimos BETWEEN 001 and 254 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrAntePenlultimoNumero || '000', '99999.9999'); + END IF; + IF lTresUltimos BETWEEN 255 AND 754 + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || lStrAntePenlultimoNumero || '500', '99999.9999'); + END IF; + IF lTresUltimos BETWEEN 755 AND 999 + THEN + lPrecoTotallArredondado := + to_number(lStrParteInteira || '.' || lStrAntePenlultimoNumero || '000', '99999.9999') + 0.1; + END IF; + END IF; + + lDiferencaArredondamento := lPrecoTotallArredondado - lPrecoTotal; + + RETURN pTarifa + ldiferencaarredondamento; + + END FN_ARREDONDAMENTO_TARIFA; \ No newline at end of file diff --git a/src/db/migration/migration/V20170707_1533__mantis9329.sql b/src/db/migration/migration/V20170707_1533__mantis9329.sql new file mode 100644 index 000000000..8f434bc7c --- /dev/null +++ b/src/db/migration/migration/V20170707_1533__mantis9329.sql @@ -0,0 +1,169 @@ +CREATE OR REPLACE FUNCTION "FN_ARREDONDAMENTO_TARIFA"(pTarifa IN NUMBER, + pOrgaoConcedenteId IN NUMBER, + pImporteSeguro IN NUMBER, + pImporteTaxaEmbarque IN NUMBER, + pImportePedagio IN NUMBER, + pImporteOutros IN NUMBER, + pTxEmbarque IN INTEGER) + RETURN NUMBER AS + + lStrPrecoTotal VARCHAR(15); + lUltimoNumero NUMBER; + lStrPenlultimoNumero VARCHAR(2); + lStrParteInteira VARCHAR(10); + lPrecoTotallArredondado NUMBER; + lPrecoTotal NUMBER; + lDiferencaArredondamento NUMBER; + lCentavos NUMBER; + lDoisUltimos NUMBER; + lTresUltimos NUMBER; + lStrAntePenlultimoNumero NUMBER; + + BEGIN + + IF pTxEmbarque = 1 + THEN + lPrecoTotal := + coalesce(pTarifa, 0) + coalesce(pImporteSeguro, 0) + coalesce(pImporteTaxaEmbarque, 0) + + coalesce(pImportePedagio, 0) + coalesce(pImporteOutros, 0); + ELSE + lPrecoTotal := + coalesce(pTarifa, 0) + coalesce(pImporteSeguro, 0) + coalesce(pImportePedagio, 0) + + coalesce(pImporteOutros, 0); + END IF; + + --PARA A AGUIA BRANCA, O RGO 10 APENAS CONSIDERA TARIFA (TALVEZ VAI EXISTIR A NECESSIDADE DE PARAMETRIZAR POR EMPRESA + IF pOrgaoConcedenteId = 10 THEN + lPrecoTotal :=coalesce(pTarifa, 0); + END IF; + + lPrecoTotallArredondado := lPrecoTotal; + + + lStrPrecoTotal := to_char(lPrecoTotal, '99999.99'); + lUltimoNumero := to_number(substr(lStrPrecoTotal, -1), '9'); + lStrPenlultimoNumero := substr(lStrPrecoTotal, length(lStrPrecoTotal) - 1, 1); + lStrParteInteira := trim(substr(lStrPrecoTotal, 0, length(lStrPrecoTotal) - 3)); + lCentavos := to_number(substr(lStrPrecoTotal, -2, 2), '99'); + + -- SINFRA - MA - tarifas arredondadas a cada R$ 0,50 - com a seguinte regra, de 0,01 a 0,24 e de 0,51 a 0,74, arredonda para baixo, e de 0,25 a 0,49 e de 0,75 a 0,99, arredonda para cima. + IF pOrgaoConcedenteId = 17 + THEN + IF lCentavos BETWEEN 1 AND 24 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '00', '99999.99'); + END IF; + + IF (lCentavos BETWEEN 51 AND 74) OR (lCentavos BETWEEN 25 AND 49) + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '50', '99999.99'); + END IF; + + IF lCentavos BETWEEN 75 AND 99 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '00', '99999.99') + 1; + END IF; + END IF; + + -- SETRANS - PI - tarifas arredondadas a cada R$ 0,10 - sendo de 0,01 a 0,04 arredonda para baixo, de 0,05 a 0,09, arredonda para cima. + IF pOrgaoConcedenteId = 18 OR pOrgaoConcedenteId = 10 + THEN + IF lUltimoNumero BETWEEN 1 AND 4 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '0', + '99999.99'); + END IF; + + IF lUltimoNumero BETWEEN 6 AND 9 + THEN + lPrecoTotallArredondado := + to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '0', '99999.99') + 0.1; + END IF; + END IF; + + --DER-MG -- DER-PB e DETRAN-CE: mesma regra para os dois, tarifas arredondadas a cada R$ 0,05, sendo de 0,01 a 0,024 e 0,051 a 0,074 arredonda para baixo e de 0,025 a 0,049 e de 0,075 a 0,099 arredonda para cima. + IF pOrgaoConcedenteId = 19 OR pOrgaoConcedenteId = 20 OR pOrgaoConcedenteId = 6 + THEN + lStrPrecoTotal := to_char(lPrecoTotal, '99999.999'); + lUltimoNumero := to_number(substr(lStrPrecoTotal, -1), '9'); + lStrAntePenlultimoNumero := substr(lStrPrecoTotal, -3, 1); + lStrParteInteira := trim(substr(lStrPrecoTotal, 0, length(lStrPrecoTotal) - 4)); + lDoisUltimos := to_number(substr(lStrPrecoTotal, -2, 2), '99'); + + IF lDoisUltimos BETWEEN 10 AND 24 + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || lStrAntePenlultimoNumero || '00', '99999.999'); + END IF; + + IF (lDoisUltimos BETWEEN 51 AND 74) OR (lDoisUltimos BETWEEN 25 AND 49) + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || lStrAntePenlultimoNumero || '50', '99999.999'); + END IF; + + IF lDoisUltimos BETWEEN 75 AND 99 + THEN + lPrecoTotallArredondado := + to_number(lStrParteInteira || '.' || lStrAntePenlultimoNumero || '00', '99999.999') + 0.1; + END IF; + END IF; + + --ARTESP + IF pOrgaoConcedenteId = 21 + THEN + --regra 1 + IF lUltimoNumero BETWEEN 1 AND 2 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '0', + '99999.99'); + END IF; + + --regras 2 e 3 + IF (lUltimoNumero BETWEEN 3 AND 4) OR (lUltimoNumero BETWEEN 6 AND 7) + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrPenlultimoNumero || '5', + '99999.99'); + END IF; + + --regra 5 + IF lCentavos BETWEEN 98 AND 99 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || '00', '99999.99') + 1; + --regra 4 + ELSIF lUltimoNumero BETWEEN 8 AND 9 + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || (to_number(substr(lCentavos, -2, 1), '9') + 1), + '99999.99'); + END IF; + END IF; + + IF pOrgaoConcedenteId= 9 OR pOrgaoConcedenteId = 22 + THEN + lStrPrecoTotal := to_char(lPrecoTotal, '99999.9999'); + lStrAntePenlultimoNumero := substr(lStrPrecoTotal, -4, 1); + lStrParteInteira := trim(substr(lStrPrecoTotal, 0, length(lStrPrecoTotal) - 5)); + lTresUltimos := to_number(substr(lStrPrecoTotal, -3, 3), '999'); + + IF lTresUltimos BETWEEN 001 AND 254 + THEN + lPrecoTotallArredondado := to_number(lStrParteInteira || '.' || lStrAntePenlultimoNumero || '000', '99999.9999'); + END IF; + IF lTresUltimos BETWEEN 255 AND 754 + THEN + lPrecoTotallArredondado := to_number( + lStrParteInteira || '.' || lStrAntePenlultimoNumero || '500', '99999.9999'); + END IF; + IF lTresUltimos BETWEEN 755 AND 999 + THEN + lPrecoTotallArredondado := + to_number(lStrParteInteira || '.' || lStrAntePenlultimoNumero || '000', '99999.9999') + 0.1; + END IF; + END IF; + + lDiferencaArredondamento := lPrecoTotallArredondado - lPrecoTotal; + + RETURN pTarifa + ldiferencaarredondamento; + + END FN_ARREDONDAMENTO_TARIFA; \ No newline at end of file diff --git a/src/db/migration/migration/V20170710_1457__mantis9072.sql b/src/db/migration/migration/V20170710_1457__mantis9072.sql new file mode 100644 index 000000000..9e6d81e61 --- /dev/null +++ b/src/db/migration/migration/V20170710_1457__mantis9072.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE + TABLE PRICING_ESP_CANAL_VENTA ( + PRICINGESPCANAL_ID NUMBER(15) NOT NULL, + TIPOPTOVTA_ID NUMBER(15) NOT NULL, + PRICINGESPECIFICO_ID NUMBER(15) NOT NULL , + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + CONSTRAINT PRICINGESPCANALVENTA_PK PRIMARY KEY (PRICINGESPCANAL_ID) ENABLE)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE PRICING_ESP_CANAL_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; + \ No newline at end of file diff --git a/src/db/migration/migration/V20170710_1600__mantis9150.sql b/src/db/migration/migration/V20170710_1600__mantis9150.sql new file mode 100644 index 000000000..2e49fd76a --- /dev/null +++ b/src/db/migration/migration/V20170710_1600__mantis9150.sql @@ -0,0 +1,32 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE MD_DOCUMENTO ( + DOCUMENTO_ID NUMBER(12) NOT NULL, + FECCORTE DATE, + PUNTOVENTA_ID NUMBER(7), + EMPRESA_ID NUMBER(7), + CONTA_ID NUMBER(7), + SERIE VARCHAR2(30), + SUBSERIE VARCHAR2(30), + NUMEROINICIAL NUMBER(9), + NUMEROFINAL NUMBER(9), + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (DOCUMENTO_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE MDDOCUMENTO_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170710_1803__mantis9356.sql b/src/db/migration/migration/V20170710_1803__mantis9356.sql new file mode 100644 index 000000000..4e584a492 --- /dev/null +++ b/src/db/migration/migration/V20170710_1803__mantis9356.sql @@ -0,0 +1,17 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update USUARIO set TEMPODEVOLUCAOPASSAGEM = -1 where TEMPODEVOLUCAOPASSAGEM = 0 OR TEMPODEVOLUCAOPASSAGEM is null'; + exception when object_exists then null; +end; + +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE USUARIO MODIFY (TEMPODEVOLUCAOPASSAGEM DEFAULT -1 )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170711_1700__mantis9150.sql b/src/db/migration/migration/V20170711_1700__mantis9150.sql new file mode 100644 index 000000000..78713b82f --- /dev/null +++ b/src/db/migration/migration/V20170711_1700__mantis9150.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_CONTA MODIFY (REFERENCIA VARCHAR2(500))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170711_2000__mantis9063.sql b/src/db/migration/migration/V20170711_2000__mantis9063.sql new file mode 100644 index 000000000..767c57917 --- /dev/null +++ b/src/db/migration/migration/V20170711_2000__mantis9063.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE COM_EMP_CONFERENCIA ADD (INDTIPO_DEB_CRED NUMBER(1) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170712_1104__mantis9296.sql b/src/db/migration/migration/V20170712_1104__mantis9296.sql new file mode 100644 index 000000000..348bfaede --- /dev/null +++ b/src/db/migration/migration/V20170712_1104__mantis9296.sql @@ -0,0 +1,29 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE TIPO_EVENTO_EXTRA_PTOVTA( + TIPOEVENTOEXTRAPTOVTA_ID NUMBER(7) NOT NULL, + TIPOEVENTOEXTRA_ID NUMBER(7) NOT NULL, + PUNTOVENTA_ID NUMBER(7) NOT NULL, + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (TIPOEVENTOEXTRAPTOVTA_ID), + CONSTRAINT TIPO_EVENTO_EXTRA_FK FOREIGN KEY (TIPOEVENTOEXTRA_ID) REFERENCES TIPO_EVENTO_EXTRA (TIPOEVENTOEXTRA_ID), + CONSTRAINT TIPO_EVENTO_EXTRA_PTOVTA_FK FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE TIPOEVENTOEXTRAPTOVTA_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170712_1500__mantis9271.sql b/src/db/migration/migration/V20170712_1500__mantis9271.sql new file mode 100644 index 000000000..998a16a74 --- /dev/null +++ b/src/db/migration/migration/V20170712_1500__mantis9271.sql @@ -0,0 +1,48 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE DADOS_ESTORNO_CARTAO ( + DADOSESTORNOCARTAO_ID NUMBER(7) NOT NULL, + NUMCARTAO VARCHAR2(48), + FECTRANSACAO DATE, + NSU VARCHAR2(45), + NUMAUTORIZACAO VARCHAR2(45), + IMPORTETOTAL NUMBER(11,2), + IMPORTEESTORNADO NUMBER(11,2), + NOMBTITULAR VARCHAR2(180), + DOCUMENTOCPF VARCHAR2(45), + TELEFONO VARCHAR2(14), + EMAIL VARCHAR2(50), + ORIGEN_ID NUMBER(7), + DESTINO_ID NUMBER(7), + FECVIAGEM DATE, + FECREGISTRO DATE, + NUMFOLIOSISTEMA VARCHAR2(36), + NUMOPERACION VARCHAR2(36), + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (DADOSESTORNOCARTAO_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE DADOS_ESTORNO_CARTAO_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION add INDSOLICITADATOSTARJETA NUMBER(1) DEFAULT 0 NOT NULL'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170713_1610__mantis9150.sql b/src/db/migration/migration/V20170713_1610__mantis9150.sql new file mode 100644 index 000000000..da99e1a01 --- /dev/null +++ b/src/db/migration/migration/V20170713_1610__mantis9150.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (IMPORTETPP NUMBER(7,2))'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (IMPORTETPP NUMBER(7,2))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170714_1500__mantis9345.sql b/src/db/migration/migration/V20170714_1500__mantis9345.sql new file mode 100644 index 000000000..c26e4bb3b --- /dev/null +++ b/src/db/migration/migration/V20170714_1500__mantis9345.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA add INDBLOQUEACANCTROCAPASSNORMAL number(1)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA add INDBLOQUEACANCTROCAPTA number(1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170715_2234__mantis9107.sql b/src/db/migration/migration/V20170715_2234__mantis9107.sql new file mode 100644 index 000000000..d2392e0ba --- /dev/null +++ b/src/db/migration/migration/V20170715_2234__mantis9107.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,''1'',''VDA > VENDA >> ENTREGA PASSAGEM >>> BLOQUEIO PTA'',''COM.RJCONSULTORES.VENTABOLETOS.ENTREGABOLETOS.BLOQUEIOPTA'',''1'',sysdate,''1'')'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20170716_1718__mantis9293.sql b/src/db/migration/migration/V20170716_1718__mantis9293.sql new file mode 100644 index 000000000..80d96ecf4 --- /dev/null +++ b/src/db/migration/migration/V20170716_1718__mantis9293.sql @@ -0,0 +1,9 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD(INDMULTATRANSFERENCIA NUMBER(1,0), + INDDEVOLUCAOTRANSFERENCIA NUMBER(1,0), + INDCOBRANCATRANSFERENCIA NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170717_0858__mantis9192.sql b/src/db/migration/migration/V20170717_0858__mantis9192.sql new file mode 100644 index 000000000..e2022318f --- /dev/null +++ b/src/db/migration/migration/V20170717_0858__mantis9192.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE SEGURO_KM ADD TIPO_SEGURO varchar2(10)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA ADD IMPORTETPP number(7,2)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_OFICIAL ADD IMPORTETPP number(7,2)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170717_1021__mantis9296.sql b/src/db/migration/migration/V20170717_1021__mantis9296.sql new file mode 100644 index 000000000..59ec583d1 --- /dev/null +++ b/src/db/migration/migration/V20170717_1021__mantis9296.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate + 'INSERT INTO TIPO_EVENTO_EXTRA_PTOVTA(TIPOEVENTOEXTRAPTOVTA_ID,TIPOEVENTOEXTRA_ID,PUNTOVENTA_ID,ACTIVO,FECMODIF,USUARIO_ID) + SELECT TIPOEVENTOEXTRAPTOVTA_SEQ.nextval, TIPOEVENTOEXTRA_ID, -1, 1, sysdate, 1 FROM TIPO_EVENTO_EXTRA'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170717_1500__mantis9294.sql b/src/db/migration/migration/V20170717_1500__mantis9294.sql new file mode 100644 index 000000000..ba894de4f --- /dev/null +++ b/src/db/migration/migration/V20170717_1500__mantis9294.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE REQUISICION_BOLETO ADD (USUARIOESTOQUE_ID NUMBER(7))'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ABASTO_BOLETO ADD (USUARIOESTOQUE_ID NUMBER(7))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170717_1830__mantis9183.sql b/src/db/migration/migration/V20170717_1830__mantis9183.sql new file mode 100644 index 000000000..b024944c2 --- /dev/null +++ b/src/db/migration/migration/V20170717_1830__mantis9183.sql @@ -0,0 +1,31 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE PTOVTA_CONTA + ( + PTOVTACONTA_ID NUMBER(7) NOT NULL, + EMPRESA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7), + CONTA_ID NUMBER(7), + PERCENTUAL NUMBER(5,2), + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (PTOVTACONTA_ID), + CONSTRAINT FK_PTOVTA_COMISSAO_CONTA FOREIGN KEY (CONTA_ID) REFERENCES MD_CONTA (CONTA_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE PTOVTACONTA_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170718_1910__mantis9150.sql b/src/db/migration/migration/V20170718_1910__mantis9150.sql new file mode 100644 index 000000000..46154228b --- /dev/null +++ b/src/db/migration/migration/V20170718_1910__mantis9150.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CORTE_TURNO ADD (IMPORTECOMISSAO NUMBER(12,2))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170719_1426__mantis9358.sql b/src/db/migration/migration/V20170719_1426__mantis9358.sql new file mode 100644 index 000000000..f536f76df --- /dev/null +++ b/src/db/migration/migration/V20170719_1426__mantis9358.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (CORPOLTRONA VARCHAR2(10))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170720_1055__mantis9107.sql b/src/db/migration/migration/V20170720_1055__mantis9107.sql new file mode 100644 index 000000000..408d31070 --- /dev/null +++ b/src/db/migration/migration/V20170720_1055__mantis9107.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,''1'',''VDA > VENDA >> ENTREGA PASSAGEM >>> UTILIZAR PTA BLOQUEADO'',''COM.RJCONSULTORES.VENTABOLETOS.ENTREGABOLETOS.UTILIZARPTABLOQUEADO'',''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170720_1504__mantis9292.sql b/src/db/migration/migration/V20170720_1504__mantis9292.sql new file mode 100644 index 000000000..20c448c4d --- /dev/null +++ b/src/db/migration/migration/V20170720_1504__mantis9292.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > RELATORIOS >> ESTORNO DE CARTAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOESTORNOCARTAO'',''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170720_1800__mantis9425.sql b/src/db/migration/migration/V20170720_1800__mantis9425.sql new file mode 100644 index 000000000..11fd5c7e2 --- /dev/null +++ b/src/db/migration/migration/V20170720_1800__mantis9425.sql @@ -0,0 +1,39 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE DADOS_ESTORNO_CARTAO add TIPOCARTAO VARCHAR2(66)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE DADOS_ESTORNO_CARTAO add CORRIDA_ID NUMBER(22)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE DADOS_ESTORNO_CARTAO add FECCORRIDA DATE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE DADOS_ESTORNO_CARTAO add PUNTOVENTA_ID NUMBER(22)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE DADOS_ESTORNO_CARTAO add MARCA_ID NUMBER(22)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170720_2033__mantis9287.sql b/src/db/migration/migration/V20170720_2033__mantis9287.sql new file mode 100644 index 000000000..b2f09846b --- /dev/null +++ b/src/db/migration/migration/V20170720_2033__mantis9287.sql @@ -0,0 +1,56 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE "FISCAL_IMPRESSORA_ESTADO" + ( + "FISCALIMPESTADO_ID" NUMBER(15,0) NOT NULL ENABLE, + "FISCALIMPRESSORA_ID" NUMBER(7,0) NOT NULL ENABLE, + "ESTADO_ID" NUMBER(7,0) NOT NULL ENABLE, + "ACTIVO" NUMBER(1,0), + "FECMODIF" DATE, + "USUARIO_ID" NUMBER(7,0), + CONSTRAINT "FISCAL_IMPRESSORA_ESTADO_PK" PRIMARY KEY ("FISCALIMPESTADO_ID") + )'; + + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE FISCAL_IMPRESSORA_ESTADO_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (ESTADOLACRE_ID NUMBER(7) )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (EMPRESA_ID NUMBER(7) )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (INDBLOQUEAECF NUMBER(7) )'; + exception when object_exists then null; +end; +/ + diff --git a/src/db/migration/migration/V20170721_1010__mantis9072.sql b/src/db/migration/migration/V20170721_1010__mantis9072.sql new file mode 100644 index 000000000..268374187 --- /dev/null +++ b/src/db/migration/migration/V20170721_1010__mantis9072.sql @@ -0,0 +1,23 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO PRICING_ESP_CANAL_VENTA pe + ( + pe.PRICINGESPCANAL_ID, + pe.TIPOPTOVTA_ID, + pe.PRICINGESPECIFICO_ID, + pe.ACTIVO, + pe.FECMODIF, + pe.USUARIO_ID + ) +SELECT PRICING_ESP_CANAL_SEQ.nextval , + p.TIPOPTOVTA_ID, + p.PRICINGESPECIFICO_ID, + 1, + sysdate, + 1 +FROM PRICING_ESPECIFICO p +WHERE ACTIVO=1'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170721_1416__mantis9287.sql b/src/db/migration/migration/V20170721_1416__mantis9287.sql new file mode 100644 index 000000000..44c02d632 --- /dev/null +++ b/src/db/migration/migration/V20170721_1416__mantis9287.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTADO ADD (DESCPROMOCIONAL1 VARCHAR2(46) )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTADO ADD (DESCPROMOCIONAL2 VARCHAR2(46) )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTADO ADD (DESCPROMOCIONAL3 VARCHAR2(46) )'; + exception when object_exists then null; +end; +/ + diff --git a/src/db/migration/migration/V20170721_1630__mantis9419.sql b/src/db/migration/migration/V20170721_1630__mantis9419.sql new file mode 100644 index 000000000..ef72c00db --- /dev/null +++ b/src/db/migration/migration/V20170721_1630__mantis9419.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ADM > PONTO DE VENDA >> COMISSAO >> CONTAS'', + ''COM.RJCONSULTORES.ADMINISTRACION.PUNTOVENTA.EDITARPORCENTAGEMCONTA'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170724_1056__mantis9366.sql b/src/db/migration/migration/V20170724_1056__mantis9366.sql new file mode 100644 index 000000000..f690daab7 --- /dev/null +++ b/src/db/migration/migration/V20170724_1056__mantis9366.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval, 1,''ADM > RELATORIOS >> RELATORIO FORMA PAGAMENTO AGENCIA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOFORMAPAGAMENTOAGENCIACONTROLLER'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170725_1343__mantis9359.sql b/src/db/migration/migration/V20170725_1343__mantis9359.sql new file mode 100644 index 000000000..531a16155 --- /dev/null +++ b/src/db/migration/migration/V20170725_1343__mantis9359.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval, 1,''ADM > RELATORIOS >> RELATORIO FINANCEIRO GRUPO LINHAS'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOFINANCEIROGRUPOLINHAS'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170725_1721__mantis9271.sql b/src/db/migration/migration/V20170725_1721__mantis9271.sql new file mode 100644 index 000000000..2a24a0c1f --- /dev/null +++ b/src/db/migration/migration/V20170725_1721__mantis9271.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into MOTIVO_REIMPRESION (MOTIVOREIMPRESION_ID,DESCMOTIVO,ACTIVO,FECMODIF,USUARIO_ID) values (''38'',''SOLICITACAO ESTORNO'',''1'',SYSDATE,''1'')'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20170726_1553__mantis9356.sql b/src/db/migration/migration/V20170726_1553__mantis9356.sql new file mode 100644 index 000000000..65e7609e5 --- /dev/null +++ b/src/db/migration/migration/V20170726_1553__mantis9356.sql @@ -0,0 +1,18 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table ocd add( NUMTARJETA VARCHAR2(48 BYTE), +NUMAUTORIZACION VARCHAR2(45 BYTE), +NSU VARCHAR2(18 BYTE))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table OCD_PARAM add INDOCDDINHEIRO number(1) default 1'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20170726_1920__mantis9287.sql b/src/db/migration/migration/V20170726_1920__mantis9287.sql new file mode 100644 index 000000000..43b7bddb4 --- /dev/null +++ b/src/db/migration/migration/V20170726_1920__mantis9287.sql @@ -0,0 +1,41 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (INDVALIDAESTADO NUMBER(1) DEFAULT 0 NOT NULL)'; + + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE FISCAL_IMPRESSORA SET INDBLOQUEAECF = 0 WHERE INDBLOQUEAECF IS NULL'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA MODIFY (INDBLOQUEAECF DEFAULT 0 NOT NULL)'; + + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; diff --git a/src/db/migration/migration/V20170727_1500__mantis9150.sql b/src/db/migration/migration/V20170727_1500__mantis9150.sql new file mode 100644 index 000000000..51c2f82f4 --- /dev/null +++ b/src/db/migration/migration/V20170727_1500__mantis9150.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EVENTO_EXTRA ADD (COO VARCHAR2(6))'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EVENTO_EXTRA ADD (GNF VARCHAR2(6))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170727_1520__mantis9457.sql b/src/db/migration/migration/V20170727_1520__mantis9457.sql new file mode 100644 index 000000000..6237cac2c --- /dev/null +++ b/src/db/migration/migration/V20170727_1520__mantis9457.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD(INDORGAOCONCEDENTETRANSF NUMBER(1,0) DEFAULT 1)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170727_1557__mantis9339.sql b/src/db/migration/migration/V20170727_1557__mantis9339.sql new file mode 100644 index 000000000..ad3df6992 --- /dev/null +++ b/src/db/migration/migration/V20170727_1557__mantis9339.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TRAMO ADD (CANTKMENTRADASAIDA NUMBER(7,2) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170727_1747__mantis9384.sql b/src/db/migration/migration/V20170727_1747__mantis9384.sql new file mode 100644 index 000000000..cf737a81c --- /dev/null +++ b/src/db/migration/migration/V20170727_1747__mantis9384.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ADM > RELATORIOS >> AIDF Detalhado'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOAIDFDETALHADO'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170729_1139__mantis9386.sql b/src/db/migration/migration/V20170729_1139__mantis9386.sql new file mode 100644 index 000000000..f595658a1 --- /dev/null +++ b/src/db/migration/migration/V20170729_1139__mantis9386.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate + 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> RELATORIO RDI'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.RELATORIORDI'',1,sysdate,-1)'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20170731_1130__mantis9150.sql b/src/db/migration/migration/V20170731_1130__mantis9150.sql new file mode 100644 index 000000000..778120214 --- /dev/null +++ b/src/db/migration/migration/V20170731_1130__mantis9150.sql @@ -0,0 +1,130 @@ +declare + except_04080 exception; + pragma exception_init (except_04080, -04080); +begin + execute immediate 'DROP TRIGGER TR_PAF_FISCAL_ML2'; + exception when except_04080 then null; +end; +/ +CREATE OR REPLACE TRIGGER TR_PAF_FISCAL_ML2 + before delete or insert or update on FISCAL_ML2 + REFERENCING NEW AS NEW OLD AS OLD + for each row + declare + impressora_id number; + + tipoReg varchar(2); + cnpjMatriz varchar(14); + ieEmpTransp varchar(14); + imEmpTransp varchar(14); + numSerie20 varchar(20); + mfAdicional varchar(1); + tipoEcf varchar(7); + marca varchar(20); + modelo varchar(20); + numUsuario varchar(2); + ccf varchar(6); --M + coo varchar(6); + gnf varchar(6); --L + grg varchar(6); --L + dataEmissao varchar(8); + horaEmissao varchar(6); + modalidade varchar(2); + categoria varchar(2); + identLinha varchar(8); + codOrigem varchar(20); + codDestino varchar(20); + tipoServico varchar(2); + dataViagem varchar(8); + horaViagem varchar(6); + tipoViagem varchar(2); + poltrona varchar(7); + plataforma varchar(15); + codDesconto varchar(8); + valorTarifa varchar(8); + aliquota varchar(4); --M + pedagio varchar(8); + taxaEmbarque varchar(8); + valorTotal varchar(8); + formaPago varchar(2); + valorPago varchar(8); + nomePassageiro varchar(50); + numDocIdentif varchar(40); + sac varchar(15); + agencia varchar(35); + + info varchar(433); + begin + impressora_id := 0; + + IF DELETING THEN + impressora_id := :OLD.fiscalimpressora_id; + ELSIF INSERTING THEN + impressora_id := :NEW.fiscalimpressora_id; + END IF; + + if user <> 'VTABOL' then + update punto_venta p set p.pafinvalido = 1 where p.puntoventa_id = (select puntoventa_id from fiscal_impressora where fiscalimpressora_id = impressora_id); + end if; + + if INSERTING or UPDATING then + tipoReg := nvl(:NEW.tipoReg, ''); + cnpjMatriz := nvl(:NEW.cnpjMatriz, ''); + ieEmpTransp := nvl(:NEW.ieEmpTransp, ''); + imEmpTransp := nvl(:NEW.imEmpTransp, ''); + numSerie20 := nvl(:NEW.numserie20, ''); + mfAdicional := nvl(:NEW.mfAdicional, ''); + tipoEcf := nvl(:NEW.tipoEcf, ''); + marca := nvl(:NEW.marca, ''); + modelo := nvl(:NEW.modelo, ''); + numUsuario := nvl(:NEW.numUsuario, ''); + coo := nvl(:NEW.coo, ''); + dataEmissao := nvl(:NEW.dataEmissao, ''); + horaEmissao := nvl(:NEW.horaEmissao, ''); + modalidade := nvl(:NEW.modalidade, ''); + categoria := nvl(:NEW.categoria, ''); + identLinha := nvl(:NEW.identLinha, ''); + codOrigem := nvl(:NEW.codOrigem, ''); + codDestino := nvl(:NEW.codDestino, ''); + tipoServico := nvl(:NEW.tipoServico, ''); + dataViagem := nvl(:NEW.dataViagem, ''); + horaViagem := nvl(:NEW.horaViagem, ''); + tipoViagem := nvl(:NEW.tipoViagem, ''); + poltrona := nvl(:NEW.poltrona, ''); + plataforma := nvl(:NEW.plataforma, ''); + codDesconto := nvl(:NEW.codDesconto, ''); + valorTarifa := nvl(:NEW.valorTarifa, ''); + pedagio := nvl(:NEW.pedagio, ''); + taxaEmbarque := nvl(:NEW.taxaEmbarque, ''); + valorTotal := nvl(:NEW.valorTotal, ''); + formaPago := nvl(:NEW.formaPago, ''); + valorPago := nvl(:NEW.valorPago, ''); + nomePassageiro := nvl(:NEW.nomePassageiro, ''); + numDocIdentif := nvl(:NEW.numDocIdentif, ''); + sac := nvl(:NEW.sac, ''); + agencia := nvl(:NEW.agencia, ''); + + if UPPER(tipoReg) = 'M2' then + ccf := nvl(:NEW.ccf, ''); + aliquota := nvl(:NEW.aliquota, ''); + gnf := ''; + grg := ''; + else + gnf := nvl(:NEW.gnf, ''); + grg := nvl(:NEW.grg, ''); + ccf := ''; + aliquota := ''; + end if; + + --info := tipoReg || cnpjMatriz || ieEmpTransp || imEmpTransp || numSerie20 || mfAdicional || tipoEcf || marca || modelo || numUsuario || ccf || coo || gnf || grg || dataEmissao || horaEmissao || modalidade || categoria || identLinha || codOrigem || codDestino || tipoServico || dataViagem || horaViagem || tipoViagem || poltrona || plataforma || codDesconto || valorTarifa || aliquota || pedagio || taxaEmbarque || valorTotal || formaPago || valorPago || nomePassageiro || numDocIdentif || sac || agencia; + --info := SYS.DBMS_CRYPTO.Hash (UTL_I18N.STRING_TO_RAW (info, 'AL32UTF8'), 2); + info := SYS.DBMS_CRYPTO.Hash (UTL_I18N.STRING_TO_RAW (tipoReg || cnpjMatriz || ieEmpTransp || imEmpTransp || numSerie20 || mfAdicional || tipoEcf || marca || modelo || numUsuario || ccf || coo || gnf || grg || dataEmissao || horaEmissao || modalidade || categoria || identLinha || codOrigem || codDestino || tipoServico || dataViagem || horaViagem || tipoViagem || poltrona || plataforma || codDesconto || valorTarifa || aliquota || pedagio || taxaEmbarque || valorTotal || formaPago || valorPago || nomePassageiro || numDocIdentif || sac || agencia, 'AL32UTF8'), 2); + + if user <> 'VTABOL' then + :NEW.hashbd := info; + else + :NEW.hashvta := SYS.DBMS_CRYPTO.Hash (UTL_I18N.STRING_TO_RAW ('RJA2014' || info, 'AL32UTF8'), 2); + :NEW.hashbd := info; + end if; + end if; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170801_1400__mantis9150.sql b/src/db/migration/migration/V20170801_1400__mantis9150.sql new file mode 100644 index 000000000..e4e13ce29 --- /dev/null +++ b/src/db/migration/migration/V20170801_1400__mantis9150.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD INDREPASSAUTR NUMBER(1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170801_1501__mantis9444.sql b/src/db/migration/migration/V20170801_1501__mantis9444.sql new file mode 100644 index 000000000..5031bfd85 --- /dev/null +++ b/src/db/migration/migration/V20170801_1501__mantis9444.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''HABILITAR FILTROS BUSCA/PAGAMENTO OCD'', ''COM.RJCONSULTORES.VENTABOLETOS.GUI.OCD'', 1, TO_DATE(current_date, ''YYYY-MM-DD HH24:MI:SS''), 1)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170802_1142__mantis9476.sql b/src/db/migration/migration/V20170802_1142__mantis9476.sql new file mode 100644 index 000000000..c9457beba --- /dev/null +++ b/src/db/migration/migration/V20170802_1142__mantis9476.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ADM > RELATORIOS >> VENDAS BILHETEIRO SINTETICO'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASBILHETEIROSINTETICO'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170802_1408__mantis9520.sql b/src/db/migration/migration/V20170802_1408__mantis9520.sql new file mode 100644 index 000000000..5745eaccf --- /dev/null +++ b/src/db/migration/migration/V20170802_1408__mantis9520.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD NUMASIENTOVINCULADO VARCHAR(12)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170803_1248__mantis7987.sql b/src/db/migration/migration/V20170803_1248__mantis7987.sql new file mode 100644 index 000000000..08cfe6eb8 --- /dev/null +++ b/src/db/migration/migration/V20170803_1248__mantis7987.sql @@ -0,0 +1,19 @@ +BEGIN + EXECUTE IMMEDIATE + 'ALTER TABLE TIPO_EVENTO_EXTRA ADD INDVALIDAESTOQUE NUMBER(1)'; + EXCEPTION + WHEN OTHERS THEN + IF sqlcode != -1430 + THEN + RAISE; + END IF; +END; +/ +BEGIN + EXECUTE IMMEDIATE 'UPDATE TIPO_EVENTO_EXTRA SET INDVALIDAESTOQUE = 0 WHERE INDVALIDAESTOQUE IS NULL'; + EXCEPTION + WHEN OTHERS THEN + IF sqlcode!=-904 THEN + RAISE; + END IF; +END; diff --git a/src/db/migration/migration/V20170804_0820__mantis9485.sql b/src/db/migration/migration/V20170804_0820__mantis9485.sql new file mode 100644 index 000000000..358eec65b --- /dev/null +++ b/src/db/migration/migration/V20170804_0820__mantis9485.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD INDUTILIZAICMS NUMBER(1) DEFAULT 1 NOT NULL'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170804_1620__mantis9360.sql b/src/db/migration/migration/V20170804_1620__mantis9360.sql new file mode 100644 index 000000000..038268512 --- /dev/null +++ b/src/db/migration/migration/V20170804_1620__mantis9360.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLIENTE MODIFY NOMBCLIENTE VARCHAR2(150)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170804_1622__mantis9360.sql b/src/db/migration/migration/V20170804_1622__mantis9360.sql new file mode 100644 index 000000000..3e7727e31 --- /dev/null +++ b/src/db/migration/migration/V20170804_1622__mantis9360.sql @@ -0,0 +1,2 @@ +update CLIENTE cli set NOMBCLIENTE= CONCAT(CONCAT(CONCAT(CONCAT(NOMBCLIENTE,' '),APELLIDOMATERNO),' '),APELLIDOPATERNO) WHERE + (SELECT length(NOMBCLIENTE)-length(replace(NOMBCLIENTE, ' ', '')) from CLIENTE WHERE cli.CLIENTE_ID=CLIENTE_ID)=0; \ No newline at end of file diff --git a/src/db/migration/migration/V20170807_1145__mantis9339.sql b/src/db/migration/migration/V20170807_1145__mantis9339.sql new file mode 100644 index 000000000..7c052a9a6 --- /dev/null +++ b/src/db/migration/migration/V20170807_1145__mantis9339.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA_SECUENCIA ADD (KMORIGINAL NUMBER(7,2) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170807_1439__mantis9339.sql b/src/db/migration/migration/V20170807_1439__mantis9339.sql new file mode 100644 index 000000000..c94f76b92 --- /dev/null +++ b/src/db/migration/migration/V20170807_1439__mantis9339.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update ruta_secuencia r set r.kmoriginal = COALESCE((select t.cantkmreal - coalesce(t.cantkmentradasaida,0) from tramo t where t.tramo_id = r.tramo_id), 0)'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170808_1901__mantis9449.sql b/src/db/migration/migration/V20170808_1901__mantis9449.sql new file mode 100644 index 000000000..e97d76a4d --- /dev/null +++ b/src/db/migration/migration/V20170808_1901__mantis9449.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO, + FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1,''ADM > RELATORIOS >> CANCELAMENTO AUTOMATICO ECF'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOCANCELAMENTOAUTOMATICOECF'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170809_1658__mantis9069.sql b/src/db/migration/migration/V20170809_1658__mantis9069.sql new file mode 100644 index 000000000..2682693d2 --- /dev/null +++ b/src/db/migration/migration/V20170809_1658__mantis9069.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA ADD (DESCPROCON VARCHAR2(48))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170809_1905__mantis9578.sql b/src/db/migration/migration/V20170809_1905__mantis9578.sql new file mode 100644 index 000000000..7e5355c5d --- /dev/null +++ b/src/db/migration/migration/V20170809_1905__mantis9578.sql @@ -0,0 +1,6 @@ +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''27'',''AGERBA'',''0'',''0'',to_date(''07-10-2015 11:17:03'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',''1'',''60'',null,null,null)'; +exception + when others + then null; +end; diff --git a/src/db/migration/migration/V20170810_1119__mantis9523.sql b/src/db/migration/migration/V20170810_1119__mantis9523.sql new file mode 100644 index 000000000..e85291ca7 --- /dev/null +++ b/src/db/migration/migration/V20170810_1119__mantis9523.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE SECRETARIA ADD (INDVOUCHERROD NUMBER(1) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170811_0811__mantis10022.sql b/src/db/migration/migration/V20170811_0811__mantis10022.sql new file mode 100644 index 000000000..f01203055 --- /dev/null +++ b/src/db/migration/migration/V20170811_0811__mantis10022.sql @@ -0,0 +1,9 @@ +declare +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''PERMITE ENCERRAR CHECKIN'', +''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUCHECKIN.ENCERRARCHECKIN'', +''1'',to_date(''15/04/16'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170811_1017__mantis9451.sql b/src/db/migration/migration/V20170811_1017__mantis9451.sql new file mode 100644 index 000000000..e45736d9a --- /dev/null +++ b/src/db/migration/migration/V20170811_1017__mantis9451.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIO >> FINANCEIRO >>> VENDA PTA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASPTA'',1,sysdate,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170811_1625__mantis9523.sql b/src/db/migration/migration/V20170811_1625__mantis9523.sql new file mode 100644 index 000000000..c5c39e754 --- /dev/null +++ b/src/db/migration/migration/V20170811_1625__mantis9523.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FORMA_PAGO values (38, ''VOUCHER ROD'', null,1,sysdate,1, null,''VR'',null, 0,null)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170814_1557__mantis9523.sql b/src/db/migration/migration/V20170814_1557__mantis9523.sql new file mode 100644 index 000000000..6c174fcf7 --- /dev/null +++ b/src/db/migration/migration/V20170814_1557__mantis9523.sql @@ -0,0 +1,37 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD (CVESISTEMA VARCHAR2(255) )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_BOLETO_ABIERTO'' WHERE FORMAPAGO_ID = 9'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_CORTESIA'' WHERE FORMAPAGO_ID = 5'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_CREDITO'' WHERE FORMAPAGO_ID = 2'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_CHEQUE'' WHERE FORMAPAGO_ID = 13'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_CUPON_IMSS'' WHERE FORMAPAGO_ID = 6'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_CUPONES'' WHERE FORMAPAGO_ID = 7'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_DEBITO'' WHERE FORMAPAGO_ID = 3'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_DOLAR'' WHERE FORMAPAGO_ID = 8'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_EFECTIVO'' WHERE FORMAPAGO_ID = 1'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_EFECTIVO_TIEMPOAIRE'' WHERE FORMAPAGO_ID = 3'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_EXTRAVIADO'' WHERE FORMAPAGO_ID = 4'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_ORDEN_SERVICIO'' WHERE FORMAPAGO_ID = 11'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_VOUCHER_ROD'' WHERE FORMAPAGO_ID = 41'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_REIMPRESION'' WHERE FORMAPAGO_ID = 96'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_SENDA_AMIGO'' WHERE FORMAPAGO_ID = 7'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_TRANSF_TARJETA'' WHERE FORMAPAGO_ID = 16'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_TRANSFERENCIA'' WHERE FORMAPAGO_ID = 10'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_REDEPAGOS'' WHERE FORMAPAGO_ID = 95'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_RESERVA'' WHERE FORMAPAGO_ID = 94'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_NOTA_CREDITO'' WHERE FORMAPAGO_ID = 93'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_PACOTE'' WHERE FORMAPAGO_ID = 92'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_GERACAO_OCD'' WHERE FORMAPAGO_ID = 35'; + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_CARTAO_RIOCARD'' WHERE FORMAPAGO_ID = 37'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170814_1600__mantis9361.sql b/src/db/migration/migration/V20170814_1600__mantis9361.sql new file mode 100644 index 000000000..61962070b --- /dev/null +++ b/src/db/migration/migration/V20170814_1600__mantis9361.sql @@ -0,0 +1,10 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CONTA_CORRENTE_PTOVTA ADD ( + IMPORTETOTALDEBITO NUMBER(12,2), + IMPORTETOTALCREDITO NUMBER(12,2) + )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170817_1050__mantis9523.sql b/src/db/migration/migration/V20170817_1050__mantis9523.sql new file mode 100644 index 000000000..5aa78845c --- /dev/null +++ b/src/db/migration/migration/V20170817_1050__mantis9523.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE FORMA_PAGO SET fecmodif = sysdate WHERE cvesistema is not null'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170817_1649__mantis9452.sql b/src/db/migration/migration/V20170817_1649__mantis9452.sql new file mode 100644 index 000000000..02cc8219d --- /dev/null +++ b/src/db/migration/migration/V20170817_1649__mantis9452.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> SERVI�O BLOQUEADO NA VENDA INTERNET'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOSERVICOBLOQUEADOVENDAINTERNET'',1,sysdate,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170817_1810__mantis9347.sql b/src/db/migration/migration/V20170817_1810__mantis9347.sql new file mode 100644 index 000000000..ed435a1b4 --- /dev/null +++ b/src/db/migration/migration/V20170817_1810__mantis9347.sql @@ -0,0 +1,124 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE MENSAGEM_RECUSA( + MENSAGEMRECUSA_ID NUMBER(7,0), + TIPO_MENSAGEM VARCHAR(1), + CATEGORIA_ID NUMBER(7,0), + DESCRICAO VARCHAR(250), + ACTIVO NUMBER(1,0), + USUARIO_ID NUMBER(7,0), + FECMODIF DATE, + TIPO_RELATORIO NUMBER(1,0), + CONSTRAINT MENSAGEM_RECUSA_PK PRIMARY KEY (MENSAGEMRECUSA_ID), + CONSTRAINT MENSAGEM_RECUSA_CATEGORIA FOREIGN KEY(CATEGORIA_ID) REFERENCES CATEGORIA(CATEGORIA_ID), + CONSTRAINT MENSAGEM_RECUSA_USUARIO FOREIGN KEY(USUARIO_ID) REFERENCES USUARIO(USUARIO_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE RECUSA( + RECUSA_ID NUMBER(7,0), + EMPRESA_ID NUMBER(7,0), + RUTA_ID NUMBER(7,0), + FECEMISSAO DATE, + CORRIDA_ID NUMBER(7,0), + FECCORRIDA DATE, + ORIGEM_ID NUMBER(7,0), + DESTINO_ID NUMBER(7,0), + CATEGORIA_ID NUMBER(7,0), + CLASESERVICIO_ID NUMBER(7,0), + USUARIO_ID NUMBER(7,0), + FECMODIF DATE, + ACTIVO NUMBER(1,0), + FECRECUSA DATE, + PUNTOVENTA_ID NUMBER(7,0), + CONSTRAINT RECUSA_PK PRIMARY KEY (RECUSA_ID), + CONSTRAINT RECUSA_EMPRESA FOREIGN KEY(EMPRESA_ID) REFERENCES EMPRESA(EMPRESA_ID), + CONSTRAINT RECUSA_RUTA FOREIGN KEY(RUTA_ID) REFERENCES RUTA(RUTA_ID), + CONSTRAINT RECUSA_CORRIDA FOREIGN KEY (CORRIDA_ID,FECCORRIDA) REFERENCES CORRIDA(CORRIDA_ID,FECCORRIDA), + CONSTRAINT RECUSA_ORIGEM FOREIGN KEY (ORIGEM_ID) REFERENCES PARADA(PARADA_ID), + CONSTRAINT RECUSA_DESTINO FOREIGN KEY (DESTINO_ID) REFERENCES PARADA(PARADA_ID), + CONSTRAINT RECUSA_CATEGORIA FOREIGN KEY (CATEGORIA_ID) REFERENCES CATEGORIA(CATEGORIA_ID), + CONSTRAINT RECUSA_CLASSESERVICIO FOREIGN KEY (CLASESERVICIO_ID) REFERENCES CLASE_SERVICIO(CLASESERVICIO_ID), + CONSTRAINT RECUSA_USUARIO FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO(USUARIO_ID), + CONSTRAINT RECUSA_PUNTOVENTA FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA(PUNTOVENTA_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE MENSAGEM_RECUSA_RECUSA( + MENSAGEMRECUSA_ID NUMBER(7,0), + RECUSA_ID NUMBER(7,0), + CONSTRAINT MRR_MENSAGEMRECUSA FOREIGN KEY(MENSAGEMRECUSA_ID) REFERENCES MENSAGEM_RECUSA(MENSAGEMRECUSA_ID), + CONSTRAINT MRR_RECUSA FOREIGN KEY(RECUSA_ID) REFERENCES RECUSA(RECUSA_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE MENSAGEM_RECUSA_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE RECUSA_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''O Idoso n�o apresentou qualquer documento pessoal com foto original, com f� p�blica que comprove idade m�nima de 60 (sessenta) anos e/ou comprovante de renda igual ou inferior a 02 (dois) sal�rios m�nimos'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''No momento da solicita��o do benef�cio (100% de desconto) as 02 (duas) vagas estavam preenchidas'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''O idoso recusou o benef�cio de bilhete com 50% de desconto'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''No momento da solicita��o do benef�cio (50% de desconto) n�o havia poltrona dispon�vel (�nibus lotado), tendo sido oferecido outro hor�rio do servi�o convencional'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''A pessoa portadora de defici�ncia n�o apresentou a carteira do Passe Livre emitida pelo Governo Federal'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''A pessoa portadora de defici�ncia apresentou a carteira do Passe Livre emitida pelo Governo Federal com prazo de validade vencido'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''No momento da solicita��o do benef�cio n�o havia poltrona dispon�vel (�nibus lotado), tendo sido oferecido outro hor�rio do servi�o convencional'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''O Jovem n�o apresentou a Identidade Jovem dentro do prazo de validade, acompanhada de documento de identifica��o com foto expedido por �rg�o p�blico e v�lido em todo territ�rio nacional'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''No momento da solicita��o do benef�cio (100% de desconto) as 02 (duas) vagas estavam preenchidas'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''O Jovem recusou o benef�cio de bilhete com 50% de desconto'' + ,1,1,sysdate)'; + execute immediate 'INSERT INTO MENSAGEM_RECUSA(MENSAGEMRECUSA_ID,TIPO_MENSAGEM,DESCRICAO,ACTIVO,USUARIO_ID,FECMODIF) + VALUES (MENSAGEM_RECUSA_SEQ.nextVal,''R'',''No momento da solicita��o do benef�cio (50% de desconto) as 02 (duas) vagas estavam preenchidas'' + ,1,1,sysdate)'; + + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170817_1910__mantis9347_2.sql b/src/db/migration/migration/V20170817_1910__mantis9347_2.sql new file mode 100644 index 000000000..405a81b37 --- /dev/null +++ b/src/db/migration/migration/V20170817_1910__mantis9347_2.sql @@ -0,0 +1,8 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > CATALOGO >> MENSAGEM RECUSA'', +''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.MENSAGEMRECUSA'', +''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170818_0901__mantis9608.sql b/src/db/migration/migration/V20170818_0901__mantis9608.sql new file mode 100644 index 000000000..032357c22 --- /dev/null +++ b/src/db/migration/migration/V20170818_0901__mantis9608.sql @@ -0,0 +1,37 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE FOLIO_CONSUMO_RMD + ( + FOLIOCONSUMORMD_ID NUMBER(7,0) NOT NULL ENABLE, + RMD_ID NUMBER(7,0), + FOLIO VARCHAR2(20 BYTE), + EMPRESA_ID NUMBER(7,0), + ESTADO_ID NUMBER(7,0), + INDCANCELACION NUMBER(1,0), + INDINACTIVO NUMBER(1,0), + FECHORFOLIO DATE, + INDECF NUMBER(1,0), + INDBPR NUMBER(1,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT FOLIO_CONSUMO_RMD_PK PRIMARY KEY (FOLIOCONSUMORMD_ID) ENABLE , + CONSTRAINT FK_RMD_EMPRESA FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA (EMPRESA_ID) ENABLE, + CONSTRAINT FK_RMD_AIDF FOREIGN KEY (RMD_ID) REFERENCES AIDF (AIDF_ID) ENABLE, + CONSTRAINT FK_RMD_ESTADO FOREIGN KEY (ESTADO_ID) REFERENCES ESTADO (ESTADO_ID) ENABLE + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE FOLIO_CONSUMO_RMD_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170818_1100__mantis9348_3.sql b/src/db/migration/migration/V20170818_1100__mantis9348_3.sql new file mode 100644 index 000000000..8a1b0f62a --- /dev/null +++ b/src/db/migration/migration/V20170818_1100__mantis9348_3.sql @@ -0,0 +1,12 @@ +declare +begin + execute immediate 'UPDATE MENSAGEM_RECUSA SET CATEGORIA_ID = (SELECT MIN(CATEGORIA_ID) FROM CATEGORIA)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'UPDATE MENSAGEM_RECUSA SET TIPO_RELATORIO = 1'; + exception when others then null; +end; +/ diff --git a/src/db/migration/migration/V20170820_1346__mantis9389.sql b/src/db/migration/migration/V20170820_1346__mantis9389.sql new file mode 100644 index 000000000..ce741713c --- /dev/null +++ b/src/db/migration/migration/V20170820_1346__mantis9389.sql @@ -0,0 +1,8 @@ +declare +begin + execute immediate + 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> RELATORIOS FINANCEIROS '',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.RELATORIOSFINANCEIROS'',1,sysdate,-1)'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20170820_1816__mantis9348_4_2.sql b/src/db/migration/migration/V20170820_1816__mantis9348_4_2.sql new file mode 100644 index 000000000..7e6af763e --- /dev/null +++ b/src/db/migration/migration/V20170820_1816__mantis9348_4_2.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_00904 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00904 , -00904); +begin + execute immediate 'ALTER TABLE MENSAGEM_RECUSA DROP COLUMN TIPO_RELATORIO'; + + exception + when object_exists then null; + when except_00904 then null; +end; diff --git a/src/db/migration/migration/V20170823_1024__mantis9447.sql b/src/db/migration/migration/V20170823_1024__mantis9447.sql new file mode 100644 index 000000000..4eec85390 --- /dev/null +++ b/src/db/migration/migration/V20170823_1024__mantis9447.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> OPERACIONAIS >>REMARCA��O DE PASSAGENS TRANSFER�NCIA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOREMARCACAOPASSAGENSTRANSFERENCIA'',1,sysdate,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170823_1535__mantis9608.sql b/src/db/migration/migration/V20170823_1535__mantis9608.sql new file mode 100644 index 000000000..201b8db1e --- /dev/null +++ b/src/db/migration/migration/V20170823_1535__mantis9608.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FOLIO_CONSUMO_RMD ADD (INDIMPRESSO NUMBER(1) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170824_1626__mantis9525.sql b/src/db/migration/migration/V20170824_1626__mantis9525.sql new file mode 100644 index 000000000..d301ba2d5 --- /dev/null +++ b/src/db/migration/migration/V20170824_1626__mantis9525.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (CLIENTECOMPRADOR_ID NUMBER(7) )'; + exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20170825_1347__mantis9608.sql b/src/db/migration/migration/V20170825_1347__mantis9608.sql new file mode 100644 index 000000000..4d6e031fc --- /dev/null +++ b/src/db/migration/migration/V20170825_1347__mantis9608.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FOLIO_CONSUMO_RMD ADD ( + VALORCONTABIL NUMBER(16,2), + BASECALCULO NUMBER(16,2), + ALIQUOTA NUMBER(16,2), + ISENTOS NUMBER(16,2), + OUTROS NUMBER(16,2), + ICMS NUMBER(16,2))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170825_1416__mantis9525.sql b/src/db/migration/migration/V20170825_1416__mantis9525.sql new file mode 100644 index 000000000..8ed194bc1 --- /dev/null +++ b/src/db/migration/migration/V20170825_1416__mantis9525.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (CLIENTECOMPRADOR_ID NUMBER(7))'; + exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20170825_1559__mantis9525.sql b/src/db/migration/migration/V20170825_1559__mantis9525.sql new file mode 100644 index 000000000..0c86aef07 --- /dev/null +++ b/src/db/migration/migration/V20170825_1559__mantis9525.sql @@ -0,0 +1,9 @@ +declare +begin + execute immediate + 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values + (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''VDA > GRC >> CLIENTE COMPRADOR'',''VDA.GRC.CLIENTECOMPRADOR'',''1'',sysdate,''1'')'; + exception when others then null; +end; + + diff --git a/src/db/migration/migration/V20170825_1740__mantis9709.sql b/src/db/migration/migration/V20170825_1740__mantis9709.sql new file mode 100644 index 000000000..1067f4bee --- /dev/null +++ b/src/db/migration/migration/V20170825_1740__mantis9709.sql @@ -0,0 +1,9 @@ + +declare +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.NEXTVAL, 1, ''ADM > RELATORIOS >> BILHETES VENDIDOS'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOBILHETESVENDIDOS'', 1, sysdate, 1)'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20170826_1017__mantis9347.sql b/src/db/migration/migration/V20170826_1017__mantis9347.sql new file mode 100644 index 000000000..5a2a5d11a --- /dev/null +++ b/src/db/migration/migration/V20170826_1017__mantis9347.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate + 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_seq.nextval,''2'',''VDA > VENDA >> TERMO RECUSA COMPLETO'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.TERMODERECUSACOMPLETO'',''1'',null,''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170826_1604__mantis9686.sql b/src/db/migration/migration/V20170826_1604__mantis9686.sql new file mode 100644 index 000000000..e10360080 --- /dev/null +++ b/src/db/migration/migration/V20170826_1604__mantis9686.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''REMARCACAO_GERAR_NUMFOLIOSISTEMA'',''REMARCACAO_GERAR_NUMFOLIOSISTEMA'',''1'',''false'',''1'',''1'',sysdate,''1'')'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20170826_1700__mantis9608.sql b/src/db/migration/migration/V20170826_1700__mantis9608.sql new file mode 100644 index 000000000..ed7fb3c2e --- /dev/null +++ b/src/db/migration/migration/V20170826_1700__mantis9608.sql @@ -0,0 +1,17 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (FOLIORMD VARCHAR2(20))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (RMD_ID NUMBER(15))'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20170828_1816__mantis9388.sql b/src/db/migration/migration/V20170828_1816__mantis9388.sql new file mode 100644 index 000000000..a0161d635 --- /dev/null +++ b/src/db/migration/migration/V20170828_1816__mantis9388.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> FINANCEIRO >>DOCUMENTOS FISCAIS'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIODOCUMENTOSFISCAIS'',1,sysdate,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170831_1815__mantis9752.sql b/src/db/migration/migration/V20170831_1815__mantis9752.sql new file mode 100644 index 000000000..a998f064b --- /dev/null +++ b/src/db/migration/migration/V20170831_1815__mantis9752.sql @@ -0,0 +1,25 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (CRO VARCHAR2(4))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (CRO VARCHAR2(4))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EVENTO_EXTRA ADD (CRO VARCHAR2(4))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170901_1356__mantis9448.sql b/src/db/migration/migration/V20170901_1356__mantis9448.sql new file mode 100644 index 000000000..8edc2f023 --- /dev/null +++ b/src/db/migration/migration/V20170901_1356__mantis9448.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIO >> FINANCEIRO >>> VENDAS COM PARCELAMENTO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASPARCELAMENTO'',1,sysdate,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170904_1433__mantis9746.sql b/src/db/migration/migration/V20170904_1433__mantis9746.sql new file mode 100644 index 000000000..270884eca --- /dev/null +++ b/src/db/migration/migration/V20170904_1433__mantis9746.sql @@ -0,0 +1,8 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > RELATORIOS >> Segunda Via'', +''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOSEGUNDAVIA'', +''1'',to_date(''23/08/17'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170904_1434__mantis9746_2.sql b/src/db/migration/migration/V20170904_1434__mantis9746_2.sql new file mode 100644 index 000000000..b2771f4e9 --- /dev/null +++ b/src/db/migration/migration/V20170904_1434__mantis9746_2.sql @@ -0,0 +1,13 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD FECSEGUNDAVIA DATE'; + exception when column_exists then null; +end; +/ +declare +begin + execute immediate 'UPDATE BOLETO SET FECSEGUNDAVIA = FECMODIF WHERE INDSEGUNDAVIAIMPRESSA = 1'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170905_2019__mantis9781.sql b/src/db/migration/migration/V20170905_2019__mantis9781.sql new file mode 100644 index 000000000..20fb5f590 --- /dev/null +++ b/src/db/migration/migration/V20170905_2019__mantis9781.sql @@ -0,0 +1,125 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (RECEITA_EXCESSOBAGAGEM NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (RECEITA_SEGUROOPCIONAL NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (DESCONTOS_FIXOS NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (DESCONTOS_EVENTUAIS NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (ROYATIES NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (ISS_RETIDO NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (BONIFICACAO_METAS NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (ENTREGAS_PASSAGEM NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (RECEITA_BPR NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (DEVOLVIDOS NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (RECEITA_BRUTA_EXCESSOBAGAGEM NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (RECEITA_BRUTA_SEGUROOPCIONAL NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (RECEITA_OUTROS NUMBER(12,2))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO MODIFY (COMISSAO_BPR NUMBER(12,2))'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20170906_1140__mantis9716.sql b/src/db/migration/migration/V20170906_1140__mantis9716.sql new file mode 100644 index 000000000..287bfed6d --- /dev/null +++ b/src/db/migration/migration/V20170906_1140__mantis9716.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,EQUIVALENCIAELEKTRA_ID,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO) values (90,''BOLETO CANC. AUTOMATICAMENTE'',''B'',null,null,''1'',sysdate,''1'',null)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170907_1200__mantis9647.sql b/src/db/migration/migration/V20170907_1200__mantis9647.sql new file mode 100644 index 000000000..a021769ca --- /dev/null +++ b/src/db/migration/migration/V20170907_1200__mantis9647.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE AIDF add PUNTOVENTA_ID NUMBER(7)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170911_0937__mantis9450.sql b/src/db/migration/migration/V20170911_0937__mantis9450.sql new file mode 100644 index 000000000..4c1702b08 --- /dev/null +++ b/src/db/migration/migration/V20170911_0937__mantis9450.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIO >> IMPRESS�O POSTERIOR'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOIMPRESSAOPOSTERIOR'',1,sysdate,1)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170911_1230__mantis9792.sql b/src/db/migration/migration/V20170911_1230__mantis9792.sql new file mode 100644 index 000000000..24cbe61b7 --- /dev/null +++ b/src/db/migration/migration/V20170911_1230__mantis9792.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION add INDSTOCKCENTRAL NUMBER(1)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION_IMPRESORA add ESTACIONCENTRAL_ID NUMBER(7)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FOLIO_PREIMPRESO add CONFIRMANDO NUMBER(7)'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20170911_1505__mantis9798.sql b/src/db/migration/migration/V20170911_1505__mantis9798.sql new file mode 100644 index 000000000..0752275b4 --- /dev/null +++ b/src/db/migration/migration/V20170911_1505__mantis9798.sql @@ -0,0 +1,20 @@ +--drop constraint se existe +DECLARE + itemExists NUMBER; +BEGIN + itemExists := 0; + + SELECT COUNT(CONSTRAINT_NAME) INTO itemExists + FROM ALL_CONSTRAINTS + WHERE UPPER(CONSTRAINT_NAME) = UPPER('PRECIO_VENTAJA__UN'); + + IF itemExists > 0 THEN + begin + EXECUTE IMMEDIATE 'ALTER TABLE PRECIO_VENTAJA DROP CONSTRAINT PRECIO_VENTAJA__UN'; + EXECUTE IMMEDIATE 'drop index PRECIO_VENTAJA__UN'; + + exception when others then null; + end; + END IF; + +END; \ No newline at end of file diff --git a/src/db/migration/migration/V20170912_1805__mantis9687.sql b/src/db/migration/migration/V20170912_1805__mantis9687.sql new file mode 100644 index 000000000..fcf06ec21 --- /dev/null +++ b/src/db/migration/migration/V20170912_1805__mantis9687.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''IS_ARREDONDAMENTO_TARIFA'',''IS_ARREDONDAMENTO_TARIFA'',''1'',''false'',''1'',''1'',sysdate,''1'')'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20170913_1116__mantis9796.sql b/src/db/migration/migration/V20170913_1116__mantis9796.sql new file mode 100644 index 000000000..33c489a8b --- /dev/null +++ b/src/db/migration/migration/V20170913_1116__mantis9796.sql @@ -0,0 +1,25 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AIDF ADD (PUNTOVENTA_ID NUMBER(7))'; + exception when column_exists then null; +end; + +/ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); +begin + execute immediate 'ALTER TABLE AIDF ADD CONSTRAINT PUNTOVENTA_AIDF FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) ENABLE'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; +end; diff --git a/src/db/migration/migration/V20170914_1846__mantis9091.sql b/src/db/migration/migration/V20170914_1846__mantis9091.sql new file mode 100644 index 000000000..6edfa1cfe --- /dev/null +++ b/src/db/migration/migration/V20170914_1846__mantis9091.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TIPO_EVENTO_EXTRA MODIFY(DESCTIPOEVENTO VARCHAR2(50), CVESISTEMA VARCHAR2(50))'; + exception when column_exists then null; +end; +/ +declare +begin + execute immediate 'alter session set nls_numeric_characters = '',.'' '; + execute immediate 'Insert into TIPO_EVENTO_EXTRA (TIPOEVENTOEXTRA_ID,PARAMARTICULO_ID,INDTIPO,IMPMAX,INDVALIDACORTE,INDVALIDADOCUMENTO,INDCONTRAPARTIDA,INDBOLETO,INDORDENSERVICIO,PORCIVA,FORMAPAGO_ID,USUARIO_ID,FECMODIF,ACTIVO,PARAMARTICULO2_ID,INDTIPO2,FORMAPAGO2_ID,INDOPERACION,DESCTIPOEVENTO,PROVEEDOR,IMPFISCALNUMOPERACAO,NATUREZA,CONTACONTABIL,INDCONFERENCIAFISICACOMISSAO,CVETIPOEVENTO,CVESISTEMA) +values (TIPO_EVENTO_EXTRA_SEQ.nextval,null,''0'',''99999,99'',null,''0'',null,''0'',null,''0'',null,''1'',sysdate,''1'',null,null,null,''1'',''TAXA DE CONVENIENCIA TARIFA CANCELADA'',null,null,''DESPESA'',null,null,null,''TAXA_CONVENIENCIA_TARIFA_CANCELADA'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170915_1846__subserieFiscalM61.sql b/src/db/migration/migration/V20170915_1846__subserieFiscalM61.sql new file mode 100644 index 000000000..c6ab29f68 --- /dev/null +++ b/src/db/migration/migration/V20170915_1846__subserieFiscalM61.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table FISCALM_61 modify subserie varchar2(6)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170918_1858__mantis9614.sql b/src/db/migration/migration/V20170918_1858__mantis9614.sql new file mode 100644 index 000000000..8af8646f7 --- /dev/null +++ b/src/db/migration/migration/V20170918_1858__mantis9614.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDUTILIZAFIDELIDADE NUMBER(1,0) DEFAULT 0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20170918_2217__mantis9842.sql b/src/db/migration/migration/V20170918_2217__mantis9842.sql new file mode 100644 index 000000000..916347a5c --- /dev/null +++ b/src/db/migration/migration/V20170918_2217__mantis9842.sql @@ -0,0 +1,15 @@ +declare +begin + execute immediate + 'update + esquema_corrida ec + + set ec.ROLOPERATIVO_ID = (select ec2.ROLOPERATIVO2_ID from esquema_corrida ec2 where ec2.activo =1 and ec2.NUMCORRIDAPISOEXTRA= ec.numcorrida and ec2.indpisoextra =1) + where + (ec.NUMCORRIDAPISOEXTRA is null) + and exists (select * from esquema_corrida ec3 where ec3.activo = 1 and ec3.NUMCORRIDAPISOEXTRA = ec.numcorrida) + and ec.ROLOPERATIVO_ID <> (select ec4.ROLOPERATIVO2_ID from esquema_corrida ec4 where ec4.activo =1 and ec4.NUMCORRIDAPISOEXTRA = ec.numcorrida ) + and activo = 1'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20170919_1457__mantis9615.sql b/src/db/migration/migration/V20170919_1457__mantis9615.sql new file mode 100644 index 000000000..9f25f677b --- /dev/null +++ b/src/db/migration/migration/V20170919_1457__mantis9615.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''URL_WS_FIDELIDADE'',''URL de chamada do projeto Fidelidade'',''1'',''http://ipws:porta'',''1'',''1'',sysdate,''1'')'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20170920_1656__mantis9472.sql b/src/db/migration/migration/V20170920_1656__mantis9472.sql new file mode 100644 index 000000000..5520b2a8c --- /dev/null +++ b/src/db/migration/migration/V20170920_1656__mantis9472.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CLIENTE_DESCUENTO ADD (INDVENDER1PORCORRIDA NUMBER(1) DEFAULT 0 NOT NULL )'; + exception when object_exists then null; +end; +/ +declare +begin + execute immediate 'UPDATE CLIENTE_DESCUENTO SET INDVENDER1PORCORRIDA = 0'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170921_1719__mantis9407.sql b/src/db/migration/migration/V20170921_1719__mantis9407.sql new file mode 100644 index 000000000..758d37c14 --- /dev/null +++ b/src/db/migration/migration/V20170921_1719__mantis9407.sql @@ -0,0 +1,10 @@ +declare +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''REMOVER LIMITE PESQUISA RELATORIO TIPO 2 CONTA CORRENTE'', + ''REMOVER_LIMITE_TIPO_2'', + ''1'',to_date(''21/09/16'',''DD/MM/RR''),''1'')'; + + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170921_2014__mantis9716.sql b/src/db/migration/migration/V20170921_2014__mantis9716.sql new file mode 100644 index 000000000..5a32e37bf --- /dev/null +++ b/src/db/migration/migration/V20170921_2014__mantis9716.sql @@ -0,0 +1,35 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MOTIVO_CANCELACION ADD( CVESISTEMA VARCHAR2(30))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'alter table MOTIVO_CANCELACION add constraint mc_uniq_cvesistema unique("CVESISTEMA")'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; +/ +declare +begin + execute immediate 'alter session set nls_numeric_characters = '',.'' '; + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,ACTIVO,FECMODIF,USUARIO_ID,CVESISTEMA) +values (MOTIVO_CANCELACION_SEQ.nextval,''CANCELAMENTO ECF'',''B'',1,sysdate,1,''CANCELAMENTO_ECF'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20170926_1340__mantis8561.sql b/src/db/migration/migration/V20170926_1340__mantis8561.sql new file mode 100644 index 000000000..2d9687de4 --- /dev/null +++ b/src/db/migration/migration/V20170926_1340__mantis8561.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,1, ''PERMITIR LANCAMENTO CONTA CORRENTE'', ''COM.RJCONSULTORES.VENTABOLETOS.CONTACORRENTEAGENCIA.LANCAMENTOS'', 1, sysdate, 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170926_2100__mantis9100.sql b/src/db/migration/migration/V20170926_2100__mantis9100.sql new file mode 100644 index 000000000..02eca20aa --- /dev/null +++ b/src/db/migration/migration/V20170926_2100__mantis9100.sql @@ -0,0 +1,23 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_PARAMGERAL ADD (COUNT_REMESSA NUMBER(15), COD_EMP_BANCO NUMBER(20))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_BOLETO ADD (REMESSA_ID NUMBER(20))'; + exception when column_exists then null; +end; +/ +declare + +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.NEXTVAL, 1, ''ADM > RELATORIOS >> RELATORIO DE ARQUIVO REMESSA CNAB'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOREMESSACNAB'', 1 , sysdate, 1 )'; + exception when others then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20170927_0900__mantis9790.sql b/src/db/migration/migration/V20170927_0900__mantis9790.sql new file mode 100644 index 000000000..c1ccde6a6 --- /dev/null +++ b/src/db/migration/migration/V20170927_0900__mantis9790.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_SEGURO add INDPERMISOTASAEMBARQVTAAGEN NUMBER(1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170927_1035__mantis9556.sql b/src/db/migration/migration/V20170927_1035__mantis9556.sql new file mode 100644 index 000000000..74fe15f84 --- /dev/null +++ b/src/db/migration/migration/V20170927_1035__mantis9556.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDBILHETEDEVDEBITODINHEIRO NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20170928_1144__mantis9894.sql b/src/db/migration/migration/V20170928_1144__mantis9894.sql new file mode 100644 index 000000000..109ddbfe7 --- /dev/null +++ b/src/db/migration/migration/V20170928_1144__mantis9894.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_seq.nextval,''1'',''VDA > ESTOQUE >> REQUISI��O >> SELECIONAR PTO VTA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.SELECIONARPTOVTAREQUISICAO'',''1'',sysdate,''1'')'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20171004_1423__mantis9201.sql b/src/db/migration/migration/V20171004_1423__mantis9201.sql new file mode 100644 index 000000000..107c7861c --- /dev/null +++ b/src/db/migration/migration/V20171004_1423__mantis9201.sql @@ -0,0 +1,77 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE MONITORAMENTO_CCF + ( + MONITORAMENTOCCF_ID NUMBER(7,0) NOT NULL , + EMPRESA_ID NUMBER(7,0), + UF_INSTALACAO NUMBER(7,0), + FISCALIMPRESSORA_ID NUMBER(7,0), + DATA_OCORRENCIA DATE, + PUNTOVENTA_ID NUMBER(7,0), + USUARIO_ID NUMBER(7,0), + SEQUENCIA_CCF_QUEBRADA NUMBER(7,0), + DATA_MONITORAMENTO DATE, + DIAS_ALERTA_ABERTO DATE, + REPROCESSADO NUMBER(1,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIOMODIF_ID NUMBER(7,0), + CONSTRAINT MONITORAMENTO_CCF_PK PRIMARY KEY (MONITORAMENTOCCF_ID) ENABLE , + CONSTRAINT FK_MCCF_PUNTOVENTA FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) ENABLE, + CONSTRAINT FK_MCCF_USUARIO FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO (USUARIO_ID) ENABLE, + CONSTRAINT FK_MCCF_USUARIOMODIF FOREIGN KEY (USUARIOMODIF_ID) REFERENCES USUARIO (USUARIO_ID) ENABLE + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE MONITORAMENTO_CCF_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE MONITORAMENTO_CRZ + ( + MONITORAMENTOCRZ_ID NUMBER(7,0) NOT NULL , + EMPRESA_ID NUMBER(7,0), + UF_INSTALACAO NUMBER(7,0), + FISCALIMPRESSORA_ID NUMBER(7,0), + DATA_REDUCAOZ_FALTANTE DATE, + PUNTOVENTA_ID NUMBER(7,0), + ULTIMO_USUARIO_ECF_ID NUMBER(7,0), + SEQUENCIA_CRZ_QUEBRADA NUMBER(7,0), + DATA_MONITORAMENTO DATE, + DIAS_ALERTA_ABERTO DATE, + REPROCESSADO NUMBER(1,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIOMODIF_ID NUMBER(7,0), + CONSTRAINT MONITORAMENTO_CRZ_ID_PK PRIMARY KEY (MONITORAMENTOCRZ_ID) ENABLE , + CONSTRAINT FK_MCRZ_PUNTOVENTA FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) ENABLE, + CONSTRAINT FK_MCRZ_USUARIO FOREIGN KEY (ULTIMO_USUARIO_ECF_ID) REFERENCES USUARIO (USUARIO_ID) ENABLE, + CONSTRAINT FK_MCRZ_USUARIOMODIF FOREIGN KEY (USUARIOMODIF_ID) REFERENCES USUARIO (USUARIO_ID) ENABLE + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE MONITORAMENTO_CRZ_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171005_1701__mantis9906.sql b/src/db/migration/migration/V20171005_1701__mantis9906.sql new file mode 100644 index 000000000..e8b2c49a1 --- /dev/null +++ b/src/db/migration/migration/V20171005_1701__mantis9906.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE DIAGRAMA_AUTOBUS ADD INDUSAVAGAOFIM NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171010_0926__mantis9822.sql b/src/db/migration/migration/V20171010_0926__mantis9822.sql new file mode 100644 index 000000000..94c30e164 --- /dev/null +++ b/src/db/migration/migration/V20171010_0926__mantis9822.sql @@ -0,0 +1,7 @@ +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID) values (''28'',''DER/RO'',''0'',''0'',to_date(''07-10-2015 11:17:03'',''DD-MM-YYYY HH24:MI:SS''),''1'',''6466'',''04.898.488/0001-77'',''1'',''60'',null,null,null)'; +exception + when others + then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20171010_1135__mantis9934.sql b/src/db/migration/migration/V20171010_1135__mantis9934.sql new file mode 100644 index 000000000..b077707fe --- /dev/null +++ b/src/db/migration/migration/V20171010_1135__mantis9934.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_ASIENTO MODIFY TIEMPOLIBERACION NUMBER(7,0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20171010_1138__mantis8778.sql b/src/db/migration/migration/V20171010_1138__mantis8778.sql new file mode 100644 index 000000000..796127525 --- /dev/null +++ b/src/db/migration/migration/V20171010_1138__mantis8778.sql @@ -0,0 +1,177 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TIPO_PARADA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE VIA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASE_SERVICIO ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +--USUARIO +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE USUARIO ADD (INTEGRADOTOTVS NUMBER(1,0) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (INTEGRADOTOTVS NUMBER(1,0) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CORRIDA ADD (INTEGRADOTOTVS NUMBER(1,0) )'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE PARADA MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE TIPO_PARADA MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists, -01451); +begin + execute immediate 'ALTER TABLE VIA MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists, -01451); +begin + execute immediate 'ALTER TABLE CLASE_SERVICIO MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE RUTA MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE TARIFA MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE USUARIO MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01451); +begin + execute immediate 'ALTER TABLE CORRIDA MODIFY (INTEGRADOTOTVS NULL)'; + exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20171011_1611__mantis9201.sql b/src/db/migration/migration/V20171011_1611__mantis9201.sql new file mode 100644 index 000000000..d2b9103a5 --- /dev/null +++ b/src/db/migration/migration/V20171011_1611__mantis9201.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate + 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values + (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > SEGURANCA >> Painel ECF'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.PAINELECF'',''1'',sysdate,''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20171013_1800__mantis9962.sql b/src/db/migration/migration/V20171013_1800__mantis9962.sql new file mode 100644 index 000000000..cd2d1bfd6 --- /dev/null +++ b/src/db/migration/migration/V20171013_1800__mantis9962.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION add INDMULTADEVOLUCAOABERTO NUMBER(1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171016_1800__mantis9758.sql b/src/db/migration/migration/V20171016_1800__mantis9758.sql new file mode 100644 index 000000000..9608fabf2 --- /dev/null +++ b/src/db/migration/migration/V20171016_1800__mantis9758.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,1, ''BLOQUEO LOCALIDADE PARA VENDA'', ''COM.RJCONSULTORES.VENTABOLETOS.MAPAVIAGEM.BLOQUEOVENDA'', 1, sysdate, 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171017_1200__mantis9959.sql b/src/db/migration/migration/V20171017_1200__mantis9959.sql new file mode 100644 index 000000000..6cc13c202 --- /dev/null +++ b/src/db/migration/migration/V20171017_1200__mantis9959.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA add INDNAOALTERARDIAGRAMA NUMBER(1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171017_1855__mantis9471.sql b/src/db/migration/migration/V20171017_1855__mantis9471.sql new file mode 100644 index 000000000..48a492091 --- /dev/null +++ b/src/db/migration/migration/V20171017_1855__mantis9471.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD INDNAOPERMITEVDAMESMODOCVIAGEM NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171019_1439__mantis9957.sql b/src/db/migration/migration/V20171019_1439__mantis9957.sql new file mode 100644 index 000000000..7d5dd1331 --- /dev/null +++ b/src/db/migration/migration/V20171019_1439__mantis9957.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDEMITECUPOMFISCALREMARCACAO NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171025_1931__mantis10026.sql b/src/db/migration/migration/V20171025_1931__mantis10026.sql new file mode 100644 index 000000000..3333e8c27 --- /dev/null +++ b/src/db/migration/migration/V20171025_1931__mantis10026.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RESERVACION_CTRL ADD(INDTIPORESERVA NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171026_1000__LOGMD.sql b/src/db/migration/migration/V20171026_1000__LOGMD.sql new file mode 100644 index 000000000..667ce95cf --- /dev/null +++ b/src/db/migration/migration/V20171026_1000__LOGMD.sql @@ -0,0 +1,19 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE MD_LOG + ( + EMPRESA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7), + DATAMD VARCHAR(8), + CONTA_ID NUMBER(7) NOT NULL, + OBSERVACAO VARCHAR(200), + VALOR NUMBER(12,2), + ACTIVO NUMBER(1,0), + FECMODIF DATE + )'; + + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171031_1849__mantis10080.sql b/src/db/migration/migration/V20171031_1849__mantis10080.sql new file mode 100644 index 000000000..d96e03b42 --- /dev/null +++ b/src/db/migration/migration/V20171031_1849__mantis10080.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,ACTIVO,FECMODIF,USUARIO_ID,CVESISTEMA) +values (MOTIVO_CANCELACION_SEQ.nextval,''CANCELAMENTO ECF'',''B'',1,sysdate,1,''CANCELAMENTO_ECF'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20171101_1600__mantis9930.sql b/src/db/migration/migration/V20171101_1600__mantis9930.sql new file mode 100644 index 000000000..8a7bd8330 --- /dev/null +++ b/src/db/migration/migration/V20171101_1600__mantis9930.sql @@ -0,0 +1,19 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'alter table FORMA_PAGO add constraint uniq_fp_cvesistema unique("CVESISTEMA")'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171101_1601__mantis9930.sql b/src/db/migration/migration/V20171101_1601__mantis9930.sql new file mode 100644 index 000000000..7b9079ba6 --- /dev/null +++ b/src/db/migration/migration/V20171101_1601__mantis9930.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'UPDATE FORMA_PAGO SET DESCPAGO = ''GERACAO OCD'', CVEPAGO = ''GO'', FECMODIF = sysdate WHERE FORMAPAGO_ID = 35'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171106_1833__mantis10131.sql b/src/db/migration/migration/V20171106_1833__mantis10131.sql new file mode 100644 index 000000000..1d8471b70 --- /dev/null +++ b/src/db/migration/migration/V20171106_1833__mantis10131.sql @@ -0,0 +1,41 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTADO ADD (CODIBGE NUMBER(7,0))'; + exception when object_exists then null; +end; + +/ + +declare +begin + UPDATE ESTADO SET CODIBGE = 12 WHERE CVEESTADO = 'AC'; + UPDATE ESTADO SET CODIBGE = 27 WHERE CVEESTADO = 'AL'; + UPDATE ESTADO SET CODIBGE = 13 WHERE CVEESTADO = 'AM'; + UPDATE ESTADO SET CODIBGE = 16 WHERE CVEESTADO = 'AP'; + UPDATE ESTADO SET CODIBGE = 29 WHERE CVEESTADO = 'BA'; + UPDATE ESTADO SET CODIBGE = 23 WHERE CVEESTADO = 'CE'; + UPDATE ESTADO SET CODIBGE = 53 WHERE CVEESTADO = 'DF'; + UPDATE ESTADO SET CODIBGE = 32 WHERE CVEESTADO = 'ES'; + UPDATE ESTADO SET CODIBGE = 52 WHERE CVEESTADO = 'GO'; + UPDATE ESTADO SET CODIBGE = 21 WHERE CVEESTADO = 'MA'; + UPDATE ESTADO SET CODIBGE = 31 WHERE CVEESTADO = 'MG'; + UPDATE ESTADO SET CODIBGE = 50 WHERE CVEESTADO = 'MS'; + UPDATE ESTADO SET CODIBGE = 51 WHERE CVEESTADO = 'MT'; + UPDATE ESTADO SET CODIBGE = 15 WHERE CVEESTADO = 'PA'; + UPDATE ESTADO SET CODIBGE = 25 WHERE CVEESTADO = 'PB'; + UPDATE ESTADO SET CODIBGE = 26 WHERE CVEESTADO = 'PE'; + UPDATE ESTADO SET CODIBGE = 22 WHERE CVEESTADO = 'PI'; + UPDATE ESTADO SET CODIBGE = 41 WHERE CVEESTADO = 'PR'; + UPDATE ESTADO SET CODIBGE = 33 WHERE CVEESTADO = 'RJ'; + UPDATE ESTADO SET CODIBGE = 24 WHERE CVEESTADO = 'RN'; + UPDATE ESTADO SET CODIBGE = 11 WHERE CVEESTADO = 'RO'; + UPDATE ESTADO SET CODIBGE = 14 WHERE CVEESTADO = 'RR'; + UPDATE ESTADO SET CODIBGE = 43 WHERE CVEESTADO = 'RS'; + UPDATE ESTADO SET CODIBGE = 42 WHERE CVEESTADO = 'SC'; + UPDATE ESTADO SET CODIBGE = 28 WHERE CVEESTADO = 'SE'; + UPDATE ESTADO SET CODIBGE = 35 WHERE CVEESTADO = 'SP'; + UPDATE ESTADO SET CODIBGE = 17 WHERE CVEESTADO = 'TO'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171107_1000__mantis10054.sql b/src/db/migration/migration/V20171107_1000__mantis10054.sql new file mode 100644 index 000000000..7d1eb4285 --- /dev/null +++ b/src/db/migration/migration/V20171107_1000__mantis10054.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE REDONDEO_CTRL add INDAPLICAARTESP NUMBER(1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171107_1043__mantis10061.sql b/src/db/migration/migration/V20171107_1043__mantis10061.sql new file mode 100644 index 000000000..8e5f49842 --- /dev/null +++ b/src/db/migration/migration/V20171107_1043__mantis10061.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDBLOQVDAIMPPOSTERIOR NUMBER(1,0) DEFAULT 0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171116_1740__mantis9956.sql b/src/db/migration/migration/V20171116_1740__mantis9956.sql new file mode 100644 index 000000000..819059e0d --- /dev/null +++ b/src/db/migration/migration/V20171116_1740__mantis9956.sql @@ -0,0 +1,32 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE ORGAO_EMP_PARAM + ( + ORGAOEMPPARAM_ID NUMBER(15) NOT NULL, + ORGAOCONCEDENTE_ID NUMBER(7,0) NULL, + EMPRESA_ID NUMBER(7,0) NULL, + INDEMITESEGUNDAVIA NUMBER(1,0) DEFAULT 1 NULL, + INDDOISCUPOMEMBARQUE NUMBER(1,0) DEFAULT 1 NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (ORGAOEMPPARAM_ID), + FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA, + FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE ORGAO_EMP_PARAM_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20171120_1420__mantis9941.sql b/src/db/migration/migration/V20171120_1420__mantis9941.sql new file mode 100644 index 000000000..6f2f2fb52 --- /dev/null +++ b/src/db/migration/migration/V20171120_1420__mantis9941.sql @@ -0,0 +1,32 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CUSTOM + ( + CUSTOM_ID NUMBER(7) NOT NULL, + SISTEMA NUMBER(1), + TIPO NUMBER(1), + ORDEM NUMBER(3), + REFERENCIA VARCHAR2(50), + CHAVE VARCHAR2(100), + VALOR VARCHAR2(255), + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (CUSTOM_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CUSTOM_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20171121_1432__mantis9779.sql b/src/db/migration/migration/V20171121_1432__mantis9779.sql new file mode 100644 index 000000000..3720081dd --- /dev/null +++ b/src/db/migration/migration/V20171121_1432__mantis9779.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDIMPRIMESEGVIATRANSFERENCIA NUMBER(1,0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20171127_1504__mantis9201.sql b/src/db/migration/migration/V20171127_1504__mantis9201.sql new file mode 100644 index 000000000..3c2b3dcb6 --- /dev/null +++ b/src/db/migration/migration/V20171127_1504__mantis9201.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE MONITORAMENTO_CRZ MODIFY (EMPRESA_ID NULL)'; + + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171128_1615__mantis10291.sql b/src/db/migration/migration/V20171128_1615__mantis10291.sql new file mode 100644 index 000000000..edb309fa3 --- /dev/null +++ b/src/db/migration/migration/V20171128_1615__mantis10291.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD ( TRANSACAOORIGINAL_ID NUMBER(15,0) )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171130_1124__mantis10253.sql b/src/db/migration/migration/V20171130_1124__mantis10253.sql new file mode 100644 index 000000000..c09b6e7d4 --- /dev/null +++ b/src/db/migration/migration/V20171130_1124__mantis10253.sql @@ -0,0 +1,9 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA ADD INDVENDETOTEM NUMBER (1,0)'; + exception when column_exists then null; +end; +/ +UPDATE PARADA SET INDVENDETOTEM = 1; \ No newline at end of file diff --git a/src/db/migration/migration/V20171205_1446__mantis8778.sql b/src/db/migration/migration/V20171205_1446__mantis8778.sql new file mode 100644 index 000000000..f28f43a39 --- /dev/null +++ b/src/db/migration/migration/V20171205_1446__mantis8778.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171205_2010__mantis10317.sql b/src/db/migration/migration/V20171205_2010__mantis10317.sql new file mode 100644 index 000000000..714c868e1 --- /dev/null +++ b/src/db/migration/migration/V20171205_2010__mantis10317.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_DOCUMENTO MODIFY (NUMEROINICIAL NUMBER(15), + NUMEROFINAL NUMBER(15) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171208_0942__mantis10333.sql b/src/db/migration/migration/V20171208_0942__mantis10333.sql new file mode 100644 index 000000000..8e77e171d --- /dev/null +++ b/src/db/migration/migration/V20171208_0942__mantis10333.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA MODIFY (CONFRESTRICAOCANALVENTA_ID NUMBER(15, 0) )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CONF_RESTRICAO_EXCECAO MODIFY (CONFRESTRICAOCANALVENTA_ID NUMBER(15, 0) )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CONF_RESTRICAO_PTOVTA MODIFY (CONFRESTRICAOCANALVENTA_ID NUMBER(15, 0) )'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20171208_1701__mantis9775.sql b/src/db/migration/migration/V20171208_1701__mantis9775.sql new file mode 100644 index 000000000..64d2ee059 --- /dev/null +++ b/src/db/migration/migration/V20171208_1701__mantis9775.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD ( INDIMPRIMECUPEMBVENDAMANUAL NUMBER(1, 0) DEFAULT 0 )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171211_0947__mantis10224.sql b/src/db/migration/migration/V20171211_0947__mantis10224.sql new file mode 100644 index 000000000..224b7dfb6 --- /dev/null +++ b/src/db/migration/migration/V20171211_0947__mantis10224.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TARJETA_CREDITO MODIFY TARJETACREDITO_ID number(4)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171211_1511__mantis9984.sql b/src/db/migration/migration/V20171211_1511__mantis9984.sql new file mode 100644 index 000000000..6309b474b --- /dev/null +++ b/src/db/migration/migration/V20171211_1511__mantis9984.sql @@ -0,0 +1,203 @@ +--------------------------------------------TAXPOL------------------------------------------------------------- +-------------------------------------------------------- +-- DDL for Table TAXPOL +-------------------------------------------------------- +declare + object_exists exception; + pragma exception_init (object_exists , -00942); +begin + execute immediate 'DROP TABLE "TAXPOL" cascade constraints'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'CREATE TABLE "TAXPOL" + ("TAXPOL_ID" NUMBER(7,0), + "EMPRESA_ID" NUMBER(7,0), + "CATEGORIA_ID" NUMBER(7,0), + "LOCALIDADE_ID" NUMBER(7,0), + "KM" NUMBER(7,0), + "ORGAOCONCEDENTE_ID" NUMBER(7,0), + "TIPO_TARIFA" VARCHAR2(15 BYTE), + "NUMTAXA" VARCHAR2(20 BYTE), + "DATAINSERCAO" DATE, + "ACTIVO" NUMBER(1,0), + "FECMODIF" DATE, + "USUARIO_ID" NUMBER(7,0), + "TAXPOLC_ID" NUMBER(7,0) + )'; + exception when object_exists then null; +end; +-------------------------------------------------------- +-- DDL for Index IDX_TAXPOL +-------------------------------------------------------- +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01408); +begin + execute immediate + 'CREATE UNIQUE INDEX "IDX_TAXPOL" ON "TAXPOL" ("TAXPOL_ID")'; + exception when object_exists then null; +end; +-------------------------------------------------------- +-- Constraints for Table TAXPOL +-------------------------------------------------------- +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE "TAXPOL" ADD CONSTRAINT "IDX_TAXPOL" PRIMARY KEY ("TAXPOL_ID")'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE "TAXPOL" MODIFY ("TAXPOL_ID" NOT NULL ENABLE)'; + exception when object_exists then null; +end; +/ +--------------------------------------------TAXPOLC------------------------------------------------------------- + +-------------------------------------------------------- +-- DDL for Table TAXPOLC +-------------------------------------------------------- +declare + object_exists exception; + pragma exception_init (object_exists , -00942); +begin + execute immediate 'DROP TABLE "TAXPOLC" cascade constraints'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'CREATE TABLE "TAXPOLC" + ( "TAXPOLC_ID" NUMBER(7,0), + "EMPRESA_ID" NUMBER(7,0), + "CATEGORIA_ID" NUMBER(7,0), + "LOCALIDADE_ID" NUMBER(7,0), + "KM" NUMBER(7,0), + "CONCESSIONARIA" VARCHAR2(6 BYTE), + "TERMINAL" VARCHAR2(15 BYTE), + "ORGAOCONCEDENTE_ID" NUMBER(7,0), + "TIPO_TARIFA" VARCHAR2(15 BYTE), + "TX_ABREVIADA" VARCHAR2(20 BYTE), + "ACTIVO" NUMBER(1,0), + "FECMODIF" DATE, + "USUARIO_ID" NUMBER(7,0) + )'; + exception when object_exists then null; +end; +/ + -------------------------------------------------------- +-- DDL for Index IDX_TAXPOLC +-------------------------------------------------------- +declare + object_exists exception; + pragma exception_init (object_exists , -01408); +begin + execute immediate + 'CREATE UNIQUE INDEX "IDX_TAXPOLC" ON "TAXPOLC" ("TAXPOLC_ID")'; + exception when object_exists then null; +end; +/ +-------------------------------------------------------- +-- Constraints for Table TAXPOL +-------------------------------------------------------- +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE "TAXPOLC" ADD CONSTRAINT "IDX_TAXPOLC" PRIMARY KEY ("TAXPOLC_ID")'; + exception when object_exists then null; +end; +/ +--------------------------------------------TAXPOV------------------------------------------------------------- +-------------------------------------------------------- +-- DDL for Table TAXPOLV +-------------------------------------------------------- +declare + object_exists exception; + pragma exception_init (object_exists , -00942); +begin + execute immediate 'DROP TABLE "TAXPOLV" cascade constraints'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE "TAXPOLV" + ( "TAXPOLV_ID" NUMBER(10,0), + "BOLETO_ID" NUMBER(16,0), + "CORRIDA_ID" NUMBER(9,2), + "DATAVIAGEM" VARCHAR2(8 BYTE), + "ORIGEN_ID" NUMBER(7,0), + "DESTINO_ID" NUMBER(7,0), + "POLTRONA" VARCHAR2(2 BYTE), + "FOLIO_SISTEMA" VARCHAR2(15 BYTE), + "EMPRESA_ID" NUMBER(7,0), + "CATEGORIA_ID" NUMBER(7,0), + "NUMTAXA" VARCHAR2(15 BYTE), + "DATAINSERCAO" VARCHAR2(8 BYTE), + "CONCESSIONARIA" VARCHAR2(6 BYTE), + "TERMINAL" VARCHAR2(6 BYTE), + "VALORTAXA" NUMBER(8,2), + "TIPO_TARIFA" VARCHAR2(15 BYTE), + "TXABREVIADA" VARCHAR2(20 BYTE), + "ORGAOCONCEDENTE" NUMBER(7,0), + "HORASAIDA" VARCHAR2(5 BYTE), + "RUTA_ID" NUMBER(7,0), + "DATAVENDA" VARCHAR2(8 BYTE), + "HORAVENDA" VARCHAR2(5 BYTE), + "USUARIO_ID" NUMBER(7,0), + "INDCANCELADO" NUMBER(1,0), + "USUARIOCANC" NUMBER(7,0), + "SESSAOCANCELAMENTO" VARCHAR2(6 BYTE), + "DATACANCELAMENTO" VARCHAR2(8 BYTE), + "ACTIVO" NUMBER(1,0) + )'; + exception when object_exists then null; +end; +/ +-------------------------------------------------------- +-- DDL for Index IDX_TAXPOLV +-------------------------------------------------------- +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE UNIQUE INDEX "IDX_TAXPOLV" ON "TAXPOLV" ("TAXPOLV_ID")'; + exception when object_exists then null; +end; +/ +-------------------------------------------------------- +-- Constraints for Table TAXPOLV +-------------------------------------------------------- +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE "TAXPOLV" ADD CONSTRAINT "IDX_TAXPOLV" PRIMARY KEY ("TAXPOLV_ID")'; + exception when object_exists then null; +end; + + diff --git a/src/db/migration/migration/V20171226_0953__mantis10399.sql b/src/db/migration/migration/V20171226_0953__mantis10399.sql new file mode 100644 index 000000000..3c6836d69 --- /dev/null +++ b/src/db/migration/migration/V20171226_0953__mantis10399.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MOTIVO_CANCELACION ADD INDEXIBECANCEL NUMBER(1)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171226_0954__mantis10399.sql b/src/db/migration/migration/V20171226_0954__mantis10399.sql new file mode 100644 index 000000000..8b40b5657 --- /dev/null +++ b/src/db/migration/migration/V20171226_0954__mantis10399.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -00001); +begin + execute immediate 'UPDATE MOTIVO_CANCELACION SET INDEXIBECANCEL = 1, FECMODIF = SYSDATE WHERE MOTIVOCANCELACION_ID IN (32,31,37,36)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171227_1600__mantis9440.sql b/src/db/migration/migration/V20171227_1600__mantis9440.sql new file mode 100644 index 000000000..f3b951f5c --- /dev/null +++ b/src/db/migration/migration/V20171227_1600__mantis9440.sql @@ -0,0 +1,74 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE BPE + ( + BPE_ID NUMBER(7,0), + TIPOAMB NUMBER(1,0), + UF VARCHAR2(2 BYTE), + VERSAOAPLICACAO VARCHAR2(20 BYTE), + CODSTAT VARCHAR2(3 BYTE), + MOTIVO VARCHAR2(255 BYTE), + RETORNO_ID VARCHAR2(20 BYTE), + CHBPE VARCHAR2(44 BYTE), + DHRECBTO VARCHAR2(25 BYTE), + NPROT VARCHAR2(15 BYTE), + INDCONTINGENCIA NUMBER(1,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "BPE_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1'; + + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (BOLETO_ID NUMBER(15))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (VERSAO VARCHAR2(8))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (CNPJ VARCHAR2(14))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (QRCODE VARCHAR2(255))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (CBP VARCHAR2(8))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20171228_1145__mantis10399.sql b/src/db/migration/migration/V20171228_1145__mantis10399.sql new file mode 100644 index 000000000..ac3ea1e3f --- /dev/null +++ b/src/db/migration/migration/V20171228_1145__mantis10399.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_seq.nextval,1,''ADM > CONFIG COMERCIAL > MOTIVO DO CANCELAMENTO >> PERMITE ALTERAR MOTIVO CANCELAMENTO PARA EXIBIR NO CANCELAMENTO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MOTIVOCANCELACION.ALTERAEXIBECANCEL'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20171228_1530__mantis9440.sql b/src/db/migration/migration/V20171228_1530__mantis9440.sql new file mode 100644 index 000000000..03ac51428 --- /dev/null +++ b/src/db/migration/migration/V20171228_1530__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE INSCRICAO_ESTADUAL ADD (INDBPE NUMBER(1))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20171228_1600__mantis9440.sql b/src/db/migration/migration/V20171228_1600__mantis9440.sql new file mode 100644 index 000000000..2ec0fe0ed --- /dev/null +++ b/src/db/migration/migration/V20171228_1600__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (ERROCONTINGENCIA VARCHAR2(255))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180104_1444__mantis10372.sql b/src/db/migration/migration/V20180104_1444__mantis10372.sql new file mode 100644 index 000000000..5c702985d --- /dev/null +++ b/src/db/migration/migration/V20180104_1444__mantis10372.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID ,DESCORGAO ,INDSUBSEGURO ,INDDEFAULTSEGURO ,FECMODIF ,ACTIVO ,USUARIO_ID ,CNPJ,INDNOMDOCOBLIGATORIO ,IDADE_IDOSO ,INDICEPEAJE ,IDADE_MINIMA ,CATEGORIA_ID ,INTEGRADOTOTVS ,INDUTILIZAICMS) values ( 29, ''ATR'' ,0 ,0 ,sysdate ,1 ,1 ,null,0 ,60 ,null ,null ,null ,0 ,0)'; + execute immediate 'Insert into COEFICIENTE_TARIFA (COEFICIENTETARIFA_ID,DESCCOEFICIENTE,ACTIVO,FECMODIF,USUARIO_ID,COEFICIENTE) values (COEFICIENTE_TARIFA_SEQ.nextval,''ATR'',1,sysdate,1,0.207558)'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180111_1030__mantis9984.sql b/src/db/migration/migration/V20180111_1030__mantis9984.sql new file mode 100644 index 000000000..b268fecfc --- /dev/null +++ b/src/db/migration/migration/V20180111_1030__mantis9984.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD (NUMOPERACION VARCHAR2(36 BYTE))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180111_1058__mantis10346.sql b/src/db/migration/migration/V20180111_1058__mantis10346.sql new file mode 100644 index 000000000..f97e74d08 --- /dev/null +++ b/src/db/migration/migration/V20180111_1058__mantis10346.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_seq.nextval,1,''ADM > RELATORIO >> GRATUIDADE ANTT'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOGRATUIDADEANTT'',1,sysdate,1)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20180111_1700__mantis9440.sql b/src/db/migration/migration/V20180111_1700__mantis9440.sql new file mode 100644 index 000000000..e44fcacd7 --- /dev/null +++ b/src/db/migration/migration/V20180111_1700__mantis9440.sql @@ -0,0 +1,31 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD (INDBPE NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (INDBPE NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (INDBPEEMPRESA NUMBER(1))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (INDBPEESTACAO NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180116_1100__MDVersion.sql b/src/db/migration/migration/V20180116_1100__MDVersion.sql new file mode 100644 index 000000000..a902f1f50 --- /dev/null +++ b/src/db/migration/migration/V20180116_1100__MDVersion.sql @@ -0,0 +1,25 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_TOTALIZADOR ADD VERSAO NUMBER(8)'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_RESUMO_ECF ADD VERSAO NUMBER(8)'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_DOCUMENTO ADD VERSAO NUMBER(8)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180116_1630__mantis10328.sql b/src/db/migration/migration/V20180116_1630__mantis10328.sql new file mode 100644 index 000000000..0c1b3c21c --- /dev/null +++ b/src/db/migration/migration/V20180116_1630__mantis10328.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,1, + ''ADM > RELATORIO >> HISTORICO CLIENTES'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.HISTORICOCLIENTES'', 1, sysdate, 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180117_1130__mantis10487.sql b/src/db/migration/migration/V20180117_1130__mantis10487.sql new file mode 100644 index 000000000..2e717d322 --- /dev/null +++ b/src/db/migration/migration/V20180117_1130__mantis10487.sql @@ -0,0 +1,19 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00942); +begin + execute immediate + 'DROP SEQUENCE MDCONTA_SEQ'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE MDCONTA_SEQ INCREMENT BY 1 START WITH 1000 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180126_1600__mantis9440.sql b/src/db/migration/migration/V20180126_1600__mantis9440.sql new file mode 100644 index 000000000..0653ecfe6 --- /dev/null +++ b/src/db/migration/migration/V20180126_1600__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (INDBPEUF NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180131_1850__mantis9440.sql b/src/db/migration/migration/V20180131_1850__mantis9440.sql new file mode 100644 index 000000000..3455f9b55 --- /dev/null +++ b/src/db/migration/migration/V20180131_1850__mantis9440.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,ACTIVO,FECMODIF,USUARIO_ID,CVESISTEMA) +values (MOTIVO_CANCELACION_SEQ.nextval,''CANCELAMENTO BPE'',''B'',1,sysdate,1,''CANCELAMENTO_BPE'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20180201_1643__mantis10258.sql b/src/db/migration/migration/V20180201_1643__mantis10258.sql new file mode 100644 index 000000000..3d2672e26 --- /dev/null +++ b/src/db/migration/migration/V20180201_1643__mantis10258.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AUDIT_LOG DROP (ENTITY_DETAIL)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180201_1718__mantis10258.sql b/src/db/migration/migration/V20180201_1718__mantis10258.sql new file mode 100644 index 000000000..4ac7a331f --- /dev/null +++ b/src/db/migration/migration/V20180201_1718__mantis10258.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE AUDIT_LOG ADD (ENTITY_DETAIL CLOB)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180205_1040__mantis10575.sql b/src/db/migration/migration/V20180205_1040__mantis10575.sql new file mode 100644 index 000000000..19da86c65 --- /dev/null +++ b/src/db/migration/migration/V20180205_1040__mantis10575.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD INDMULTATODASREMARCACOES NUMBER(1)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180205_1730__mantis10591.sql b/src/db/migration/migration/V20180205_1730__mantis10591.sql new file mode 100644 index 000000000..cef0f1271 --- /dev/null +++ b/src/db/migration/migration/V20180205_1730__mantis10591.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE PUNTO_VENTA SET FECMODIF = SYSDATE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180206_1450__mantis9441.sql b/src/db/migration/migration/V20180206_1450__mantis9441.sql new file mode 100644 index 000000000..4fbdfbf92 --- /dev/null +++ b/src/db/migration/migration/V20180206_1450__mantis9441.sql @@ -0,0 +1,16 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''BPE_VERSAO'',''VERSAO XML BPE'',''1'',''1.00'',''1'',''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; +/ + +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''BPE_AMBIENTE'',''AMBIENTE DO BPE'',''1'',''2'',''1'',''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20180207_1715__mantis9440.sql b/src/db/migration/migration/V20180207_1715__mantis9440.sql new file mode 100644 index 000000000..d4fd829b8 --- /dev/null +++ b/src/db/migration/migration/V20180207_1715__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (INDREDBASEICMSBPE NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180207_1850__mantis9440.sql b/src/db/migration/migration/V20180207_1850__mantis9440.sql new file mode 100644 index 000000000..83aa60625 --- /dev/null +++ b/src/db/migration/migration/V20180207_1850__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD ("TPINTEGRA" VARCHAR2(1))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180215_1618__mantis10541.sql b/src/db/migration/migration/V20180215_1618__mantis10541.sql new file mode 100644 index 000000000..b77e4ccaf --- /dev/null +++ b/src/db/migration/migration/V20180215_1618__mantis10541.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD COO VARCHAR(6)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180215_1619__mantis10541.sql b/src/db/migration/migration/V20180215_1619__mantis10541.sql new file mode 100644 index 000000000..4e9ea84ac --- /dev/null +++ b/src/db/migration/migration/V20180215_1619__mantis10541.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD COO VARCHAR(6)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180219_1035__mantis10565.sql b/src/db/migration/migration/V20180219_1035__mantis10565.sql new file mode 100644 index 000000000..ab5ab58f3 --- /dev/null +++ b/src/db/migration/migration/V20180219_1035__mantis10565.sql @@ -0,0 +1,23 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAMBIO_TITULARIDAD ADD (DESCORGAODOC VARCHAR(5), + DESCCORREO VARCHAR(100), + DESCTELEFONO VARCHAR(15), + NUMFIDELIDAD VARCHAR(30), + DESCNUMDOC2 VARCHAR(15), + DESCTIPODOC2 VARCHAR(5), + FECNACIMIENTO DATE, + EMBARQUE_ID NUMBER(7,0) + )'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -02275); +begin + execute immediate 'ALTER TABLE CAMBIO_TITULARIDAD ADD CONSTRAINT CT_EMBARQUE_FK FOREIGN KEY (EMBARQUE_ID) REFERENCES PARADA( PARADA_ID ) ENABLE'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180220_1603__mantis10259.sql b/src/db/migration/migration/V20180220_1603__mantis10259.sql new file mode 100644 index 000000000..a98cc3b7e --- /dev/null +++ b/src/db/migration/migration/V20180220_1603__mantis10259.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -01430); +begin + execute immediate 'ALTER TABLE ASIENTO_EXCLUSIVO ADD USUARIO VARCHAR(20) NULL'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -01430); +begin + execute immediate 'ALTER TABLE ASIENTO_EXCLUSIVO ADD AGENCIA VARCHAR(80) NULL'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180222_1850__mantis9440.sql b/src/db/migration/migration/V20180222_1850__mantis9440.sql new file mode 100644 index 000000000..e775da021 --- /dev/null +++ b/src/db/migration/migration/V20180222_1850__mantis9440.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE BPE_FOLIO INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; + \ No newline at end of file diff --git a/src/db/migration/migration/V20180222_2306__mantis9440.sql b/src/db/migration/migration/V20180222_2306__mantis9440.sql new file mode 100644 index 000000000..199279b9b --- /dev/null +++ b/src/db/migration/migration/V20180222_2306__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION MODIFY (NOMBIMPRESORASEGURO VARCHAR2(20 BYTE))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180227_1630__mantis9984.sql b/src/db/migration/migration/V20180227_1630__mantis9984.sql new file mode 100644 index 000000000..468b153ce --- /dev/null +++ b/src/db/migration/migration/V20180227_1630__mantis9984.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE TAXPOL_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE TAXPOLC_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE' ; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE TAXPOLV_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE' ; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180228_1740__mantis10671.sql b/src/db/migration/migration/V20180228_1740__mantis10671.sql new file mode 100644 index 000000000..531e87f93 --- /dev/null +++ b/src/db/migration/migration/V20180228_1740__mantis10671.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,1,''ADM > AIDF >> EDITAR JA CRIADA'',''ADM.AIDF.EDITARJACRIADA'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180302_1804__mantis10336.sql b/src/db/migration/migration/V20180302_1804__mantis10336.sql new file mode 100644 index 000000000..380ff2550 --- /dev/null +++ b/src/db/migration/migration/V20180302_1804__mantis10336.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD ( INDPERMVENMANUTODOSESTADOS NUMBER(1, 0) DEFAULT 0 )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180305_0925__mantis10642.sql b/src/db/migration/migration/V20180305_0925__mantis10642.sql new file mode 100644 index 000000000..13d92d402 --- /dev/null +++ b/src/db/migration/migration/V20180305_0925__mantis10642.sql @@ -0,0 +1,27 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00942); +begin + execute immediate 'delete from PRECIO_FIXO_PEDAGIO where PRACAPEDAGIO_ID not in (select CASETAPEAJE_ID from caseta_peaje)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'alter table PRECIO_FIXO_PEDAGIO add constraint PRACAPEDGAIO_CASETA foreign key("PRACAPEDAGIO_ID") references "CASETA_PEAJE"("CASETAPEAJE_ID")'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180305_1029__mantis10239.sql b/src/db/migration/migration/V20180305_1029__mantis10239.sql new file mode 100644 index 000000000..6f9f8c1e4 --- /dev/null +++ b/src/db/migration/migration/V20180305_1029__mantis10239.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'insert into constante (constante_id,nombconstante,descconstante,indtipoconstante,valorconstante,indmantenimientousuario,activo,fecmodif,usuario_id) + values (constante_seq.nextval,''TIEMPO_ANTES_SALIDA_TOTEM'',''TIEMPO ANTES SALIDA TOTEM'',0,''15'',0,1,sysdate,-1)'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180309_1700__mantis10625.sql b/src/db/migration/migration/V20180309_1700__mantis10625.sql new file mode 100644 index 000000000..d30d9ac29 --- /dev/null +++ b/src/db/migration/migration/V20180309_1700__mantis10625.sql @@ -0,0 +1,58 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AUDITORIA + ( + AUDITORIA_ID NUMBER(15) NOT NULL, + SISTEMA_ID NUMBER(1), + AUDFUNCIONALIDADE_ID NUMBER(5), + ACAO VARCHAR2(1), + CHAVE VARCHAR2(100), + CHAVE_ID NUMBER(15), + DESCRICAO VARCHAR2(255), + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (AUDITORIA_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE AUDITORIA_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AUDITORIA_FUNCIONALIDADE + ( + AUDFUNCIONALIDADE_ID NUMBER(5), + DESCRICAO VARCHAR2(100), + PRIMARY KEY (AUDFUNCIONALIDADE_ID) + )'; + + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'Insert into AUDITORIA_FUNCIONALIDADE (AUDFUNCIONALIDADE_ID, DESCRICAO) values (1,''SERVICO'')'; + execute immediate 'Insert into AUDITORIA_FUNCIONALIDADE (AUDFUNCIONALIDADE_ID, DESCRICAO) values (2,''LOCALIDADE SERVICO'')'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180312_1100__mantis9614.sql b/src/db/migration/migration/V20180312_1100__mantis9614.sql new file mode 100644 index 000000000..59cd9a495 --- /dev/null +++ b/src/db/migration/migration/V20180312_1100__mantis9614.sql @@ -0,0 +1,48 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA ADD (CVESISTEMA VARCHAR2(50))'; + exception when column_exists then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CATEGORIA (CATEGORIA_ID, DESCCATEGORIA, ACTIVO, FECMODIF, USUARIO_ID, INDEMITETERMORECUSA, DESCIMPRESIONGRATUIDADE, INDNAOUSAASSENTO, CVESISTEMA) + VALUES (CATEGORIA_SEQ.nextval, ''FIDELIDADE'', ''1'', sysdate, ''1'', ''0'', ''FIDELIDADE'', ''0'', ''FIDELIDADE'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''URL_WS_FIDELIDADE'', ''URL de chamada do projeto Fidelidade'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''SENHA_WS_FIDELIDADE'', ''SENHA de chamada do projeto Fidelidade'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''USUARIO_WS_FIDELIDADE'', ''USUARIO de chamada do projeto Fidelidade'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (TEMPORESERVAFIDELIDADE NUMBER(7,0))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180312_1645__mantis10663.sql b/src/db/migration/migration/V20180312_1645__mantis10663.sql new file mode 100644 index 000000000..669894bd0 --- /dev/null +++ b/src/db/migration/migration/V20180312_1645__mantis10663.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD ( INDRESTRICAOFORMAPAGO varchar(2) )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180313_1445__mantis10625.sql b/src/db/migration/migration/V20180313_1445__mantis10625.sql new file mode 100644 index 000000000..394138997 --- /dev/null +++ b/src/db/migration/migration/V20180313_1445__mantis10625.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AUDITORIA_CHAVE + ( + CHAVE_ID NUMBER(15) NOT NULL, + CHAVE VARCHAR2(100), + VALOR VARCHAR2(100), + PRIMARY KEY (CHAVE_ID, CHAVE) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CHAVE_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180313_1516__mantis10704.sql b/src/db/migration/migration/V20180313_1516__mantis10704.sql new file mode 100644 index 000000000..08ef3f204 --- /dev/null +++ b/src/db/migration/migration/V20180313_1516__mantis10704.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDNAOAPLICATARIFAMINIMA NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180313_1609__mantis10337.sql b/src/db/migration/migration/V20180313_1609__mantis10337.sql new file mode 100644 index 000000000..afe7887ef --- /dev/null +++ b/src/db/migration/migration/V20180313_1609__mantis10337.sql @@ -0,0 +1,69 @@ + declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO AUMENTA LIMITE DE DISPONIBILIDADE'' WHERE NOMBAUTORIZACION =''AUT_AUMENTA_DISPONIBILIDAD'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO CANCELA PAGAMENTO'' WHERE NOMBAUTORIZACION =''AUT_CANCELA_PAGOTAR'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''CHECKIN FECHADO'' WHERE NOMBAUTORIZACION = ''AUT_CHECKIN_CERRADO'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO PARA LIBERAR RESERVA ANTES DO TEMPO'' WHERE NOMBAUTORIZACION = ''AUT_LIBERA_RESERV'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO DESCONTO VENDA PACOTE'' WHERE NOMBAUTORIZACION = ''AUT_DESCONTO_VENDA_PACOTE'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO DESMARCAR OCD NO CANCELAMENTO'' WHERE NOMBAUTORIZACION =''AUT_DESMARCA_CANC_OCD'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO TROCA DE TITUlARIDADE'' WHERE NOMBAUTORIZACION = ''AUT_TROCA_TITULARIDADE'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO DE BOLETOS EXTRAS'' WHERE NOMBAUTORIZACION = ''AUT_BOL_ASIENTOS'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO PARA TROCAR CAMPO VENDA ULTIMA HORA'' WHERE NOMBAUTORIZACION = ''AUT_EXCEDE_TRANSFERENCIA'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO QUANDO EXCEDE O NUMERO DE TRANSFERENCIAS'' WHERE NOMBAUTORIZACION = ''AUT_EXCEDE_TRANSFERE'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''AUTORIZACAO USUARIO LOGAR EM DIFERENTES ESTACOES'' WHERE NOMBAUTORIZACION = ''AUT_PTOVTA_DIFERENTE_ESTACION'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''TROCAR FOLIO'' WHERE NOMBAUTORIZACION = ''AUT_CAMBIAR_FOLIO'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''ENTREGA DE BOLETO'' WHERE NOMBAUTORIZACION = ''AUT_ENTREGA_BOL'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''ENTREGA DE EXTRAVIO'' WHERE NOMBAUTORIZACION = ''AUT_ENTREGA_EXTRAVIA'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''MUDAR ONIBUS SERVICO'' WHERE NOMBAUTORIZACION = ''AUT_CAMBIO_COND_DESPACHADA'''; + exception when object_exists then null; +end; +begin + execute immediate 'UPDATE AUTORIZACION SET DESCAUTORIZACION = ''OTORGA CORTESIA'' WHERE NOMBAUTORIZACION = ''AUT_OTORGAR_CORTESIA'''; + exception when object_exists then null; +end; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180314_0932__mantis10739.sql b/src/db/migration/migration/V20180314_0932__mantis10739.sql new file mode 100644 index 000000000..3facb8ea3 --- /dev/null +++ b/src/db/migration/migration/V20180314_0932__mantis10739.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (NUMTELSACDEF VARCHAR2(14))'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20180315_1130__mantis10721.sql b/src/db/migration/migration/V20180315_1130__mantis10721.sql new file mode 100644 index 000000000..79e1c7051 --- /dev/null +++ b/src/db/migration/migration/V20180315_1130__mantis10721.sql @@ -0,0 +1,17 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (OUTROSTRIBUTOS VARCHAR2(100))'; + + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (DESCONTO VARCHAR2(30))'; + + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180320_1547__mantis10458.sql b/src/db/migration/migration/V20180320_1547__mantis10458.sql new file mode 100644 index 000000000..337136970 --- /dev/null +++ b/src/db/migration/migration/V20180320_1547__mantis10458.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO ESTADO_VENTA (ESTADOVENTA_ID, DESCESTADO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (3, ''BLOQUEADO'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180326_1734__mantis10756.sql b/src/db/migration/migration/V20180326_1734__mantis10756.sql new file mode 100644 index 000000000..ae03a4d20 --- /dev/null +++ b/src/db/migration/migration/V20180326_1734__mantis10756.sql @@ -0,0 +1,47 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE COMISSAO_RECEITA ( + COMISSAORECEITA_ID NUMBER(7) NOT NULL, + DATAMOVIMENTO DATE NULL, + EMPRESA_ID NUMBER(7) NULL, + PUNTOVENTA_ID NUMBER(7) NULL, + BPR NUMBER(7,2) NULL, + GAP NUMBER(7,2) NULL, + IMPGAP NUMBER(7,2) NULL, + INTERNET NUMBER(7,2) NULL, + CANCELADOS NUMBER(7,2) NULL, + CANCELGAP NUMBER(7,2) NULL, + DEVOLVIDOS NUMBER(7,2) NULL, + DEVGAP NUMBER(7,2) NULL, + EXCESSO_BAGAGEM NUMBER(7,2) NULL, + SEG_OPCIONAL NUMBER(7,2) NULL, + RECEITA_OUTROS NUMBER(7,2) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + DEVOLVIDOS_ORIGEM NUMBER(7,2) NULL, + DEVOLVIDOS_ORIGEM_GAP NUMBER(7) NULL, + QTDE_IMPGAP NUMBER(7,0) NULL, + COMISSAO_BPR NUMBER(7,2) NULL, + COMISSAO_ENTREGA_PASSAGEM NUMBER(7,2) NULL, + COMISSAO_ENTREGA_BAGAGEM NUMBER(7,2) NULL, + COMISSAO_SEG_OPCIONAL NUMBER(7,2) NULL, + COMISSAO_OUTROS NUMBER(7,2) NULL, + PRIMARY KEY (COMISSAORECEITA_ID), + FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA, + FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE COMISSAO_RECEITA_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180327_1520__mantis10778.sql b/src/db/migration/migration/V20180327_1520__mantis10778.sql new file mode 100644 index 000000000..d8234b919 --- /dev/null +++ b/src/db/migration/migration/V20180327_1520__mantis10778.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD (NOMBIMPRESORABPE VARCHAR2(20))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180328_1758__mantis10756.sql b/src/db/migration/migration/V20180328_1758__mantis10756.sql new file mode 100644 index 000000000..79a68e62c --- /dev/null +++ b/src/db/migration/migration/V20180328_1758__mantis10756.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,1,''ADM > CONFIG COMERCIAL > COMISSAO >> RETENCAO DIARIA COMISSAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.COMISSAO.MENU.RETENCAODIARIACOMISSAO'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180328_1800__mantis9803.sql b/src/db/migration/migration/V20180328_1800__mantis9803.sql new file mode 100644 index 000000000..dcd570cf3 --- /dev/null +++ b/src/db/migration/migration/V20180328_1800__mantis9803.sql @@ -0,0 +1,7 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''USA_REMESSA_CNAB'', ''Usa sistema de Remessa de Arquivos CNAB'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20180328_1830__mantis9440.sql b/src/db/migration/migration/V20180328_1830__mantis9440.sql new file mode 100644 index 000000000..d94979dce --- /dev/null +++ b/src/db/migration/migration/V20180328_1830__mantis9440.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE MODIFY (QRCODE VARCHAR2(700))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180329_1031__mantis10756.sql b/src/db/migration/migration/V20180329_1031__mantis10756.sql new file mode 100644 index 000000000..9caac95a9 --- /dev/null +++ b/src/db/migration/migration/V20180329_1031__mantis10756.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''HORA_EXEC_RETENCAO_DIARIA_COMISSAO'', ''HORA_EXEC_RETENCAO_DIARIA_COMISSAO'', ''04:00'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180329_1547__mantis10563.sql b/src/db/migration/migration/V20180329_1547__mantis10563.sql new file mode 100644 index 000000000..47463554b --- /dev/null +++ b/src/db/migration/migration/V20180329_1547__mantis10563.sql @@ -0,0 +1,28 @@ +declare + begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > ESQUEMA OPERACIONAL >> GERACAO ARQUIVO EMTU'', +''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.GERACAOARQUIVOEMTU'', +''1'',to_date(''15/04/16'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; + +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD CODIGO_EMTU NUMBER(5,0)'; + exception when column_exists then null; +end; + +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD CODIGO_EMTU NUMBER(5,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180329_1639__mantis10756.sql b/src/db/migration/migration/V20180329_1639__mantis10756.sql new file mode 100644 index 000000000..2d840053d --- /dev/null +++ b/src/db/migration/migration/V20180329_1639__mantis10756.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''QTDE_MAX_DIAS_RETENCAO_DIARIA_COMISSAO'', ''QTDE_MAX_DIAS_RETENCAO_DIARIA_COMISSAO'', ''1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180329_1840__mantis9974.sql b/src/db/migration/migration/V20180329_1840__mantis9974.sql new file mode 100644 index 000000000..69965b881 --- /dev/null +++ b/src/db/migration/migration/V20180329_1840__mantis9974.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into constante (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''UTILIZAR_CODIGO_MONITRIP'',''UTILIZAR_CODIGO_MONITRIP'',null,''0'',''1'',''1'',to_date(''29/03/18'',''DD/MM/RR''),''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180403_1129__mantis10801.sql b/src/db/migration/migration/V20180403_1129__mantis10801.sql new file mode 100644 index 000000000..4b5b976be --- /dev/null +++ b/src/db/migration/migration/V20180403_1129__mantis10801.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_DESCUENTO ADD DESCUENTO_TASAEMBARQUE NUMBER(7,2)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180403_1700__mantis9440.sql b/src/db/migration/migration/V20180403_1700__mantis9440.sql new file mode 100644 index 000000000..f35bfccd4 --- /dev/null +++ b/src/db/migration/migration/V20180403_1700__mantis9440.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (XMLREGULAR CLOB)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (XMLCONTINGENCIA CLOB)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180404_1131__mantis10563_2.sql b/src/db/migration/migration/V20180404_1131__mantis10563_2.sql new file mode 100644 index 000000000..4c9270168 --- /dev/null +++ b/src/db/migration/migration/V20180404_1131__mantis10563_2.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD SEQUENCIA_EMTU NUMBER(3,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180405_2100__mantis10855.sql b/src/db/migration/migration/V20180405_2100__mantis10855.sql new file mode 100644 index 000000000..a5add3f8c --- /dev/null +++ b/src/db/migration/migration/V20180405_2100__mantis10855.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDIMPRIME2VIAS NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180409_1544__mantis10868.sql b/src/db/migration/migration/V20180409_1544__mantis10868.sql new file mode 100644 index 000000000..4605a11dd --- /dev/null +++ b/src/db/migration/migration/V20180409_1544__mantis10868.sql @@ -0,0 +1,7 @@ + + +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID,INTEGRADOTOTVS,INDUTILIZAICMS,INDMULTATODASREMARCACOES) values (''30'',''DETER'',''0'',''0'',to_date(''08/01/2018 15:57:53'',''DD/MM/YYYY HH24:MI:SS''),''1'',''7069'',null,''0'',''60'',''0,68'',null,null,''0'',''0'',null)'; + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID,INTEGRADOTOTVS,INDUTILIZAICMS,INDMULTATODASREMARCACOES) values (''31'',''DAER'',''0'',''0'',to_date(''08/01/2018 15:57:53'',''DD/MM/YYYY HH24:MI:SS''),''1'',''7069'',null,''0'',''60'',''0,68'',null,null,''0'',''0'',null)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180410_1044__mantis10801.sql b/src/db/migration/migration/V20180410_1044__mantis10801.sql new file mode 100644 index 000000000..a908fc52e --- /dev/null +++ b/src/db/migration/migration/V20180410_1044__mantis10801.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,1,''RELATORIOS > RELATORIOS FINANCEIRO > VENDAS DE CONEXAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASCONEXAO'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180410_1626__mantis10885.sql b/src/db/migration/migration/V20180410_1626__mantis10885.sql new file mode 100644 index 000000000..fbf272abf --- /dev/null +++ b/src/db/migration/migration/V20180410_1626__mantis10885.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOL ADD (NUMLOTE VARCHAR2(10) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD (NUMLOTE VARCHAR2(10) )'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180410_1800__mantis10879.sql b/src/db/migration/migration/V20180410_1800__mantis10879.sql new file mode 100644 index 000000000..21b61438f --- /dev/null +++ b/src/db/migration/migration/V20180410_1800__mantis10879.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (XMLRESPOSTA CLOB)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180411_0853__mantis10428.sql b/src/db/migration/migration/V20180411_0853__mantis10428.sql new file mode 100644 index 000000000..979387efa --- /dev/null +++ b/src/db/migration/migration/V20180411_0853__mantis10428.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE DIGITA_ITEM ADD ( INDCANCELAMENTO NUMBER(1, 0) DEFAULT 0 )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180411_1647__mantis10822.sql b/src/db/migration/migration/V20180411_1647__mantis10822.sql new file mode 100644 index 000000000..03526cd7a --- /dev/null +++ b/src/db/migration/migration/V20180411_1647__mantis10822.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,1,''ADM > SEGURIDAD >> INTEGRACAOTOTVS'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.INTEGRACAOTOTVS'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180411_1800__mantis10879.sql b/src/db/migration/migration/V20180411_1800__mantis10879.sql new file mode 100644 index 000000000..d8b05dfd6 --- /dev/null +++ b/src/db/migration/migration/V20180411_1800__mantis10879.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (TIPOEVENTO VARCHAR2(6))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180411_1810__mantis10879.sql b/src/db/migration/migration/V20180411_1810__mantis10879.sql new file mode 100644 index 000000000..0d5aac1a8 --- /dev/null +++ b/src/db/migration/migration/V20180411_1810__mantis10879.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (TIPOSUBSTITUICAO VARCHAR2(1))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180412_1819__mantis10358.sql b/src/db/migration/migration/V20180412_1819__mantis10358.sql new file mode 100644 index 000000000..3abd92a5a --- /dev/null +++ b/src/db/migration/migration/V20180412_1819__mantis10358.sql @@ -0,0 +1,403 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); + begin + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > ALTERACAO DE VIGENCIA' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> ALTERAÇÃO DE VIGENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > APROVEITAMENTO DE PRECO' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> APROVEITAMENTO DE PRECO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > ARREDONDAMENTO' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> ARREDONDAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > EXCECAO VIAGEM IDA/VOLTA' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> EXCEÇÃO VIAGEM IDA/VOLTA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > EXCLUIR TARIFAS' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> EXCLUIR TARIFAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > MODIFICACAO MASSIVA DE TARIFAS' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> MODIFICAÇAO MASSIVA DE TARIFAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > PRECO APANHE' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> PRECO APANHE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > SEGEMP' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> SEGEMP'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > SEGVKM' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> SEGVKM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > TARIFA ESCALA' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> TARIFA ESCALA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > TARIFAS' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> TARIFAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > TARIFAS MINIMAS' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> TARIFAS MINIMAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > TRECHO CONCORRENTE' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> TRECHO CONCORRENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > VIGENCIA TARIFAS' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO >> VIGENCIA TARIFAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > COPIAR TARIFA OFICIAL' WHERE NOMBFUNCION = 'ADM > ADM DE PRECO>> COPIAR TARIFA OFICIAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > PRACA DE PEDAGIO' WHERE NOMBFUNCION = 'ADM > ADM DE PRECOS >> PRACA DE PEDAGIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESTOQUE DE PASSAGEM > AIDF > EDITAR JA CRIADA' WHERE NOMBFUNCION = 'ADM > AIDF >> EDITAR JA CRIADA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO > ANALITICO' WHERE NOMBFUNCION = 'ADM > ANALITICO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO > BGM' WHERE NOMBFUNCION = 'ADM > ANALITICO > BGM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > ALTERAR PEDÁGIO CALCULADO' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> ALTERAR PEDÁGIO CALCULADO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > ATUALIZAR TARIFA' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> ATUALIZAR TARIFA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > CÁLCULO DE PEDÁGIO ARTESP' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> CÁLCULO DE PEDÁGIO ARTESP'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > CALCULO DE PRECO ARTESP' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> CALCULO DE PRECO ARTESP'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > SEGURO POR INTERVALO DE KM' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> SEGURO POR INTERVALO DE KM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > SEGURO POR TARIFA' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> SEGURO POR TARIFA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > TARIFA OFICIAL' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> TARIFA OFICIAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > TARIFA OFICIAL EXCEL' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> TARIFA OFICIAL EXCEL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > TARIFAS OFICIAL' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> TARIFAS OFICIAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > TAXA DE EMBARQUE INTERVALO DE KM' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> TAXA DE EMBARQUE INTERVALO DE KM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CALCULO DE PRECO > TAXA DE EMBARQUE POR LOCALIDADE' WHERE NOMBFUNCION = 'ADM > CALCULO DE PRECO >> TAXA DE EMBARQUE POR LOCALIDADE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > HOTEL' WHERE NOMBFUNCION = 'ADM > CATALOGO >> HOTEL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > MENSAGEM RECUSA' WHERE NOMBFUNCION = 'ADM > CATALOGO >> MENSAGEM RECUSA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > PACOTE CONVENIO' WHERE NOMBFUNCION = 'ADM > CATALOGO >> PACOTE CONVENIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > TIPO CONFERENCIA ITEM COMISSAO' WHERE NOMBFUNCION = 'ADM > CATALOGO >> TIPO CONFERENCIA ITEM COMISSAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > ARTIGO' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> ARTIGO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > ASSOCIACAO TIPO DE CLASSE E MARCA' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> ASSOCIAÇÃO TIPO DE CLASSE E MARCA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > BAIRRO' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> BAIRRO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > CANAL DE VENDA' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> CANAL DE VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > CIDADE' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> CIDADE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > CURSO' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> CURSO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > EMPREGADO' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> EMPREGADO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > EMPRESA' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> EMPRESA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > EMPRESA > GERA NUMERO BILHETE VENDA INTERNET E IMP. POSTERIOR' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> EMPRESA >> GERA NUMERO BILHETE VENDA INTERNET E IMP. POSTERIOR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > EMPRESA > RESTRINGE VENDA SE RED. Z NAO EMITIDA' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> EMPRESA >> RESTRINGE VENDA SE RED. Z NAO EMITIDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > ESCOLA' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> ESCOLA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > ESTADO' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> ESTADO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > FORMA DE PAGAMENTO' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> FORMA DE PAGAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > GRUPO DE LINHA' WHERE NOMBFUNCION = 'ADM >> CATALOGOS > GRUPO DE LINHA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > MARCAS' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> MARCAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > MOEDA' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> MOEDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > PONTO DE VENDA' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> PONTO DE VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > REGIAO METROPOLITANA' WHERE NOMBFUNCION = 'ADM >> CATALOGOS > REGIAO METROPOLITANA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > TIPO DE CLASSE' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> TIPO DE CLASSE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > TIPO DE FECHAMENTO DE CAIXA' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> TIPO DE FECHAMENTO DE CAIXA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > TIPO DE PASSAGEIRO' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> TIPO DE PASSAGEIRO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > TIPO DE SERVICO' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> TIPO DE SERVIÇO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > TIPO DE VENDA' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> TIPO DE VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > TURNO' WHERE NOMBFUNCION = 'ADM > CATALOGOS >> TURNO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > CONTAS MD' WHERE NOMBFUNCION = 'ADM > CAT�LOGOS >> CONTAS MD'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PASSAGEIRO FREQUENTE > CLIENTE > CADASTRO DE CLIENTE' WHERE NOMBFUNCION = 'ADM > CLIENTE >> CADASTRO DE CLIENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PASSAGEIRO FREQUENTE > CARTEIRA ESCOLAR' WHERE NOMBFUNCION = 'ADM > CLIENTE >> CARTEIRA ESCOLAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > TIPO INFORMATIVO' WHERE NOMBFUNCION = 'ADM > COMISSAO >> TIPO INFORMATIVO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > CALCULO COMISSAO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO >> CALCULO COMISSAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > CONFERENCIA MOVIMENTO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO >> CONFERENCIA MOVIMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > CONFERENCIA MOVIMENTO > ENCERRAR MOVIMENTODIARIO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO >> CONFERENCIA MOVIMENTO >> ENCERRAR MOVIMENTODIARIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > CONFERENCIA MOVIMENTO > ENCERRAR MOVIMENTODIARIO COM PENDENCIAS' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO >> CONFERENCIA MOVIMENTO >> ENCERRAR MOVIMENTODIARIO COM PENDENCIAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > CONFERENCIA MOVIMENTO > REABRIR MOVIMENTODIARIO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO >> CONFERENCIA MOVIMENTO >> REABRIR MOVIMENTODIARIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > HISTORICO COMISSAO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO >> HISTORICO COMISSAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > ITEM DESCONTO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO >> ITEM DESCONTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > PAGAMENTO COMISSAO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO >> PAGAMENTO COMISSAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO > RECEBIMENTO MALOTE' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > COMISSAO >> RECEBIMENTO MALOTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO ALERTAS' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> CONFIGURAÇÃO ALERTAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO DE CANCELAMENTO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> CONFIGURAÇÃO DE CANCELAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO DE PRODUTO OU SERVICO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> CONFIGURAÇÃO DE PRODUTO OU SERVIÇO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO DE RESERVAS' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> CONFIGURAÇÃO DE RESERVAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO FERIADO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> CONFIGURAÇÃO FERIADO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO GERAL' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> CONFIGURAÇÃO GERAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO ITEM ADICIONAL PACOTE' WHERE NOMBFUNCION = 'ADM >> CONFIG COMERCIAL >> CONFIGURAÇÃO ITEM ADICIONAL PACOTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO PACOTE' WHERE NOMBFUNCION = 'ADM >> CONFIG COMERCIAL >> CONFIGURAÇÃO PACOTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO TARIFA PACOTE' WHERE NOMBFUNCION = 'ADM >> CONFIG COMERCIAL >> CONFIGURAÇÃO TARIFA PACOTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONFIGURACAO TIPO DE PASSAGEIRO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> CONFIGURAÇÃO TIPO DE PASSAGEIRO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > CONVENIO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> CONVENIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > EXCEPCION PEAJE' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> EXCEPCION PEAJE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > FECHAMENTO CONTA CORRENTE' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> FECHAMENTO CONTA CORRENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > FECHAMENTO PARAMS CONTA CORRENTE AGENCIA' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> FECHAMENTO PARAMS CONTA CORRENTE AGENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > IMPORTAR CLIENTES' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> IMPORTAR CLIENTES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > IMPRESSAO FISCAL > FORMA PAGO ' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > IMPRESSAO FISCAL >> FORMA PAGO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > IMPRESSAO FISCAL > RELATORIO GERENCIAL ' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > IMPRESSAO FISCAL >> RELATORIO GERENCIAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > IMPRESSAO FISCAL > TOTALIZADORES NAO-FISCAIS ' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > IMPRESSAO FISCAL >> TOTALIZADORES NÃO-FISCAIS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > MOTIVO DEVOLUCAO BILHETE' WHERE NOMBFUNCION = 'ADM >> CONFIG COMERCIAL > MOTIVO DEVOLUCAO BILHETE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > MOTIVO DO CANCELAMENTO > PERMITE ALTERAR MOTIVO CANCELAMENTO PARA EXIBIR NO CANCELAMENTO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL > MOTIVO DO CANCELAMENTO >> PERMITE ALTERAR MOTIVO CANCELAMENTO PARA EXIBIR NO CANCELAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > MOTIVOS DE CANCELAMENTO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> MOTIVOS DE CANCELAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > MOTIVOS DE CANCELAMENTO VENDA PACOTE' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> MOTIVOS DE CANCELAMENTO VENDA PACOTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > MOTIVOS DE REIMPRESSAO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> MOTIVOS DE REIMPRESSÃO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > PRODUCTO OU TERCEIRO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> PRODUCTO OU TERCEIRO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > RESTRICAO DE FORMA PAGAMENTO' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> RESTRIÇÃO DE FORMA PAGAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > SECRETARIA' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> SECRETARIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CONFIG COMERCIAL > TIPO CAMBIO CIDADE' WHERE NOMBFUNCION = 'ADM > CONFIG COMERCIAL >> TIPO CAMBIO CIDADE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CORTESIAS PARA FUNCIONARIOS > ALTA DE CORTESIA POR RH' WHERE NOMBFUNCION = 'ADM > CORTESÍAS >> ALTA DE CORTESÍA POR RH'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CORTESIAS PARA FUNCIONARIOS > CORTESIA DE TIPO DIRETORIA' WHERE NOMBFUNCION = 'ADM > CORTESÍAS >> CORTESIA DE TIPO DIRETORIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CORTESIAS PARA FUNCIONARIOS > DESCONTO POR TIPO DE CORTESIA' WHERE NOMBFUNCION = 'ADM > CORTESÍAS >> DESCONTO POR TIPO DE CORTESIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CORTESIAS PARA FUNCIONARIOS > GRUPO CORTESIAS' WHERE NOMBFUNCION = 'ADM > CORTESÍAS >> GRUPO CORTESÍAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CORTESIAS PARA FUNCIONARIOS > TIPO CORTESIA' WHERE NOMBFUNCION = 'ADM > CORTESÍAS >> TIPO CORTESÍA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > ALIAS LOCALIDADE' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> ALIAS LOCALIDADE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > ATUALIZAR CORRIDA HUSO VERANO' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> ATUALIZAR CORRIDA HUSO VERANO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > CONEXOES' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> CONEXÕES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > CONFIGURACAO DE SERVICOS' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> CONFIGURAÇÃO DE SERVIÇOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > GERACAO DE SERVICO' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> GERAÇÃO DE SERVIÇO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > GERACAO TRECHOS E LINHA' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> GERAÇÃO TRECHOS E LINHA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > LIBERAR' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> LIBERAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > LINHA' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> LINHA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > LOCALIDADES' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> LOCALIDADES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > OCUPAR' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> OCUPAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > PARAMETROS CONEXOES' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> PARAMETROS CONEXÕES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > ROL OPERATIVO' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> ROL OPERATIVO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > SELECIONAR SERVICOS A GERAR' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> SELECIONAR SERVICOS A GERAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > TIPO DE CARRO' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> TIPO DE CARRO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > TIPO LOCALIDADE' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> TIPO LOCALIDADE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > TRECHOS' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> TRECHOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > VEICULOS' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> VEÍCULOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL > VIA' WHERE NOMBFUNCION = 'ADM > ESQUEMA OPERACIONAL >> VIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESTOQUE DE PASSAGEM > BILHETES' WHERE NOMBFUNCION = 'ADM > Estoque de Passagem >> Bilhetes'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESTOQUE DE PASSAGEM > MIGRACAO DE PONTO DE VENDA' WHERE NOMBFUNCION = 'ADM > Estoque de Passagem >> Migração de Ponto de Venda'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESTOQUE DE PASSAGEM > MOVIMENTACAO DE ESTOQUE' WHERE NOMBFUNCION = 'ADM > Estoque de Passagem >> Movimentação de Estoque'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ESTOQUE DE PASSAGEM > MOVIMENTACAO DE ESTOQUE - AGENCIA' WHERE NOMBFUNCION = 'ADM > Estoque de Passagem >> Movimentação de Estoque - Agência'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > EVENTOS EXTRAS > BANCOS' WHERE NOMBFUNCION = 'ADM > EVENTOS EXTRAS >> BANCOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > INFORMES > CATEGORIA VENDA' WHERE NOMBFUNCION = 'ADM > INFORMES >> CATEGORIA VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > INFORMES > PASSAGEIROS POR SERVICO' WHERE NOMBFUNCION = 'ADM > INFORMES >> PASSAGEIROS POR SERVIÇO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > INFORMES > SERVICO DIARIO' WHERE NOMBFUNCION = 'ADM > INFORMES >> SERVI¿O DIARIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > INFORMES > VENDAS PONTO VENDA' WHERE NOMBFUNCION = 'ADM > INFORMES >> VENDAS PONTO VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO' WHERE NOMBFUNCION = 'ADM > INTEGRACION'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PASSAGEIRO FREQUENTE > TIPO DOMICILIO' WHERE NOMBFUNCION = 'ADM > PASAJERO FRECUENTE >> TIPO DOMICILIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PASSAGEIRO FREQUENTE > TIPO OCUPACAO' WHERE NOMBFUNCION = 'ADM > PASAJERO FRECUENTE >> TIPO OCUPAÇÃO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PONTO DE VENDA > COMISSAO > CONTAS' WHERE NOMBFUNCION = 'ADM > PONTO DE VENDA >> COMISSAO >> CONTAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PRICING > MODIFICACAO PRICING ESPECIFICO' WHERE NOMBFUNCION = 'ADM > PRICING >> MODIFICACAO PRICING ESPECIFICO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PRICING > PRICING' WHERE NOMBFUNCION = 'ADM > PRICING >> PRICING'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PRICING > PRICING CLASSE TARIFARIA' WHERE NOMBFUNCION = 'ADM > PRICING >> PRICING CLASSE TARIFARIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PRICING > PRICING ESPECIFICO' WHERE NOMBFUNCION = 'ADM > PRICING >> PRICING ESPECIFICO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > PONTO DE VENDA (AGENCIAS) > EDITAR COMISSAO' WHERE NOMBFUNCION = 'ADM > PUNTO VENTA > EDITAR COMISSAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > PONTO DE VENDA (AGENCIAS) > TIPO BOLETO BLOQUEADO ' WHERE NOMBFUNCION = 'ADM > PUNTO VENTA > TIPO BOLETO BLOQUEADO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RECEITA/DESPESA > TIPOS DE RECEITA / DESPESA' WHERE NOMBFUNCION = 'ADM > RECEITA-DESPESA >> TIPOS DE RECEITA / DESPESA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS' WHERE NOMBFUNCION = 'ADM > RELATORIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > VENDA PTA' WHERE NOMBFUNCION = 'ADM > RELATORIO >> FINANCEIRO >>> VENDA PTA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > VENDAS COM PARCELAMENTO' WHERE NOMBFUNCION = 'ADM > RELATORIO >> FINANCEIRO >>> VENDAS COM PARCELAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > HISTORICO CLIENTES' WHERE NOMBFUNCION = 'ADM > RELATORIO >> HISTORICO CLIENTES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO > IMPRESSAO FISCAL ' WHERE NOMBFUNCION = 'ADM > RELATORIO > IMPRESSAO FISCAL >> IMPORTACION FISCAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > IMPRESSAO POSTERIOR' WHERE NOMBFUNCION = 'ADM > RELATORIO >> IMPRESS�O POSTERIOR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > PASSAGEIROS A VIAJAR' WHERE NOMBFUNCION = 'ADM > RELATORIO >> PASSAGEIROS A VIAJAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > ACOMPANHAMENTO EQUIVALENTES' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> ACOMPANHAMENTO EQUIVALENTES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > AGENCIAS NAO IMPORTADAS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> AGENCIAS NAO IMPORTADAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIO ESTOQUE' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> AIDF Detalhado'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO > AIDF' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> AIDF POR EMPRESA E NUMERO SERIE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS OPERACIONAIS > APROVEITAMENTO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> APROVEITAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO >BGM > ARQUIVO BGM' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> ARQUIVO BGM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > BAIXAS VENDAS INTERNET' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> BAIXAS VENDAS INTERNET'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > BILHTES VENDIDOS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> BILHTES VENDIDOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > CANCELAMENTO AUTOMATICO ECF' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> Cancelamento Autom�tico ECF'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > CANCELAMENTO DE PASSAGENS COM CARTAO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> CANCELAMENTO DE PASSAGENS COM CARTAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > CANCELAMENTO J3 ' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> CANCELAMENTO DE TRANSACAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > PASSAGEIRO FREQUENTE > CARTEIRINHA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> CARTEIRINHA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > CHECKIN' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> CHECKIN'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > CONSULTA ANTT' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> Consulta ANTT'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS OPERACIONAIS > DEMANDAS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> DEMANDAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > DEPÓSITOS DETALHADOS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> DEPÓSITOS DETALHADOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > VENDAS COM DESCONTO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> DESCONTOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > BILHETES DEVOLVIDOS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> DEVOLUÇÕES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > DIFERENCAS EM TRANSFERENCIAS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> DIFERENÇAS EM TRANSFERÊNCIAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > ESTORNO DE CARTAO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> ESTORNO DE CARTAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO >EXPORTACAO FISCAL' WHERE NOMBFUNCION = 'ADM > RELATORIOS > EXPORTACAO FISCAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > FECHAMENTO CNT / DEPÓSITOS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> FECHAMENTO CNT / DEPÓSITOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > DOCUMENTOS FISCAIS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> FINANCEIRO >> DOCUMENTOS FISCAIS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > GRATUIDADE' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> GRATUIDADE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > GRATUIDADE ANTT' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> GRATUIDADE ANTT'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO > EXPORTACAO FISCAL > IMPRESSAO RMD' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> IMPRESSAO RMD'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS OPERACIONAIS > KM PROGRAMADA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> KM PROGRAMADA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > PASSAGEM POR LINHA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> LINHA OPERACIONAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS OPERACIONAIS > LINHAS POR HORARIO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> LINHAS HORARIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO > BGM > LISTAR ERROS BGM' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> LISTAR ERROS BGM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS OPERACIONAIS >REMARCACAO DE PASSAGENS/TRANSFERENCIA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> OPERACIONAIS >>REMARCAÇÃO DE PASSAGENS TRANSFERÊNCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > RECEITA DIARIA AGENCIA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RECEITA DIARIA AGENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RECEITA DIARIA VENDA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RECEITA DIARIA VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > RECEITA SERVICO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RECEITA SERVICO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > RECEITAS E DESPESAS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RECEITAS E DESPESAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIO CONFERENCIA DE FORMULARIO ' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO CONFERENCIA FORMULARIO FISICO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > RELATORIO DE SERVICO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO CORRIDAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > REMESSA DE LOTE (CNAB 400)' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO DE ARQUIVO REMESSA CNAB'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIO FINANCEIRO > MOVIMENTOS EM ATRASO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO DE MOVIMENTOS EM ATRASO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIO FINANCEIRO > OBSERVACAO BILHETES' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO DE OBSERVAÇÃO BILHETES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIO FINANCEIRO > EVENTOS FINANCEIROS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO DE OBSERVAÇÃO EVENTOS FINANCEIROS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > DESEMPENHO POR SERVICO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO DE ORIGEM E DESTINO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS PACOTE > VENDAS DE PACOTES - BOLETOS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO DE VENDAS DE PACOTES BOLETOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS PACOTE > VENDAS DE PACOTES - DETALHADO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO DE VENDAS DE PACOTES DETALHADO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS PACOTE > VENDAS DE PACOTES - RESUMIDO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO DE VENDAS DE PACOTES RESUMIDO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > VENDAS DE COMISSAO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO DE VENDAS PARA COMISSAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > FINANCEIRO POR GRUPO LINHAS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO FINANCEIRO GRUPO LINHAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > FORMA DE PAGAMENTO POR AGENCIA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO FORMA PAGAMENTO AGENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > MOVIMENTO POR ORGAO CONCEDENTE' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO MOVIMENTO POR ORGAO CONCEDENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > NUMERACAO LOGICA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO NUMERACAO LOGICA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > MOVIMENTO COM OBSERVACAO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO OBSERVACAO CONFERENCIA MOVIMENTOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO > EXPORTACAO FISCAL > RELATORIO RDI ' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO RDI'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RECEITA EMBARCADA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIO RECITA EMBARCADA SERVICO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RELATORIOS FINANCEIROS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS OPERACIONAIS > RESUMO DE LINHAS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> RESUMO DE LINHAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > SEGUNDA VIA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> Segunda Via'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > SERVICO BLOQUEADO NA VENDA INTERNET' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> SERVIÇO BLOQUEADO NA VENDA INTERNET'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > TABELA DE PRECO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> TABELA DE PRECO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > TAXAS' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> TAXAS POR LINHA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > TRECHO POR AGENCIA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> TRECHO VENDIDOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > RESUMO VENDA POR AGENCIA' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> VENDAS AGENCIA FECHAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > VENDAS BILHETEIRO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> VENDAS BILHETEIRO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > VENDAS BILHETEIRO SINTETICO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> VENDAS BILHETEIRO SINTETICO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > VENDAS PERCURSO' WHERE NOMBFUNCION = 'ADM > RELATORIOS >> VENDAS PERCURSO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > REMARCACAO/DEVOLUCAO' WHERE NOMBFUNCION = 'ADM > RELATORIOS>> RELATORIO REMARCACAO/DEVOLUCAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > MENSAGEM' WHERE NOMBFUNCION = 'ADM > SEGURANCA >> MENSAGEM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > PAINEL ECF' WHERE NOMBFUNCION = 'ADM > SEGURANCA >> Painel ECF'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > AUDITORIA' WHERE NOMBFUNCION = 'ADM > SEGURIDAD >> AUDITORIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > AUTORIZACAO PERFIL' WHERE NOMBFUNCION = 'ADM > SEGURIDAD >> AUTORIZAÇÃO PERFIL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > COMPANHIA BANCARIA' WHERE NOMBFUNCION = 'ADM > SEGURIDAD >> COMPANHIA BANCARIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > ESTACAO' WHERE NOMBFUNCION = 'ADM > SEGURIDAD >> ESTAÇÃO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > IMPRESORA FISCAL' WHERE NOMBFUNCION = 'ADM > SEGURIDAD >> IMPRESORA FISCAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > PERFIL' WHERE NOMBFUNCION = 'ADM > SEGURIDAD >> PERFIL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > USUARIO' WHERE NOMBFUNCION = 'ADM > SEGURIDAD >> USUARIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > SESSAO USUARIO' WHERE NOMBFUNCION = 'ADM > SEGURIDAD >> USUARIO SESION'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > INTEGRACAO > SISDAP' WHERE NOMBFUNCION = 'ADM>RELATORIOS>>SISDAP'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > RELATORIOS > EMPRESA CORRIDA' WHERE NOMBFUNCION = 'ADM>REPORTES>>EMPRESA CORRIDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > RELATORIOS > OCD NAO RESGATADAS' WHERE NOMBFUNCION = 'ADM>REPORTES>>OCD NAO RESGATADAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > AIDF' WHERE NOMBFUNCION = 'AIDF'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > ALERTAS . NAO EXISTE SE CADASTRA POR CONF. ALERTAS' WHERE NOMBFUNCION = 'ALERTAS . Nao existe se cadastra por Conf. Alertas'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > ALTA FREQUENCIA' WHERE NOMBFUNCION = 'ALTA FRECUENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > ALTERAR EMBARQUE DESEMBARQUE' WHERE NOMBFUNCION = 'ALTERAR EMBARQUE DESEMBARQUE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > IMPRESSAO FISCAL > ALIQUOTA ECF' WHERE NOMBFUNCION = 'AMD > ADM DE PRECO >> IMPRESSAO FISCAL >> ALIQUOTA ECF'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > ADM DE PRECO > MODIFICACAO MASSIVA ALIAS ' WHERE NOMBFUNCION = 'AMD > ADM DE PRECO >> MODIFICACAO MASSIVA ALIAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > CODIGO BARRAS CURITIBA' WHERE NOMBFUNCION = 'AMD > CATALOGO >> CODIGO BARRAS CURITIBA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > CATALOGOS > GRUPO CATEGORIA' WHERE NOMBFUNCION = 'AMD > CATALOGO >> GRUPO CATEGORIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'ADM > SEGURANCA > AUTORIZACAO PERFIL' WHERE NOMBFUNCION = 'AUTORIZACION'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CANCELAMENTO GRATUIDADE 100 PORCENTO' WHERE NOMBFUNCION = 'CANCELAMENTO GRATUIDADE 100 PORCENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CARTAO DE CREDITO' WHERE NOMBFUNCION = 'CARTAO DE CREDITO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CATALOGO EQUIVAL. CLASSE SERVICO' WHERE NOMBFUNCION = 'CATALOGO EQUIVAL. CLASE SERVICIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CATALOGO EQUIVAL. EMPRESA' WHERE NOMBFUNCION = 'CATALOGO EQUIVAL. EMPRESA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CATALOGO EQUIVAL. MOTIVO CANCELAMENTO' WHERE NOMBFUNCION = 'CATALOGO EQUIVAL. MOTIVO CANCELACIÓN'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CATALOGO EQUIVAL. PARADA' WHERE NOMBFUNCION = 'CATALOGO EQUIVAL. PARADA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CATALOGOS > PARAMETROS OCD' WHERE NOMBFUNCION = 'CATALOGOS > PARAMETROS OCD'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CATALOGOS DE EQUIVALENCIA' WHERE NOMBFUNCION = 'CATALOGOS DE EQUIVALENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CHECKIN' WHERE NOMBFUNCION = 'CHECKIN'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CHECKIN - REATIVAR PASSAGEM' WHERE NOMBFUNCION = 'CHECKIN - REATIVAR PASSAGEM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CLIENTE PASSAGEIRO FREQUENTE' WHERE NOMBFUNCION = 'CLIENTEPASAJEROFRECUENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > COEFICIENTE TARIFA' WHERE NOMBFUNCION = 'COEFICIENTE TARIFA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > COMISIONISTA EXTERNO' WHERE NOMBFUNCION = 'COMISIONISTA EXTERNO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > COMPRA PUNTOS PASSAGEIRO FREQUENTE' WHERE NOMBFUNCION = 'COMPRAPUNTOSPASAJEROFRECUENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CONFIGURAR RESTRICAO DE CANAL DE VENDA' WHERE NOMBFUNCION = 'CONFIGURAR RESTRI¿¿O DE CANAL DE VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CONSULTAM CORRIDAS ANTERIORES' WHERE NOMBFUNCION = 'CONSULTAM CORRIDAS ANTERIORES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CONSULTAM CORRIDAS ANTERIORES MANUAL' WHERE NOMBFUNCION = 'CONSULTAM CORRIDAS ANTERIORES MANUAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CONSULTAM CORRIDAS ANTERIORES NAO IMPRIME' WHERE NOMBFUNCION = 'CONSULTAM CORRIDAS ANTERIORES NAO IMPRIME'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CONTA CORRENTE AGENCIA' WHERE NOMBFUNCION = 'CONTA CORRENTE AGENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CONTA CORRENTE AGENCIA > FECHAMENTO CONTA CORRENTE' WHERE NOMBFUNCION = 'CONTA CORRENTE AGENCIA > FECHAMENTO CONTA CORRENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > CUPOM CONVENIO' WHERE NOMBFUNCION = 'CUPONCONVENIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > DEPOSITOS' WHERE NOMBFUNCION = 'DEPOSITOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > DIGITACAO' WHERE NOMBFUNCION = 'DIGITACAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > ENTREGAR BOLETO FORA DO INTERVALO' WHERE NOMBFUNCION = 'ENTREGAR BOLETO FORA DO INTERVALO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > ESTADO CONTA PASSAGEIRO FREQUENTE' WHERE NOMBFUNCION = 'ESTADOCUENTAPASAJEROFRECUENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > EXCLUIR SEGURO OPCIONAL' WHERE NOMBFUNCION = 'EXCLUIR SEGURO OPCIONAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > FECHAMENTO CONTA CORRENTE' WHERE NOMBFUNCION = 'FECHAMENTO CONTA CORRENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > FECHAMENTO CONTA CORRENTE > GERACAO AUTOMATICA' WHERE NOMBFUNCION = 'FECHAMENTO CONTA CORRENTE > GERACAO AUTOMATICA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > FECHAMENTO CONTA CORRENTE > REGERAR BOLETO' WHERE NOMBFUNCION = 'FECHAMENTO CONTA CORRENTE > REGERAR BOLETO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > GENERAR ARCHIVOS' WHERE NOMBFUNCION = 'GENERAR ARCHIVOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > GERAR CHECKIN' WHERE NOMBFUNCION = 'GERAR CHECKIN'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > HABILATAR FECHAMENTO AUTOMATICO CAIXA USUARIO' WHERE NOMBFUNCION = 'HABILATAR FECHAMENTO AUTOMATICO CAIXA USUARIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > HABILITAR BOTAO DE TROCA DE TITULARIDADE' WHERE NOMBFUNCION = 'HABILITAR BOTAO DE TROCA DE TITULARIDADE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > HABILITAR BOTAO DE VENDA EM PE' WHERE NOMBFUNCION = 'HABILITAR BOTAO DE VENDA EM PE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > HABILITAR FILTROS BUSCA/PAGAMENTO OCD' WHERE NOMBFUNCION = 'HABILITAR FILTROS BUSCA/PAGAMENTO OCD'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > HABILITAR NOVO CLIENTE' WHERE NOMBFUNCION = 'HABILITAR NOVO CLIENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > HABILITAR OCD' WHERE NOMBFUNCION = 'HABILITAR OCD'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > HABILITAR REIMPRESSAO OCD' WHERE NOMBFUNCION = 'HABILITAR REIMPRESSAO OCD'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > IDENTIFICACAO DE FRAUDE' WHERE NOMBFUNCION = 'IDENTIFICACIONFRAUDES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > IMPORTAR VENDAS' WHERE NOMBFUNCION = 'IMPORTAR VENTAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > LAYOUT IMPRESSAO' WHERE NOMBFUNCION = 'LAYOUT IMPRESSAO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > LIBERAR RESTRICAO CHECKIN' WHERE NOMBFUNCION = 'LIBERAR RESTRIÇÃO CHECKIN'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > LIMITAR PESQUISA RELATORIO TIPO 2 CONTA CORRENTE' WHERE NOMBFUNCION = 'LIMITAR PESQUISA RELATORIO TIPO 2 CONTA CORRENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > MENU RELATORIOS' WHERE NOMBFUNCION = 'MENU INFORMES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > ORGAO CONCEDENTE' WHERE NOMBFUNCION = 'ORGAO CONCEDENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PAGAMENTO DE MOTORISTA' WHERE NOMBFUNCION = 'Pago Conductor'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PAGO INTER EMPRESA' WHERE NOMBFUNCION = 'PAGOINTEREMPRESA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PERIODO FERIAS' WHERE NOMBFUNCION = 'PERIODO VACACIONAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PERMITE CHECKIN ANTECIPADO' WHERE NOMBFUNCION = 'PERMITE CHECKIN ANTECIPADO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PERMITE ENCERRAR CHECKIN' WHERE NOMBFUNCION = 'PERMITE ENCERRAR CHECKIN'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PERMITIR LANCAMENTO CONTA CORRENTE' WHERE NOMBFUNCION = 'PERMITIR LANCAMENTO CONTA CORRENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > AGRUPAMENTO SERVICOS' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> AGRUPAMENTO SERVICIOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > ALTERAR ROLOPERATIVO' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> ALTERAR ROLOPERATIVO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > ASIGNARASIENTO' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> ASIGNARASIENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > CANCELARCORRIDA' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> CANCELARCORRIDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > DELETAR SERVICO' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> DELETAR SERVICO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > EDITARITINERARIO' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> EDITARITINERARIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > INFO EXTRA' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> INFO EXTRA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > MAPA VIAJEM' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> MAPA VIAJEM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > MODIFICARHORARIO' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> MODIFICARHORARIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > REACTIVARCORRIDA' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> REACTIVARCORRIDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > SERVICO EXTRA' WHERE NOMBFUNCION = 'PESQUISA DE SERVIÇOS > BOTAO >> SERVICIO EXTRA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > REDONDEO MARCA' WHERE NOMBFUNCION = 'REDONDEO MARCA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > REGISTRO NOTA REMISION' WHERE NOMBFUNCION = 'REGISTRO NOTA REMISION'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > RELATORIOS CHECKIN PASSAGEM' WHERE NOMBFUNCION = 'RELATORIOS CHECKIN PASSAGEM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > REMOVER LIMITE PESQUISA RELATORIO TIPO 2 CONTA CORRENTE' WHERE NOMBFUNCION = 'REMOVER LIMITE PESQUISA RELATORIO TIPO 2 CONTA CORRENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > SISTEMA' WHERE NOMBFUNCION = 'SISTEMA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > TESTE' WHERE NOMBFUNCION = 'TESTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > TEMPO AIRE' WHERE NOMBFUNCION = 'TIEMPO AIRE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > TIPO DE PONTO DE VENDA' WHERE NOMBFUNCION = 'TIPO DE PONTO DE VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > TIPO MOVIMIENTO' WHERE NOMBFUNCION = 'TIPO MOVIMIENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO > TIPOCONVENIO' WHERE NOMBFUNCION = 'TIPOCONVENIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ADMIVO > RELATORIO VENDAS' WHERE NOMBFUNCION = 'VDA > ADMIVO >> RELATORIO VENDAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AVISOS > GERACAO DE AVISOS' WHERE NOMBFUNCION = 'VDA > AVISOS >> GERAÇÃO DE AVISOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CAIXA > CONSULTA DE BILHETES > IMPRIMIR CUPOM' WHERE NOMBFUNCION = 'VDA > CAIXA >> CONSULTA DE BILHETES >> IMPRIMIR CUPOM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CAIXA > CONSULTA DE BILHETES > TROCA TITULARIDADE' WHERE NOMBFUNCION = 'VDA > CAIXA >> CONSULTA DE BILHETES >> TROCA TITULARIDADE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CAIXA > DETALHE DE CAIXA > PERMITE TODOS BILHETEIROS' WHERE NOMBFUNCION = 'VDA > CAIXA > DETALHE DE CAIXA > PERMITE TODOS BILHETEIROS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CAIXA > FECHAMENTO CNT > SELECIONAR PTO VTA' WHERE NOMBFUNCION = 'VDA > CAIXA >> FECHAMENTO CNT >> SELECIONAR PTO VTA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CAIXA > HABILITAR REIMPRESSAO FECHAMENTO CAIXA' WHERE NOMBFUNCION = 'VDA > CAIXA > HABILITAR REIMPRESSAO FECHAMENTO CAIXA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CAIXA > LISTAR TODAS AGENCIAS' WHERE NOMBFUNCION = 'VDA > CAIXA > LISTAR TODAS AGÊNCIAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CANCELACION > DEVOLUCAO CONTINGENCIA' WHERE NOMBFUNCION = 'VDA > CANCELACION >> DEVOLUCION CONTINGENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CANCELAMENTO > PERMITE CANCELAMENTO APOS SAIDA DO VEICULO' WHERE NOMBFUNCION = 'VDA > CANCELAMENTO >> PERMITE CANCELAMENTO APOS SAIDA DO VEICULO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CHECKIN > CHECKIN AUTOMATICO' WHERE NOMBFUNCION = 'VDA > CHECKIN > CHECKIN AUTOMATICO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CONTA CORRENTE > HABILITAR TODAS AGENCIAS' WHERE NOMBFUNCION = 'VDA > CONTA CORRENTE >> HABILITAR TODAS AGENCIAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CRIACAO DE CORRIDA EXTRA > CRIAR CORRIDA EXTRA' WHERE NOMBFUNCION = 'VDA > CRIAÇÃO DE CORRIDA EXTRA >> CRIAR CORRIDA EXTRA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > DEPOSITOS > PERMISSAO PARA ALTERAR LANCAMENTOS' WHERE NOMBFUNCION = 'VDA > DEPOSITOS >> PERMISSÃO PARA ALTERAR LANÇAMENTOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > DISPLAY > DISPLAY CHEGADA' WHERE NOMBFUNCION = 'VDA > DISPLAY >> DISPLAY CHEGADA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > DISPLAY > DISPLAY GUICHE' WHERE NOMBFUNCION = 'VDA > DISPLAY >> DISPLAY GUICHÊ'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > DISPLAY > DISPLAY SAIDA' WHERE NOMBFUNCION = 'VDA > DISPLAY >> DISPLAY SAÍDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > DISPLAY > EDITAR DISPLAY DE CHEGADA ' WHERE NOMBFUNCION = 'VDA > DISPLAY >> EDITAR DISPLAY DE CHEGADA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > DISPLAY > EDITAR DISPLAY DE SAIDA' WHERE NOMBFUNCION = 'VDA > DISPLAY >> EDITAR DISPLAY DE SAÍDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > DISPLAY > PONTO PUBLICACAO' WHERE NOMBFUNCION = 'VDA > DISPLAY >> PONTO PUBLICAÇÃO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE > REQUISISAO > SELECIONAR PTO VTA' WHERE NOMBFUNCION = 'VDA > ESTOQUE >> REQUISI��O >> SELECIONAR PTO VTA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE BILHETE > REATIVAR BILHETE' WHERE NOMBFUNCION = 'VDA > ESTOQUE BILHETE >> REATIVAR BILHETE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS > BAIXA DE ESTOQUE' WHERE NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS >> BAIXA DE ESTOQUE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS > HABILITA PONTO DE VENDA' WHERE NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS >> HABILITA PONTO DE VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS > LIBERACAO DE BILHETES' WHERE NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS >> LIBERACAO DE BILHETES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS > REGISTRO DE USUARIOS' WHERE NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS >> REGISTRO DE USUARIOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS > REQUISICAO DE BILHETES' WHERE NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS >> REQUISIÇÃO DE BILHETES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS > TROCA DE ESTOQUE' WHERE NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS >> TROCA DE ESTOQUE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS> ATUALIZAR PREIMPRESO' WHERE NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS>> ATUALIZAR PREIMPRESO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE PASSAGEM > CONSULTA ESTOQUE' WHERE NOMBFUNCION = 'VDA > ESTOQUE PASSAGEM >> CONSULTA ESTOQUE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA > CONSULTA BOLETO' WHERE NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA >> CONSULTA BOLETO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA > DETALHE PREVIO CAIXA' WHERE NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA >> DETALHE PREVIO CAIXA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA > FECHAMENTO DE CAIXA' WHERE NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA >> FECHAMENTO DE CAIXA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA > FECHAMENTO DE CAIXA OUTROS BILH' WHERE NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA >> FECHAMENTO DE CAIXA OUTROS BILH'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA > RETIRADAS' WHERE NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA >> RETIRADAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA > TROCO' WHERE NOMBFUNCION = 'VDA > FECHAMENTO DE CAIXA >> TROCO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > GRC > CLIENTE COMPRADOR' WHERE NOMBFUNCION = 'VDA > GRC >> CLIENTE COMPRADOR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > MANUTENCAO > COTAS > LIBERAR' WHERE NOMBFUNCION = 'VDA >> MANUTENÇÃO >> COTAS >> LIBERAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > MANUTENCAO > COTAS > OCUPAR' WHERE NOMBFUNCION = 'VDA >> MANUTENÇÃO >> COTAS >> OCUPAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > MANUTENCAO DE SERVICOS > AGRUPACAO DE SERVICOS' WHERE NOMBFUNCION = 'VDA > MANUTENÇÃO DE SERVIÇOS >> AGRUPAÇÃO DE SERVIÇOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > MANUTENCAO DE SERVICOS > MODIFICACOES DE SERVICO > INICIADO/FECHADO' WHERE NOMBFUNCION = 'VDA > MANUTENÇÃO DE SERVIÇOS >> MODIFICAÇÕES DE SERVIÇO >>> INICIADO/FECHADO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > MANUTENCAO DE SERVICOS > PESQUISA DE SERVICOS' WHERE NOMBFUNCION = 'VDA > MANUTENÇÃO DE SERVIÇOS >> PESQUISA DE SERVIÇOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > MAPA DE VIAGEM > MAPA DE VIAGEM' WHERE NOMBFUNCION = 'VDA > MAPA DE VIAGEM >> MAPA DE VIAGEM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > MAPA DE VIAGEM>BLOQUEO LOCALIDADE PARA VENDA' WHERE NOMBFUNCION = 'VDA > MAPA DE VIAGEM>BLOQUEO LOCALIDADE PARA VENDA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > RECEITA / DESPESA > FECHAMENTO DO DIA' WHERE NOMBFUNCION = 'VDA > RECEITA / DESPESA >> FECHAMENTO DO DIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > RECEITA / DESPESA > REGISTRO RECEITA / DESPESA' WHERE NOMBFUNCION = 'VDA > RECEITA / DESPESA >> REGISTRO RECEITA / DESPESA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > RECEITA / DESPESA > REIMPRESSAO RELATORIA DE VENDAS' WHERE NOMBFUNCION = 'VDA > RECEITA / DESPESA >> REIMPRESSÃO RELATORIA DE VENDAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > RECEITA/DESPESA > APAGAR' WHERE NOMBFUNCION = 'VDA > RECEITA/DESPESA >> APAGAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > SOBRE > VERIFICAR PINPAD' WHERE NOMBFUNCION = 'VDA > SOBRE >> VERIFICAR PINPAD'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > CALL CENTER' WHERE NOMBFUNCION = 'VDA > VENDA >> CALL CENTER'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > CANCELAMENTO' WHERE NOMBFUNCION = 'VDA > VENDA >> CANCELAMENTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > CONFIRMA ABERTO' WHERE NOMBFUNCION = 'VDA > VENDA >> CONFIRMA ABERTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > CONFIRMACAO RESERVA' WHERE NOMBFUNCION = 'VDA > VENDA >> CONFIRMAÇÃO RESERVA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > CONSULTA PAGAMENTO CARTAO' WHERE NOMBFUNCION = 'VDA > VENDA >> CONSULTA PAGAMENTO CARTÃO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > ENTREGA ABERTO' WHERE NOMBFUNCION = 'VDA > VENDA >> ENTREGA ABERTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > ENTREGA PASSAGEM' WHERE NOMBFUNCION = 'VDA > VENDA >> ENTREGA PASSAGEM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > ENTREGA PASSAGEM > BLOQUEIO PTA' WHERE NOMBFUNCION = 'VDA > VENDA >> ENTREGA PASSAGEM >>> BLOQUEIO PTA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > ENTREGA PASSAGEM > UTILIZAR PTA BLOQUEADO' WHERE NOMBFUNCION = 'VDA > VENDA >> ENTREGA PASSAGEM >>> UTILIZAR PTA BLOQUEADO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > PASSAGEM EM ABERTO' WHERE NOMBFUNCION = 'VDA > VENDA >> PASSAGEM EM ABERTO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > PASSAGEM EXTRAVIADA' WHERE NOMBFUNCION = 'VDA > VENDA >> PASSAGEM EXTRAVIADA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > REIMPRESSAO VOUCHER' WHERE NOMBFUNCION = 'VDA > VENDA >> REIMPRESSÃO VOUCHER'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > REIMPRESSAO DE PASSAGEM' WHERE NOMBFUNCION = 'VDA > VENDA >> REIMPRESS¿O DE PASSAGEM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > RESERVA PASSAGEM' WHERE NOMBFUNCION = 'VDA > VENDA >> RESERVA PASSAGEM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > TERMO RECUSA COMPLETO' WHERE NOMBFUNCION = 'VDA > VENDA >> TERMO RECUSA COMPLETO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > TRANSFERENCIA' WHERE NOMBFUNCION = 'VDA > VENDA >> TRANSFERENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > TROCA DE PASSAGEM' WHERE NOMBFUNCION = 'VDA > VENDA >> TROCA DE PASSAGEM'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > VENDA ABERTO PRE PAGO' WHERE NOMBFUNCION = 'VDA > VENDA >> VENDA ABERTO PRE PAGO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > VENDA EM ABERTO MANUAL' WHERE NOMBFUNCION = 'VDA > VENDA >> VENDA EM ABERTO MANUAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > VENDA IMPRESSAO POSTERIOR' WHERE NOMBFUNCION = 'VDA > VENDA >> VENDA IMPRESSÃO POSTERIOR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > VENDA MANUAL' WHERE NOMBFUNCION = 'VDA > VENDA >> VENDA MANUAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > VENDA NORMAL' WHERE NOMBFUNCION = 'VDA > VENDA >> VENDA NORMAL'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > VENDA > VENDA PARA AGENCIA' WHERE NOMBFUNCION = 'VDA > VENDA >> VENDA PARA AGENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > SITEF > MENU SITEF' WHERE NOMBFUNCION = 'VDA> SITEF>> MENU SITEF'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CAIXA > OPERACOES CAIXA' WHERE NOMBFUNCION = 'VDA>CAIXA> OPERAÇÕES CAIXA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CLIENTE > CADASTRO DE CLIENTE' WHERE NOMBFUNCION = 'VDA>CLIENTE>>CADASTRO DE CLIENTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CRIACAO DE CORRIDA EXT SIMILAR > CRIAR CORRIDA EXT SIMILAR' WHERE NOMBFUNCION = 'VDA>CRIAÇÃO DE CORRIDA EXT SIMILAR>CRIAR CORRIDA EXT SIMILAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VENDA EMBARCADA > BAIXAR VENDAS' WHERE NOMBFUNCION = 'VENDA EMBARCADA > BAIXAR VENDAS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VENDA EMBARCADA > CONFIGURACOES' WHERE NOMBFUNCION = 'VENDA EMBARCADA > CONFIGURAÇÕES'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VENDA EMBARCADA > HABILITAR IMPRESSORA' WHERE NOMBFUNCION = 'VENDA EMBARCADA > HABILITAR IMPRESSORA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VENDA EMBARCADA > IMPRIMIR' WHERE NOMBFUNCION = 'VENDA EMBARCADA > IMPRIMIR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VENDA EMBARCADA > SINCRONIZAR' WHERE NOMBFUNCION = 'VENDA EMBARCADA > SINCRONIZAR'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > PAGAMENTO OCD' WHERE NOMBFUNCION = 'VENTA > PAGAMENTO OCD'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > AUTORIZACAO >VENTA A DOMICILIO' WHERE NOMBFUNCION = 'VENTA A DOMICILIO'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ADMIVO > REGISTRO DE AJUSTE' WHERE NOMBFUNCION = 'VTA > ADMIVO >> REGISTRO DE AJUSTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > CANCELAMENTO > CANCELAR AGENCIA' WHERE NOMBFUNCION = 'VTA > CANCELAMENTO > CANCELAR AGENCIA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > ESTOQUE DE PASSAGENS > VISUALIZAR TODOS ESTOQUES TODOS PTVTA' WHERE NOMBFUNCION = 'VTA > ESTOQUE DE PASSAGENS >> VISUALIZAR TODOS ESTOQUES TODOS PTVTA'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > EVENTOS EXTRAS > CIERRE DE DIA OI' WHERE NOMBFUNCION = 'VTA > EVENTOS EXTRAS >> CIERRE DE DIA OI'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > EVENTOS EXTRAS > REGISTRO DE AJUSTE' WHERE NOMBFUNCION = 'VTA > EVENTOS EXTRAS >> REGISTRO DE AJUSTE'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > FECHAMENTO CAIXA > RELATORIOS PREDETERMINADOS' WHERE NOMBFUNCION = 'VTA > FECHAMENTO CAIXA >> RELATORIOS PREDETERMINADOS'; + UPDATE FUNCION_SISTEMA SET NOMBFUNCION = 'VDA > SITEFF > ACESSO_MENU_SITEF' WHERE NOMBFUNCION = 'VTA>SITEFF>>ACESSO_MENU_SITEF'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180416_1436__mantis10906.sql b/src/db/migration/migration/V20180416_1436__mantis10906.sql new file mode 100644 index 000000000..6dbf5a106 --- /dev/null +++ b/src/db/migration/migration/V20180416_1436__mantis10906.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CTRL_SERIE_BPE ( + CTRLSERIEBPE_ID NUMBER(7) NOT NULL, + NUMSERIE VARCHAR(3) NULL, + EMPRESA_ID NUMBER(7) NULL, + ESTADO_ID NUMBER(7) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + ACTIVO NUMBER(1) NULL, + PRIMARY KEY (CTRLSERIEBPE_ID), + FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA, + FOREIGN KEY (ESTADO_ID) REFERENCES ESTADO + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE "CTRL_SERIE_BPE_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 ORDER NOCACHE NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180416_1630__mantis10901.sql b/src/db/migration/migration/V20180416_1630__mantis10901.sql new file mode 100644 index 000000000..e22578420 --- /dev/null +++ b/src/db/migration/migration/V20180416_1630__mantis10901.sql @@ -0,0 +1,23 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (CNAE VARCHAR2(7))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (TARBPE VARCHAR2(20))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (CRTBPE NUMBER(1))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180417_1534__mantis10906.sql b/src/db/migration/migration/V20180417_1534__mantis10906.sql new file mode 100644 index 000000000..7d062cbe9 --- /dev/null +++ b/src/db/migration/migration/V20180417_1534__mantis10906.sql @@ -0,0 +1,23 @@ +DECLARE + type vEstados is varray(27) of varchar2(2); + estados vEstados; + nomSeq VARCHAR2(200); + qtdeTotal INTEGER; + object_exists exception; + pragma exception_init (object_exists , -00955); +BEGIN + estados := vEstados('AC', 'AL', 'AM', 'AP', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MG', 'MS', 'MT', 'PA', 'PB', 'PE', 'PI', 'PR', 'RJ', 'RN', 'RO', 'RR', 'RS', 'SC', 'SE', 'SP', 'TO'); + qtdeTotal := estados.count; + FOR EMP IN (SELECT EMPRESA_ID FROM EMPRESA WHERE ACTIVO = 1 AND EMPRESA_ID > 0) + LOOP + FOR i in 1 .. qtdeTotal LOOP + BEGIN + SELECT SEQUENCE_NAME INTO nomSeq from DBA_SEQUENCES where SEQUENCE_owner = (select user from dual) AND SEQUENCE_NAME like 'FOLIO_SISTEMA_BPE_' || estados(i) || '_' || EMP.EMPRESA_ID || '_SEQ%'; + EXCEPTION WHEN NO_DATA_FOUND THEN + EXECUTE IMMEDIATE 'CREATE SEQUENCE ' || 'FOLIO_SISTEMA_BPE_' || estados(i) || '_' || EMP.EMPRESA_ID || '_SEQ MINVALUE 1 MAXVALUE 999999999 INCREMENT BY 1 START WITH 1 ORDER NOCACHE CYCLE'; + END; + END LOOP; + END LOOP; + EXCEPTION WHEN object_exists THEN NULL; +END; + diff --git a/src/db/migration/migration/V20180417_1757__mantis10933.sql b/src/db/migration/migration/V20180417_1757__mantis10933.sql new file mode 100644 index 000000000..d0d802851 --- /dev/null +++ b/src/db/migration/migration/V20180417_1757__mantis10933.sql @@ -0,0 +1,190 @@ +/* + * Script para padroniza��o dos n�meros de telefone salvos na tela de cliente. + */ + +/* telefone celular: + * adi��o do d�gito 9 + */ + +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate + 'UPDATE CLIENTE SET NUMTELEFONODOS = ''(__)_____-____'' + WHERE NUMTELEFONODOS IS NULL + OR NUMTELEFONODOS = ''(__)____-____'''; + exception when ja_existe then null; +end; +/ + +/* exemplo: (27) 3019-1643 + -> (27)93019-1643 */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMTELEFONODOS = (SUBSTR(NUMTELEFONODOS,0,4) || ''9'' || SUBSTR(NUMTELEFONODOS,6,10)) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID FROM CLIENTE WHERE LENGTH( NUMTELEFONODOS) = 14 + AND SUBSTR(NUMTELEFONODOS,0,1) = ''('' + AND SUBSTR(NUMTELEFONODOS,4,1) = '')'' + AND NUMTELEFONODOS != ''(__)_____-____'')'; + exception when ja_existe then null; +end; +/ + +/* exemplo: (77)7777-7777 + ->(77)97777-7777 */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMTELEFONODOS = (SUBSTR(NUMTELEFONODOS,0,4) || ''9'' | |SUBSTR(NUMTELEFONODOS,5,9)) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID + FROM CLIENTE WHERE LENGTH( NUMTELEFONODOS) = 13 + AND SUBSTR(NUMTELEFONODOS,0,1) = ''('' + AND SUBSTR(NUMTELEFONODOS,4,1) = '')'' + AND NUMTELEFONODOS != ''(__)____-____'')'; + exception when ja_existe then null; +end; +/ + +/* exemplo: (063)9840-49688 + ->(63)98404-9688 */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMTELEFONODOS = (''('' || SUBSTR(NUMTELEFONODOS,3,2) || '')'' || SUBSTR(NUMTELEFONODOS,6,4) || SUBSTR(NUMTELEFONODOS,11,1) || ''-'' || SUBSTR(NUMTELEFONODOS,12,4) ) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID + FROM CLIENTE WHERE LENGTH( NUMTELEFONODOS) = 15 + AND SUBSTR(NUMTELEFONODOS,0,1) = ''('' + AND SUBSTR(NUMTELEFONODOS,5,1) = '')'')'; + exception when ja_existe then null; +end; +/ + +/*exemplo: (011)1111-1111 + ->(31)91111-1111 */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMTELEFONODOS = (''('' || SUBSTR(NUMTELEFONODOS,3,2) || '')'' || 9 || SUBSTR(NUMTELEFONODOS,6,9) ) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID + FROM CLIENTE WHERE LENGTH( NUMTELEFONODOS) = 14 + AND SUBSTR(NUMTELEFONODOS,0,1) = ''('' + AND SUBSTR(NUMTELEFONODOS,5,1) = '')'')'; + exception when ja_existe then null; +end; +/ + +/* telefone fixo: + * remo��o 3� digito a esquerda DDD, remo��o do 9� d�gito que deve ser celular + * apenas e corre��o dos digitos depois do h�fen de 5 para 4 */ + +/* +exemplo: (011)9111-11111 + ->(11)91111-1111 */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMTELEFONO = (''('' || SUBSTR(NUMTELEFONO,3,2) || '')'' || SUBSTR(NUMTELEFONO,6,4) || SUBSTR(NUMTELEFONO,11,1) || ''-'' || SUBSTR(NUMTELEFONO,12,4) ) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID + FROM CLIENTE WHERE LENGTH( NUMTELEFONO) = 15 + AND SUBSTR(NUMTELEFONO,0,1) = ''('' + AND SUBSTR(NUMTELEFONO,5,1) = '')'')'; + exception when ja_existe then null; +end; +/ + +/* +exemplo: (111)1111-1111 + ->(11)1111-1111 */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMTELEFONO = (''('' || SUBSTR(NUMTELEFONO,3,2) || '')'' || SUBSTR(NUMTELEFONO,7,3) || SUBSTR(NUMTELEFONO,11,1) || ''-'' || SUBSTR(NUMTELEFONO,12,4) ) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID + FROM CLIENTE WHERE LENGTH( NUMTELEFONO) = 14 + AND SUBSTR(NUMTELEFONO,0,1) = ''('' + AND SUBSTR(NUMTELEFONO,5,1) = '')'')'; + exception when ja_existe then null; +end; +/ + +/* + * exemplo: (06)1303-64579 + * (06)3036-4579 + */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMTELEFONO = SUBSTR(NUMTELEFONO,0,4) || SUBSTR(NUMTELEFONO,7,3) || SUBSTR(NUMTELEFONO,11,1) || ''-'' || SUBSTR(NUMTELEFONO,12,4) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID + FROM CLIENTE WHERE LENGTH( NUMTELEFONO) = 15 + AND SUBSTR(NUMTELEFONO,0,1) = ''('' + AND SUBSTR(NUMTELEFONO,4,1) = '')'' + AND SUBSTR(NUMTELEFONO,10,1) = ''-'')'; + exception when ja_existe then null; +end; +/ + +/* +exemplo: (11)98866-7318 + ->(11)8866-7318 +*/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMTELEFONO = SUBSTR(NUMTELEFONO,0,4) || SUBSTR(NUMTELEFONO,7,4) || ''-'' || SUBSTR(NUMTELEFONO,12,4) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID + FROM CLIENTE WHERE LENGTH( NUMTELEFONO) = 15 + AND SUBSTR(NUMTELEFONO,0,1) = ''('' + AND SUBSTR(NUMTELEFONO,4,1) = '')'' + AND SUBSTR(NUMTELEFONO,11,1) = ''-'')'; + exception when ja_existe then null; +end; +/ + +/* + * fax + */ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMFAX = (''('' || SUBSTR(NUMFAX,3,2) || '')'' || SUBSTR(NUMFAX,6,4) || SUBSTR(NUMFAX,11,1) || ''-'' || SUBSTR(NUMFAX,12,4) ) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID + FROM CLIENTE WHERE LENGTH(NUMFAX) = 15 + AND SUBSTR(NUMFAX,0,1) = ''('' + AND SUBSTR(NUMFAX,5,1) = '')'')'; + exception when ja_existe then null; +end; +/ + +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE CLIENTE SET NUMTELEFONO = (''('' || SUBSTR(NUMFAX,3,2) || '')'' || SUBSTR(NUMFAX,7,3) || SUBSTR(NUMFAX,11,1) || ''-'' || SUBSTR(NUMFAX,12,4) ) + WHERE CLIENTE_ID IN( + SELECT CLIENTE_ID + FROM CLIENTE WHERE LENGTH( NUMFAX) = 14 + AND SUBSTR(NUMFAX,0,1) = ''('' + AND SUBSTR(NUMFAX,5,1) = '')'')'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20180418_1004__mantis10906.sql b/src/db/migration/migration/V20180418_1004__mantis10906.sql new file mode 100644 index 000000000..99966399d --- /dev/null +++ b/src/db/migration/migration/V20180418_1004__mantis10906.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (NUMSERIE_BPE VARCHAR2(3))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180418_1005__mantis10906.sql b/src/db/migration/migration/V20180418_1005__mantis10906.sql new file mode 100644 index 000000000..277766123 --- /dev/null +++ b/src/db/migration/migration/V20180418_1005__mantis10906.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (NUMSERIE_BPE VARCHAR2(3))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180418_1840__mantis10901.sql b/src/db/migration/migration/V20180418_1840__mantis10901.sql new file mode 100644 index 000000000..abcb83cf1 --- /dev/null +++ b/src/db/migration/migration/V20180418_1840__mantis10901.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASE_SERVICIO ADD (TIPOSERVICOBPE NUMBER(1))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180424_1432__mantis10974.sql b/src/db/migration/migration/V20180424_1432__mantis10974.sql new file mode 100644 index 000000000..afe2488dd --- /dev/null +++ b/src/db/migration/migration/V20180424_1432__mantis10974.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA ADD (DESCONTO_MONITRIP VARCHAR2(30))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180424_1744__mantis10994.sql b/src/db/migration/migration/V20180424_1744__mantis10994.sql new file mode 100644 index 000000000..e39202915 --- /dev/null +++ b/src/db/migration/migration/V20180424_1744__mantis10994.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA MODIFY (PRECIO NUMBER(10, 2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180427_1744__mantis10972.sql b/src/db/migration/migration/V20180427_1744__mantis10972.sql new file mode 100644 index 000000000..fc1407b3a --- /dev/null +++ b/src/db/migration/migration/V20180427_1744__mantis10972.sql @@ -0,0 +1,13 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''VDA > AUTORIZACAO > CONSULTAM CORRIDAS ANTERIORES ABERTO'',''COM.RJCONSULTORES.SCO.CONSULTACORRIDASANTERIORES.ABERTO'',1,sysdate,1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into constante (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''HABILITA_BUSCA_CORRIDA_ABIERTO_ANTERIOR'',''HABILITA_BUSCA_CORRIDA_ABIERTO_ANTERIOR'',null,''0'',''1'',''1'',to_date(''27/04/18'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20180430_1744__mantis10822.sql b/src/db/migration/migration/V20180430_1744__mantis10822.sql new file mode 100644 index 000000000..a2bfeced8 --- /dev/null +++ b/src/db/migration/migration/V20180430_1744__mantis10822.sql @@ -0,0 +1,30 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE INTEGRACAO_TOTVS ( + INTEGRACAOTOTVS_ID NUMBER(7,0) NOT NULL ENABLE, + DESC_INTEGRACAO VARCHAR2(20 BYTE), + FECINI DATE, + FECFIN DATE, + PUNTOVENTA_ID NUMBER(7,0), + EMPRESA_ID NUMBER(7,0), + CORRIDA_ID NUMBER(7,0), + ESQUEMACORRIDA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + QTDEREGISTROSATUALIZADOS NUMBER(7,0), + USUARIO_ID NUMBER(7,0), + CONSTRAINT "PK_INTEGRACAOTOTVS" PRIMARY KEY ("INTEGRACAOTOTVS_ID"), + CONSTRAINT "FK_INTEGRACAOTOTVS_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID"), + CONSTRAINT "FK_INTEGRACAOTOTVS_PTO_VENTA" FOREIGN KEY ("PUNTOVENTA_ID") REFERENCES PUNTO_VENTA("PUNTOVENTA_ID"))'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "INTEGRACAOTOTVS_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180430_2000__mantis9100.sql b/src/db/migration/migration/V20180430_2000__mantis9100.sql new file mode 100644 index 000000000..759512204 --- /dev/null +++ b/src/db/migration/migration/V20180430_2000__mantis9100.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_PARAMGERAL ADD (BOLETO_BANCO_AGENCIA_DIGITO NUMBER(1))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_PARAMGERAL ADD (BOLETO_BANCO_CARTEIRA_VARIAVEL NUMBER(3))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180502_1355__mantis10992.sql b/src/db/migration/migration/V20180502_1355__mantis10992.sql new file mode 100644 index 000000000..542408cc3 --- /dev/null +++ b/src/db/migration/migration/V20180502_1355__mantis10992.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -00001); +begin + execute immediate 'UPDATE PERFIL_FUNCION SET INDLECTURA = 1 WHERE INDLECTURA IS NULL'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180502_1554__mantis11034.sql b/src/db/migration/migration/V20180502_1554__mantis11034.sql new file mode 100644 index 000000000..9b5d774a4 --- /dev/null +++ b/src/db/migration/migration/V20180502_1554__mantis11034.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EVENTO_EXTRA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TIPO_EVENTO_EXTRA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20180502_1700__mantis10955.sql b/src/db/migration/migration/V20180502_1700__mantis10955.sql new file mode 100644 index 000000000..3330292c6 --- /dev/null +++ b/src/db/migration/migration/V20180502_1700__mantis10955.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table mensagem_recusa modify (descricao varchar2(500))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180503_1630__mantis11046.sql b/src/db/migration/migration/V20180503_1630__mantis11046.sql new file mode 100644 index 000000000..2a9672fbf --- /dev/null +++ b/src/db/migration/migration/V20180503_1630__mantis11046.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (DHVALIDADE VARCHAR2(25))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180509_1029__mantis11028.sql b/src/db/migration/migration/V20180509_1029__mantis11028.sql new file mode 100644 index 000000000..8bc6bbb0e --- /dev/null +++ b/src/db/migration/migration/V20180509_1029__mantis11028.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (NUM_BPE VARCHAR2(9))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180509_1030__mantis11028.sql b/src/db/migration/migration/V20180509_1030__mantis11028.sql new file mode 100644 index 000000000..594fa93ad --- /dev/null +++ b/src/db/migration/migration/V20180509_1030__mantis11028.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (NUM_BPE VARCHAR2(9))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180509_1031__mantis11028.sql b/src/db/migration/migration/V20180509_1031__mantis11028.sql new file mode 100644 index 000000000..7c21f538f --- /dev/null +++ b/src/db/migration/migration/V20180509_1031__mantis11028.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'UPDATE BOLETO SET NUM_BPE = NUMFOLIOSISTEMA WHERE NUMSERIE_BPE IS NOT NULL'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180509_1421__mantis11028.sql b/src/db/migration/migration/V20180509_1421__mantis11028.sql new file mode 100644 index 000000000..491501e01 --- /dev/null +++ b/src/db/migration/migration/V20180509_1421__mantis11028.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'UPDATE CAJA SET NUM_BPE = NUMFOLIOSISTEMA WHERE NUMSERIE_BPE IS NOT NULL'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180509_1439__mantis11028.sql b/src/db/migration/migration/V20180509_1439__mantis11028.sql new file mode 100644 index 000000000..d56a0f62c --- /dev/null +++ b/src/db/migration/migration/V20180509_1439__mantis11028.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDEMITEBPEVDAIMPPOSTERIOR NUMBER(1,0) DEFAULT 1'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180510_1500__mantis11062.sql b/src/db/migration/migration/V20180510_1500__mantis11062.sql new file mode 100644 index 000000000..37b495e09 --- /dev/null +++ b/src/db/migration/migration/V20180510_1500__mantis11062.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (PORCREDBASEICMSIM NUMBER(7,2))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180510_1930__mantis11065.sql b/src/db/migration/migration/V20180510_1930__mantis11065.sql new file mode 100644 index 000000000..8cb827111 --- /dev/null +++ b/src/db/migration/migration/V20180510_1930__mantis11065.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA ADD (DESCONTOBPE VARCHAR2(30))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180511_0924__mantis10994.sql b/src/db/migration/migration/V20180511_0924__mantis10994.sql new file mode 100644 index 000000000..1ec579dbb --- /dev/null +++ b/src/db/migration/migration/V20180511_0924__mantis10994.sql @@ -0,0 +1,23 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA MODIFY (PRECIOORIGINAL NUMBER(10, 2))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_OFICIAL MODIFY (PRECIOORIGINAL NUMBER(10, 2), PRECIO NUMBER(10, 2))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA_HIST MODIFY (PRECIOORIGINAL NUMBER(10, 2), PRECIO NUMBER(10, 2))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180515_2000__mantis10942.sql b/src/db/migration/migration/V20180515_2000__mantis10942.sql new file mode 100644 index 000000000..2cb6e357c --- /dev/null +++ b/src/db/migration/migration/V20180515_2000__mantis10942.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''FAZ_ENVIO_FALHO_PAF'', ''Faz envio do XML para WS Fisco?'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20180516_0835__mantis11043.sql b/src/db/migration/migration/V20180516_0835__mantis11043.sql new file mode 100644 index 000000000..90ee4f4dc --- /dev/null +++ b/src/db/migration/migration/V20180516_0835__mantis11043.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ALIAS_SERVICO ADD (INDIDALIASORIGINAL NUMBER(1) DEFAULT 0 )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180517_1758__mantis11031.sql b/src/db/migration/migration/V20180517_1758__mantis11031.sql new file mode 100644 index 000000000..8e376ea2d --- /dev/null +++ b/src/db/migration/migration/V20180517_1758__mantis11031.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''VDA > AUTORIZACAO > PERMITE TROCA, TRANSFERENCIA, CANCELAMENTO E DEVOLUCAO APOS EMISSAO DA 2 VIA'',''COM.RJCONSULTORES.SCO.VDA.AUTORIZACAOMOVIMENTOAPOS2VIA'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180521_1219__mantis10747.sql b/src/db/migration/migration/V20180521_1219__mantis10747.sql new file mode 100644 index 000000000..5201b6b0f --- /dev/null +++ b/src/db/migration/migration/V20180521_1219__mantis10747.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_SEGURO ADD ( INDESTANSEGTABELA NUMBER(1, 0) DEFAULT 0 )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_SEGURO ADD ( INDESTANSEGTABELA NUMBER(1, 0) DEFAULT 0 )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180524_1126__mantis11035.sql b/src/db/migration/migration/V20180524_1126__mantis11035.sql new file mode 100644 index 000000000..d1f59c63b --- /dev/null +++ b/src/db/migration/migration/V20180524_1126__mantis11035.sql @@ -0,0 +1,34 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> BPE'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE'',1,SYSDATE,-1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> BPE >>> EXPORTACAO'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.EXPORTACAO'',1,SYSDATE,-1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> BPE >>> RDI'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.RDI'',1,SYSDATE,-1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> BPE >>> FINANCIERO'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.FINANCIERO'',1,SYSDATE,-1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> BPE >>> DEVOLUCION'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.DEVOLUCION'',1,SYSDATE,-1)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20180525_0926__mantis11204.sql b/src/db/migration/migration/V20180525_0926__mantis11204.sql new file mode 100644 index 000000000..c012d3330 --- /dev/null +++ b/src/db/migration/migration/V20180525_0926__mantis11204.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD CHBPE_SUBSTITUICAO VARCHAR2(44)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180525_1155__mantis11130.sql b/src/db/migration/migration/V20180525_1155__mantis11130.sql new file mode 100644 index 000000000..6ebedbeae --- /dev/null +++ b/src/db/migration/migration/V20180525_1155__mantis11130.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD BPESUBSTITUICAO_ID NUMBER(7)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180528_1840__mantis11130.sql b/src/db/migration/migration/V20180528_1840__mantis11130.sql new file mode 100644 index 000000000..5ec38074a --- /dev/null +++ b/src/db/migration/migration/V20180528_1840__mantis11130.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_RESUMO_ECF ADD TIPORESUMO NUMBER(1)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180529_1035__mantis11237.sql b/src/db/migration/migration/V20180529_1035__mantis11237.sql new file mode 100644 index 000000000..b68dbe45f --- /dev/null +++ b/src/db/migration/migration/V20180529_1035__mantis11237.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_ENVIO_FISCO MODIFY (ARQUIVO VARCHAR2(200))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180529_1110__mantis11237.sql b/src/db/migration/migration/V20180529_1110__mantis11237.sql new file mode 100644 index 000000000..d799b0457 --- /dev/null +++ b/src/db/migration/migration/V20180529_1110__mantis11237.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE SEGPOLV MODIFY (POLTRONA VARCHAR2(3))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180601_1704__mantis11052.sql b/src/db/migration/migration/V20180601_1704__mantis11052.sql new file mode 100644 index 000000000..fbcabbaca --- /dev/null +++ b/src/db/migration/migration/V20180601_1704__mantis11052.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE SECRETARIA add RUT NUMBER(12)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE SECRETARIA add DIRSECRETARIA VARCHAR(60)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE SECRETARIA add CIUDAD VARCHAR(60)'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180604_1707__mantis11273.sql b/src/db/migration/migration/V20180604_1707__mantis11273.sql new file mode 100644 index 000000000..18fb01803 --- /dev/null +++ b/src/db/migration/migration/V20180604_1707__mantis11273.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (TROCO NUMBER(10,2),VALORPAGO NUMBER(10,2))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180605_1649__mantis11132.sql b/src/db/migration/migration/V20180605_1649__mantis11132.sql new file mode 100644 index 000000000..bd432550d --- /dev/null +++ b/src/db/migration/migration/V20180605_1649__mantis11132.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDCANCELABPETROCAORIGDEST NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180606_1112__mantis11299.sql b/src/db/migration/migration/V20180606_1112__mantis11299.sql new file mode 100644 index 000000000..270352a5e --- /dev/null +++ b/src/db/migration/migration/V20180606_1112__mantis11299.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''ADM > CONFIGURCAO COMERCIAL > PRESTACAO CONTAS > RECALCULO DE COMISSAO > AUTORIZACAO > PERMITE CALCULO TODAS AGENCIAS'',''COM.RJCONSULTORES.ADM.CALCULODIARIOCOMISSAO.AUTORIZACAOCALCULOTODASAGENCIAS'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180606_1404__mantis11299.sql b/src/db/migration/migration/V20180606_1404__mantis11299.sql new file mode 100644 index 000000000..34b9c87d8 --- /dev/null +++ b/src/db/migration/migration/V20180606_1404__mantis11299.sql @@ -0,0 +1,26 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO_RECEITA MODIFY( +BPR NUMBER(13,2), +GAP NUMBER(13,2), +IMPGAP NUMBER(13,2), +INTERNET NUMBER(13,2), +CANCELADOS NUMBER(13,2), +CANCELGAP NUMBER(13,2), +DEVOLVIDOS NUMBER(13,2), +DEVGAP NUMBER(13,2), +EXCESSO_BAGAGEM NUMBER(13,2), +SEG_OPCIONAL NUMBER(13,2), +RECEITA_OUTROS NUMBER(13,2), +DEVOLVIDOS_ORIGEM NUMBER(13,2), +DEVOLVIDOS_ORIGEM_GAP NUMBER(13,2), +QTDE_IMPGAP NUMBER(13,2), +COMISSAO_BPR NUMBER(13,2), +COMISSAO_ENTREGA_PASSAGEM NUMBER(13,2), +COMISSAO_ENTREGA_BAGAGEM NUMBER(13,2), +COMISSAO_SEG_OPCIONAL NUMBER(13,2), +COMISSAO_OUTROS NUMBER(13,2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180606_1610__mantis11304.sql b/src/db/migration/migration/V20180606_1610__mantis11304.sql new file mode 100644 index 000000000..fc6f54b8d --- /dev/null +++ b/src/db/migration/migration/V20180606_1610__mantis11304.sql @@ -0,0 +1,35 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE UNIQUE INDEX PK__BPE__BPE_ID ON BPE ("BPE_ID")'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE INDEX IDX__BPE_BOLETO ON BPE ("BOLETO_ID")'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE INDEX IDX__BPE_BPESUBSTITUICAO ON BPE ("BPESUBSTITUICAO_ID")'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -02275); +begin + execute immediate + 'ALTER TABLE BPE ADD CONSTRAINT BPE_BOLETO FOREIGN KEY (BOLETO_ID) REFERENCES BOLETO (BOLETO_ID) ENABLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180608_1800__mantis10074.sql b/src/db/migration/migration/V20180608_1800__mantis10074.sql new file mode 100644 index 000000000..ad6ac7ecb --- /dev/null +++ b/src/db/migration/migration/V20180608_1800__mantis10074.sql @@ -0,0 +1,57 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE FACTURACION_SICFE ( + FACTURACIONSICFE_ID NUMBER(7) NOT NULL, + TIPOCFE NUMBER(5), + SERIE VARCHAR2(20), + NUMFISCALCFE NUMBER(20), + RUTEMISOR NUMBER(12), + HASH VARCHAR2(50), + TELEFONO VARCHAR2(14), + NUMOPERACION VARCHAR2(36), + PDFSICFE blob, + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (FACTURACIONSICFE_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE FACTURACION_SICFE_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA add SUCURSALDGI varchar2(10)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA add TIPOTASA varchar2(1)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA add PORCTASA NUMERIC(4,2)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180611_1050__mantis10873.sql b/src/db/migration/migration/V20180611_1050__mantis10873.sql new file mode 100644 index 000000000..c350667d3 --- /dev/null +++ b/src/db/migration/migration/V20180611_1050__mantis10873.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE BPE MODIFY (RETORNO_ID VARCHAR2(50 BYTE))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180612_1421__mantis11340.sql b/src/db/migration/migration/V20180612_1421__mantis11340.sql new file mode 100644 index 000000000..d50ba5dc8 --- /dev/null +++ b/src/db/migration/migration/V20180612_1421__mantis11340.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE EMPRESA ADD (INDTRANSFERENCIABPEMOVICAJA NUMBER(1,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180613_1420__mantis11130.sql b/src/db/migration/migration/V20180613_1420__mantis11130.sql new file mode 100644 index 000000000..169b33f9e --- /dev/null +++ b/src/db/migration/migration/V20180613_1420__mantis11130.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE MD_LOG MODIFY (OBSERVACAO VARCHAR2(300))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180613_1650__mantis11130.sql b/src/db/migration/migration/V20180613_1650__mantis11130.sql new file mode 100644 index 000000000..1a615355f --- /dev/null +++ b/src/db/migration/migration/V20180613_1650__mantis11130.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_LOG ADD VERSAO NUMBER(8)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180614_1830__mantis11130.sql b/src/db/migration/migration/V20180614_1830__mantis11130.sql new file mode 100644 index 000000000..0e1bf4b48 --- /dev/null +++ b/src/db/migration/migration/V20180614_1830__mantis11130.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_LOG ADD USUARIO_ID NUMBER(7)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180615_1525__mantis11386.sql b/src/db/migration/migration/V20180615_1525__mantis11386.sql new file mode 100644 index 000000000..a53e6c0a2 --- /dev/null +++ b/src/db/migration/migration/V20180615_1525__mantis11386.sql @@ -0,0 +1,15 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE PTOVTA_SEGURO SET INDVENDSEGTABELA = 1 WHERE INDVENDSEGTABELA IS NULL OR INDVENDSEGTABELA = 0'; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'UPDATE PTOVTA_SEGURO SET INDESTANSEGTABELA = 1 WHERE INDESTANSEGTABELA IS NULL OR INDESTANSEGTABELA = 0'; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20180626_0919__mantis11414.sql b/src/db/migration/migration/V20180626_0919__mantis11414.sql new file mode 100644 index 000000000..b928f75a6 --- /dev/null +++ b/src/db/migration/migration/V20180626_0919__mantis11414.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''ADM > RELATORIO > MOVIMENTACAO ESTOQUE'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOMOVIMENTACAOESTOQUE'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180627_1644__mantis11406.sql b/src/db/migration/migration/V20180627_1644__mantis11406.sql new file mode 100644 index 000000000..8189763a2 --- /dev/null +++ b/src/db/migration/migration/V20180627_1644__mantis11406.sql @@ -0,0 +1,31 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (ERRO VARCHAR2(4000 BYTE))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_R2 ADD (INTEGRADOTOTVS NUMBER(1,0) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_R2 ADD (ERRO VARCHAR2(4000 BYTE))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180628_1800__mantis10971.sql b/src/db/migration/migration/V20180628_1800__mantis10971.sql new file mode 100644 index 000000000..0d216bcf4 --- /dev/null +++ b/src/db/migration/migration/V20180628_1800__mantis10971.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE EMPRESA ADD (INDUSAALIASLOCALIDADE NUMBER(1,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180703_1104__mantis11325.sql b/src/db/migration/migration/V20180703_1104__mantis11325.sql new file mode 100644 index 000000000..e6416ab53 --- /dev/null +++ b/src/db/migration/migration/V20180703_1104__mantis11325.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EVENTO_EXTRA ADD (ERRO VARCHAR2(4000 BYTE))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TIPO_EVENTO_EXTRA ADD (ERRO VARCHAR2(4000 BYTE))'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20180706_1035__mantis11035.sql b/src/db/migration/migration/V20180706_1035__mantis11035.sql new file mode 100644 index 000000000..07165d8bf --- /dev/null +++ b/src/db/migration/migration/V20180706_1035__mantis11035.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (INDTRIBEMISSAO NUMBER(1) DEFAULT 1 )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (INDTRIBVIAGEM NUMBER(1) DEFAULT 0 )'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20180709_1635__mantis11414.sql b/src/db/migration/migration/V20180709_1635__mantis11414.sql new file mode 100644 index 000000000..f69db3c07 --- /dev/null +++ b/src/db/migration/migration/V20180709_1635__mantis11414.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE DET_ABASTO_BOLETO_HIST ( + DETABASTOBOLETOHIST_ID NUMBER(15) NOT NULL, + DETABASTOBOLETOENV_ID NUMBER(7) NULL, + DETABASTOBOLETOREC_ID NUMBER(7) NULL, + FECMODIF DATE NULL, + ACTIVO NUMBER(1) NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (DETABASTOBOLETOHIST_ID), + FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO, + FOREIGN KEY (DETABASTOBOLETOREC_ID) REFERENCES DET_ABASTO_BOLETO, + FOREIGN KEY (DETABASTOBOLETOENV_ID) REFERENCES DET_ABASTO_BOLETO + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE DET_ABASTO_BOLETO_HIST_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180710_1634__mantis11414.sql b/src/db/migration/migration/V20180710_1634__mantis11414.sql new file mode 100644 index 000000000..61e5ecf2e --- /dev/null +++ b/src/db/migration/migration/V20180710_1634__mantis11414.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE REQUISICION_BOLETO ADD (INDDISTRIBUICAOESTOQUE NUMBER(1,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180710_2005__mantis11536.sql b/src/db/migration/migration/V20180710_2005__mantis11536.sql new file mode 100644 index 000000000..1a61636cf --- /dev/null +++ b/src/db/migration/migration/V20180710_2005__mantis11536.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (CNPJAUTORIZADORA VARCHAR2(20))'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20180712_1020__mantis11414.sql b/src/db/migration/migration/V20180712_1020__mantis11414.sql new file mode 100644 index 000000000..e8ca5fdeb --- /dev/null +++ b/src/db/migration/migration/V20180712_1020__mantis11414.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''VDA > ESTOQUE BILHETE > TRANSFERENCIA ESTOQUE'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUTRANSFERENCIAESTOQUE'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180713_1015__mantis11495.sql b/src/db/migration/migration/V20180713_1015__mantis11495.sql new file mode 100644 index 000000000..345c439ce --- /dev/null +++ b/src/db/migration/migration/V20180713_1015__mantis11495.sql @@ -0,0 +1,39 @@ +declare + begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > RELATORIOS >> CADASTRO CLIENTES'', +''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.CADASTROCLIENTES'', +''1'',to_date(''10/07/18'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLIENTE ADD (FECCADASTRO DATE, EMPRESA_ID NUMBER (7,0), PUNTOVENTA_ID NUMBER (7,0))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE CLIENTE +ADD CONSTRAINT CLIENTE_EMPRESA + FOREIGN KEY (EMPRESA_ID) + REFERENCES EMPRESA (EMPRESA_ID)'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180717_1138__mantis11414.sql b/src/db/migration/migration/V20180717_1138__mantis11414.sql new file mode 100644 index 000000000..9faa22943 --- /dev/null +++ b/src/db/migration/migration/V20180717_1138__mantis11414.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''VDA > ESTOQUE BILHETE > AUTORIZACAO CADASTRO ESTOQUE DISTRIBUICAO'',''COM.RJCONSULTORES.SCO.VDA.ESTOQUE.AUTORIZACAOCADASTROESTOQUEDISTRIBUICAO'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180723_1454__mantis11643.sql b/src/db/migration/migration/V20180723_1454__mantis11643.sql new file mode 100644 index 000000000..1f3b3355c --- /dev/null +++ b/src/db/migration/migration/V20180723_1454__mantis11643.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA ADD (INDNUMFIDELIDADOBLIGATORIO NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180723_1530__mantis11522.sql b/src/db/migration/migration/V20180723_1530__mantis11522.sql new file mode 100644 index 000000000..a4f449c55 --- /dev/null +++ b/src/db/migration/migration/V20180723_1530__mantis11522.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE MODIFY (RETORNO_ID VARCHAR2(100 BYTE))'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20180724_1141__mantis11649.sql b/src/db/migration/migration/V20180724_1141__mantis11649.sql new file mode 100644 index 000000000..a854fd250 --- /dev/null +++ b/src/db/migration/migration/V20180724_1141__mantis11649.sql @@ -0,0 +1,19 @@ +declare + indice_nao_existe exception; + pragma exception_init (indice_nao_existe , -01418); +begin + execute immediate 'DROP INDEX TARIFA_UNICA'; + exception when indice_nao_existe then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -00955); +begin + execute immediate 'CREATE UNIQUE INDEX UNQ_TARIFA ON TARIFA (CASE WHEN ACTIVO = 1 THEN + TRAMO_ID || MARCA_ID || CLASESERVICIO_ID || MONEDA_ID || VIGENCIATARIFA_ID || ORGAOCONCEDENTE_ID || RUTA_ID + ELSE NULL END)'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20180730_1812__mantis11476.sql b/src/db/migration/migration/V20180730_1812__mantis11476.sql new file mode 100644 index 000000000..82916cca7 --- /dev/null +++ b/src/db/migration/migration/V20180730_1812__mantis11476.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDUTILIZARESOLUCAO NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180802_1030__mantis11602.sql b/src/db/migration/migration/V20180802_1030__mantis11602.sql new file mode 100644 index 000000000..0e253fcd0 --- /dev/null +++ b/src/db/migration/migration/V20180802_1030__mantis11602.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION_IMPRESORA ADD INDARCHIVOLAYOUTINTERNACIONAL NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180802_1442__mantis11645.sql b/src/db/migration/migration/V20180802_1442__mantis11645.sql new file mode 100644 index 000000000..c397d89c7 --- /dev/null +++ b/src/db/migration/migration/V20180802_1442__mantis11645.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDUTIFOLIOLOCAPREPAGOABERTO NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180806_0944__mantis11731.sql b/src/db/migration/migration/V20180806_0944__mantis11731.sql new file mode 100644 index 000000000..4657307a6 --- /dev/null +++ b/src/db/migration/migration/V20180806_0944__mantis11731.sql @@ -0,0 +1,12 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) values ( + FUNCION_SISTEMA_SEQ.NEXTVAL, + 1, + ''ADM > RELATORIOS >> HISTORICO COMPRAS'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOHISTORICOCOMPRAS'', + 1, + TO_DATE(''06/08/18'',''DD/MM/RR''), + 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180806_1619__mantis11689.sql b/src/db/migration/migration/V20180806_1619__mantis11689.sql new file mode 100644 index 000000000..9a3b12f3d --- /dev/null +++ b/src/db/migration/migration/V20180806_1619__mantis11689.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RESERVACION_CTRL ADD INDSEMLIBAUTOMATICA NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180807_1606__mantis11562.sql b/src/db/migration/migration/V20180807_1606__mantis11562.sql new file mode 100644 index 000000000..f1200225c --- /dev/null +++ b/src/db/migration/migration/V20180807_1606__mantis11562.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_DADOS_SISTEMA ADD (DATAEMISSAOLAUDO DATE)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180808_1103__mantis11635.sql b/src/db/migration/migration/V20180808_1103__mantis11635.sql new file mode 100644 index 000000000..661ffaa31 --- /dev/null +++ b/src/db/migration/migration/V20180808_1103__mantis11635.sql @@ -0,0 +1,31 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDEXIGEENDERECOPASSAGEIRO NUMBER(1,0) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDEXIGEEMAILPASSAGEIRO NUMBER(1,0) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_EMP_PARAM ADD (CODEMPRESAPORORGAO VARCHAR2(30 BYTE))'; + exception when column_exists then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO funcion_sistema VALUES (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > GRATUIDADE ARTESP'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOGRATUIDADEARTESP'', 1, SYSDATE, 1)'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20180808_1346__mantis11635.sql b/src/db/migration/migration/V20180808_1346__mantis11635.sql new file mode 100644 index 000000000..ffdc95a30 --- /dev/null +++ b/src/db/migration/migration/V20180808_1346__mantis11635.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (DESCENDERECO VARCHAR2(200 BYTE))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180809_1720__mantis11650.sql b/src/db/migration/migration/V20180809_1720__mantis11650.sql new file mode 100644 index 000000000..638a1da53 --- /dev/null +++ b/src/db/migration/migration/V20180809_1720__mantis11650.sql @@ -0,0 +1,43 @@ +declare + begin + execute immediate 'CREATE TABLE PRICING_ESPECIFICO_CATEGORIA( +PRICINGESPECIFICO_CATEGORIAID NUMBER(7,0), +PRICINGESPECIFICO_ID NUMBER (7,0), +CATEGORIA_ID NUMBER (7,0), +FECMODIF DATE, +USUARIO_ID NUMBER (7,0), +ACTIVO NUMBER (1,0), + +CONSTRAINT PRICINGESPECIFICOCATEGORIA_PK PRIMARY KEY (PRICINGESPECIFICO_CATEGORIAID) +)'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'ALTER TABLE PRICING_ESPECIFICO_CATEGORIA +ADD CONSTRAINT PRICING_ESP_CAT_PRICING_ESP_FK FOREIGN KEY(PRICINGESPECIFICO_ID) REFERENCES PRICING_ESPECIFICO (PRICINGESPECIFICO_ID)'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'ALTER TABLE PRICING_ESPECIFICO_CATEGORIA +ADD CONSTRAINT PRICING_ESP_CAT_PRICING_CAT_FK FOREIGN KEY(CATEGORIA_ID) REFERENCES CATEGORIA (CATEGORIA_ID)'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'CREATE SEQUENCE PRICING_ESP_CATEGORIA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare +begin +FOR R in(SELECT PE.PRICINGESPECIFICO_ID, PE.CATEGORIA_ID FROM PRICING_ESPECIFICO PE) +loop + INSERT INTO PRICING_ESPECIFICO_CATEGORIA VALUES(PRICING_ESP_CATEGORIA_SEQ.nextVal, R.PRICINGESPECIFICO_ID, R.CATEGORIA_ID, current_date, 1, 1); + end loop; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180813_0845__mantis11587.sql b/src/db/migration/migration/V20180813_0845__mantis11587.sql new file mode 100644 index 000000000..b4a73aecc --- /dev/null +++ b/src/db/migration/migration/V20180813_0845__mantis11587.sql @@ -0,0 +1,70 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''CRON_ROTINA_ENVIA_VOUCHER'', ''Agendamento do cron tareas para rotima envia voucher'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''SMTP_EMAIL_ENVIA_VOUCHER'', ''SMTP_EMAIL_ENVIA_VOUCHER'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''SMTP_HOST_ENVIA_VOUCHER'', ''SMTP_HOST_ENVIA_VOUCHER'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''SMTP_PASS_ENVIA_VOUCHER'', ''SMTP_PASS_ENVIA_VOUCHER'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''SMTP_PORT_ENVIA_VOUCHER'', ''SMTP_PORT_ENVIA_VOUCHER'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''SMTP_USER_ENVIA_VOUCHER'', ''SMTP_USER_ENVIA_VOUCHER'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''SMTP_ASSUNTO_ENVIA_VOUCHER'', ''SMTP_ASSUNTO_ENVIA_VOUCHER'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''PUNTO_VENTA_ENVIA_VOUCHER'', ''Ponto de venda, id separado por vigurla'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''MINUTOS_RETROATIVO_ENVIA_VOUCHER'', ''MINUTOS_RETROATIVO_ENVIA_VOUCHER'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20180813_0942__mantis11602.sql b/src/db/migration/migration/V20180813_0942__mantis11602.sql new file mode 100644 index 000000000..50ccb7558 --- /dev/null +++ b/src/db/migration/migration/V20180813_0942__mantis11602.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION_IMPRESORA DROP COLUMN INDARCHIVOLAYOUTINTERNACIONAL'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION_IMPRESORA ADD NOMBARCHIVOLAYOUTINTERNACIONAL VARCHAR2(60)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180813_1709__mantis11854.sql b/src/db/migration/migration/V20180813_1709__mantis11854.sql new file mode 100644 index 000000000..6aa0d17e4 --- /dev/null +++ b/src/db/migration/migration/V20180813_1709__mantis11854.sql @@ -0,0 +1,21 @@ +declare + begin + execute immediate 'ALTER TABLE ESTADO RENAME COLUMN CENTRORESULTADOSAG TO CENTRORESULTADOSAG1'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'ALTER TABLE ESTADO ADD (CENTRORESULTADOSAG VARCHAR2(20))'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'update estado set centroresultadosag = centroresultadosag1'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20180814_1106__mantis11854.sql b/src/db/migration/migration/V20180814_1106__mantis11854.sql new file mode 100644 index 000000000..03f0eb86c --- /dev/null +++ b/src/db/migration/migration/V20180814_1106__mantis11854.sql @@ -0,0 +1,11 @@ +declare + begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE))'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE))'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180814_1625__mantis11684.sql b/src/db/migration/migration/V20180814_1625__mantis11684.sql new file mode 100644 index 000000000..8985bd293 --- /dev/null +++ b/src/db/migration/migration/V20180814_1625__mantis11684.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA ADD (ERRO VARCHAR2(4000 BYTE))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180820_1654__mantis10749.sql b/src/db/migration/migration/V20180820_1654__mantis10749.sql new file mode 100644 index 000000000..5bbc6c019 --- /dev/null +++ b/src/db/migration/migration/V20180820_1654__mantis10749.sql @@ -0,0 +1,8 @@ +declare +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL, 1, ''ADM > RELATORIOS > INTEGRACAO > SGTI'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.ANALITICO.SGTI'', 1, CURRENT_DATE, 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180821_1428__pafecf.sql b/src/db/migration/migration/V20180821_1428__pafecf.sql new file mode 100644 index 000000000..b18d6624d --- /dev/null +++ b/src/db/migration/migration/V20180821_1428__pafecf.sql @@ -0,0 +1,153 @@ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE FISCAL_F3 ADD (DAV NUMBER(13), CCE NUMBER(6))'; + + exception when column_exists then null; + +end; +/ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE FISCAL_P2 ADD (NCM VARCHAR2(7), CEST VARCHAR2(8))'; + + exception when column_exists then null; + +end; +/ +declare + + table_exists exception; + + pragma exception_init (table_exists , -00955); + +begin + + execute immediate + + 'CREATE TABLE FISCAL_J1 + + ( + + FISCALJ1_ID NUMBER(15,0) NOT NULL ENABLE, + + DATAEMISSAO VARCHAR2(8), + + SUBTOTAL NUMBER(14,0), + + DESCONTOSUBTOTAL NUMBER(13,0), + + INDDESCONTO VARCHAR2(1), + + ACRESCIMOSUBTOTAL NUMBER(13,0), + + INDACRESCIMOSUB VARCHAR2(1), + + TOTAL NUMBER(14,0), + + INDCANCELAMENTO VARCHAR2(1), + + CANCACRESCIMOSUB NUMBER(13,0), + + ORDEMACRESCIMO VARCHAR2(1), + + NOMECLIENTE VARCHAR2(40), + + CPFCNPJCLIENTE NUMBER(14,0), + + NUMNOTAFISCAL NUMBER(10,0), + + NUMSERIENOTAFISCAL VARCHAR2(3), + + CHNFE VARCHAR2(44), + + TIPODOCUMENTO NUMBER(1,0), + + ACTIVO NUMBER(1,0), + + FECMODIF DATE, + + USUARIO_ID NUMBER(7,0), + + CONSTRAINT FISCAL_J1_PK PRIMARY KEY (FISCALJ1_ID) + + ENABLE)'; + + exception when table_exists then null; + +end; +/ +declare + + table_exists exception; + + pragma exception_init (table_exists , -00955); + +begin + + execute immediate + + 'CREATE TABLE FISCAL_J2 + + ( + + FISCALJ2_ID NUMBER(15,0) NOT NULL ENABLE, + + DATAEMISSAO VARCHAR2(8), + + NUMITEM NUMBER(3,0), + + CODIGO VARCHAR2(14), + + DESCRICAO VARCHAR2(100), + + QUANTIDADE NUMBER(7,0), + + UNIDADE VARCHAR2(3), + + VALORUNITARIO NUMBER(8,0), + + DESCONTOITEM NUMBER(8,0), + + ACRESCIMOITEM NUMBER(8,0), + + TOTAL NUMBER(14,0), + + TOTALIZADOR VARCHAR2(7), + + DECIMAISQTD NUMBER(1,0), + + DECIMAISVALORUNT NUMBER(1,0), + + NUMNOTAFISCAL NUMBER(10,0), + + NUMSERIENOTAFISCAL VARCHAR2(3), + + CHNFE VARCHAR2(44), + + TIPODOCUMENTO NUMBER(1,0), + + ACTIVO NUMBER(1,0), + + FECMODIF DATE, + + USUARIO_ID NUMBER(7,0), + + CONSTRAINT FISCAL_J2_PK PRIMARY KEY (FISCALJ2_ID) + + ENABLE)'; + + exception when table_exists then null; + +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180821_1436__mantis11908.sql b/src/db/migration/migration/V20180821_1436__mantis11908.sql new file mode 100644 index 000000000..1f16b6d35 --- /dev/null +++ b/src/db/migration/migration/V20180821_1436__mantis11908.sql @@ -0,0 +1,264 @@ +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CONTA_RECEITA_ADIANTAMENTO_ENTRADA'',''AG_CONTA_RECEITA_ADIANTAMENTO_ENTRADA'', + null,''111129'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CONTA_RECEITA_ADIANTAMENTO_SAIDA'',''AG_CONTA_RECEITA_ADIANTAMENTO_SAIDA'', + null,''111128'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CONTA_DESPESA'',''AG_CONTA_DESPESA'', + null,''311130'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CONTA_FINANCEIRA_ADIANTAMENTOS'',''AG_CONTA_FINANCEIRA_ADIANTAMENTOS'', + null,''0062'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CONTA_FINANCEIRA_CONTAS_RECEBER'',''AG_CONTA_FINANCEIRA_CONTAS_RECEBER'', + null,''0061'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CONTA_FINANCEIRA_CONTAS_PAGAR'',''AG_CONTA_FINANCEIRA_CONTAS_PAGAR'', + null,''0060'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_OBSERVACAO_ADIANTAMENTO_TOTALBUS'',''AG_OBSERVACAO_ADIANTAMENTO_TOTALBUS'', + null,''Adiantamento Totalbus pelo Webservice'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_OBSERVACAO_DEVOLUCAO_ADIANTAMENTO_TOTALBUS'',''AG_OBSERVACAO_DEVOLUCAO_ADIANTAMENTO_TOTALBUS'', + null,''Baixa de Adiantamento Totalbus pelo Webservice'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_OBSERVACAO_RECEITA_PASSAGEM_BOLETO'',''AG_OBSERVACAO_RECEITA_PASSAGEM_BOLETO'', + null,''00084 Receita de Passagem - Boleto'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_OBSERVACAO_RECEITA_PASSAGEM_CARTAO'',''AG_OBSERVACAO_RECEITA_PASSAGEM_CARTAO'', + null,''00083 Receita de Passagem - Carto de Crdito'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_OBSERVACAO_RECEITA_PASSAGEM_DEPOSITO'',''AG_OBSERVACAO_RECEITA_PASSAGEM_DEPOSITO'', + null,''00082 Receita de Passagem - A vista'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_RECEITA_PASSAGEM_BOLETO'',''AG_RECEITA_PASSAGEM_BOLETO'', + null,''111127'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_RECEITA_PASSAGEM_DEPOSITO'',''AG_RECEITA_PASSAGEM_DEPOSITO'', + null,''111101'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_RECEITA_PASSAGEM_CARTAO'',''AG_RECEITA_PASSAGEM_CARTAO'', + null,''111120'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_RECEITA_ADIANTAMENTO_BOLETO'',''AG_RECEITA_ADIANTAMENTO_BOLETO'', + null,''111127'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_RECEITA_ADIANTAMENTO_DEPOSITO'',''AG_RECEITA_ADIANTAMENTO_DEPOSITO'', + null,''111101'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_TIPO_DOCUMENTO_BOLETO'',''AG_TIPO_DOCUMENTO_BOLETO'', + null,''046'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_TIPO_DOCUMENTO_DEPOSITO'',''AG_TIPO_DOCUMENTO_DEPOSITO'', + null,''047'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CODIGO_MODALIDADE'',''AG_CODIGO_MODALIDADE'', + null,''03'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CODIGO_SERVICO'',''AG_CODIGO_SERVICO'', + null,''0012'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_MOTIVO_CANCELAMENTO'',''AG_MOTIVO_CANCELAMENTO'', + null,''Cancelamento Totalbus'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CONTA_RECEBER_BOLETO'',''AG_CONTA_RECEBER_BOLETO'', + null,''1'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CONTA_RECEBER_CARTAO'',''AG_CONTA_RECEBER_CARTAO'', + null,''2'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''AG_CONTA_RECEBER_DEPOSITO'',''AG_CONTA_RECEBER_DEPOSITO'', + null,''3'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; + +/ + diff --git a/src/db/migration/migration/V20180823_1430__pafecf.sql b/src/db/migration/migration/V20180823_1430__pafecf.sql new file mode 100644 index 000000000..13e2bee23 --- /dev/null +++ b/src/db/migration/migration/V20180823_1430__pafecf.sql @@ -0,0 +1,27 @@ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE FISCAL_J1 ADD (HASHVTA VARCHAR2(32 BYTE), HASHBD VARCHAR2(32 BYTE))'; + + exception when column_exists then null; + +end; +/ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE FISCAL_J2 ADD (HASHVTA VARCHAR2(32 BYTE), HASHBD VARCHAR2(32 BYTE))'; + + exception when column_exists then null; + +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180824_1021__mantis11741.sql b/src/db/migration/migration/V20180824_1021__mantis11741.sql new file mode 100644 index 000000000..cc70a1e4b --- /dev/null +++ b/src/db/migration/migration/V20180824_1021__mantis11741.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_TRAMO ADD (TIPO_PASSAGEM VARCHAR2(1))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CORRIDA_TRAMO ADD (TIPO_PASSAGEM VARCHAR2(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180824_1130__mantis11928.sql b/src/db/migration/migration/V20180824_1130__mantis11928.sql new file mode 100644 index 000000000..6015acb3d --- /dev/null +++ b/src/db/migration/migration/V20180824_1130__mantis11928.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''CENTRAL DE EMISSAO'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUCENTRALEMISSAO'',1,sysdate,1)'; +exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180824_1445__pafecf.sql b/src/db/migration/migration/V20180824_1445__pafecf.sql new file mode 100644 index 000000000..6e329af54 --- /dev/null +++ b/src/db/migration/migration/V20180824_1445__pafecf.sql @@ -0,0 +1,129 @@ +declare + + table_exists exception; + + pragma exception_init (table_exists , -00955); + +begin + + execute immediate + + 'CREATE TABLE FISCAL_D2 + + ( + + FISCALD2_ID NUMBER(15,0) NOT NULL ENABLE, + + CNPJ VARCHAR2(14), + + NUMFABRICACAO VARCHAR2(20), + + MFADICIONAL VARCHAR2(1), + + TIPOECF VARCHAR2(7), + + MARCAECF VARCHAR2(20), + + MODELOECF VARCHAR2(20), + + COO VARCHAR2(9), + + NUMDAV VARCHAR2(13), + + DATADAV VARCHAR2(8), + + TITULODAV VARCHAR2(30), + + VALORTOTALDAV VARCHAR2(8), + + COOVINCULADO VARCHAR2(9), + + NUMSEQUENCIA VARCHAR2(3), + + NOMECLIENTE VARCHAR2(40), + + CPFCNPJCLIENTE VARCHAR2(14), + + ACTIVO NUMBER(1,0), + + FECMODIF DATE, + + USUARIO_ID NUMBER(7,0), + + HASHVTA VARCHAR2(32 BYTE), + + HASHBD VARCHAR2(32 BYTE), + + CONSTRAINT FISCAL_D2_PK PRIMARY KEY (FISCALD2_ID) + + ENABLE)'; + + exception when table_exists then null; + +end; +/ +declare + + table_exists exception; + + pragma exception_init (table_exists , -00955); + +begin + + execute immediate + + 'CREATE TABLE FISCAL_D3 + + ( + + FISCALD3_ID NUMBER(15,0) NOT NULL ENABLE, + + NUMDAV VARCHAR2(13), + + DATAINCLUSAO VARCHAR2(8), + + NUMITEM VARCHAR2(3), + + CODIGO VARCHAR2(14), + + DESCRICAO VARCHAR2(100), + + QUANTIDADE VARCHAR2(7), + + UNIDADE VARCHAR2(3), + + VALORUNITARIO VARCHAR2(8), + + DESCONTOITEM VARCHAR2(8), + + ACRESCIMOITEM VARCHAR2(8), + + TOTAL VARCHAR2(14), + + SITUACAO VARCHAR2(1), + + ALIQUOTA VARCHAR2(4), + + INDCANCELAMENTO VARCHAR2(1), + + DECIMAISQTD VARCHAR2(1), + + DECIMAISVALOR VARCHAR2(1), + + ACTIVO NUMBER(1,0), + + FECMODIF DATE, + + USUARIO_ID NUMBER(7,0), + + HASHVTA VARCHAR2(32 BYTE), + + HASHBD VARCHAR2(32 BYTE), + + CONSTRAINT FISCAL_D3_PK PRIMARY KEY (FISCALD3_ID) + + ENABLE)'; + + exception when table_exists then null; + +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180824_1948__mantis11183.sql b/src/db/migration/migration/V20180824_1948__mantis11183.sql new file mode 100644 index 000000000..f2a672732 --- /dev/null +++ b/src/db/migration/migration/V20180824_1948__mantis11183.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDIMPRIME2VIASIMPRENAOFISCAL NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20180826_2230__pafecf.sql b/src/db/migration/migration/V20180826_2230__pafecf.sql new file mode 100644 index 000000000..87ea1b68c --- /dev/null +++ b/src/db/migration/migration/V20180826_2230__pafecf.sql @@ -0,0 +1,17 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE FISCAL_D2_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE FISCAL_D3_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180826_2310__pafecf.sql b/src/db/migration/migration/V20180826_2310__pafecf.sql new file mode 100644 index 000000000..6135009f1 --- /dev/null +++ b/src/db/migration/migration/V20180826_2310__pafecf.sql @@ -0,0 +1,18 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); + +begin + execute immediate 'ALTER TABLE FISCAL_D2 ADD (PUNTOVENTA_ID NUMBER(7), CORRIDA_ID NUMBER(7), FECCORRIDA DATE)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); + +begin + execute immediate 'ALTER TABLE FISCAL_D3 ADD (BOLETO_ID NUMBER(15))'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20180827_2115__pafecf.sql b/src/db/migration/migration/V20180827_2115__pafecf.sql new file mode 100644 index 000000000..86bc41650 --- /dev/null +++ b/src/db/migration/migration/V20180827_2115__pafecf.sql @@ -0,0 +1,9 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); + +begin + execute immediate 'ALTER TABLE FISCAL_D3 ADD (NUMFABRICACAO VARCHAR2(20))'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20180827_2120__pafecf.sql b/src/db/migration/migration/V20180827_2120__pafecf.sql new file mode 100644 index 000000000..40987c886 --- /dev/null +++ b/src/db/migration/migration/V20180827_2120__pafecf.sql @@ -0,0 +1,17 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); + +begin + execute immediate 'ALTER TABLE FISCAL_D2 ADD (DATAMOV VARCHAR2(8))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); + +begin + execute immediate 'ALTER TABLE FISCAL_D3 ADD (DATAMOV VARCHAR2(8))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180829_1020__pafecf.sql b/src/db/migration/migration/V20180829_1020__pafecf.sql new file mode 100644 index 000000000..ed9e57fe6 --- /dev/null +++ b/src/db/migration/migration/V20180829_1020__pafecf.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); + +begin + execute immediate 'ALTER TABLE FISCAL_D3 ADD (NUMCCE VARCHAR2(6))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180903_1030__pafecf.sql b/src/db/migration/migration/V20180903_1030__pafecf.sql new file mode 100644 index 000000000..0df95966a --- /dev/null +++ b/src/db/migration/migration/V20180903_1030__pafecf.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); + +begin + execute immediate 'ALTER TABLE FISCAL_D3 ADD (CCF VARCHAR2(6))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20180905_1829__mantis11948.sql b/src/db/migration/migration/V20180905_1829__mantis11948.sql new file mode 100644 index 000000000..885ab275a --- /dev/null +++ b/src/db/migration/migration/V20180905_1829__mantis11948.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > RELATORIOS >> VENDAS DE CART�ES'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASCARTOES'',''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180906_1042__mantis12042.sql b/src/db/migration/migration/V20180906_1042__mantis12042.sql new file mode 100644 index 000000000..5bb8a6004 --- /dev/null +++ b/src/db/migration/migration/V20180906_1042__mantis12042.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'ALTER TABLE TAXPOL ADD CONSTRAINT TAXPOLC_FK FOREIGN KEY (TAXPOLC_ID) REFERENCES TAXPOLC( TAXPOLC_ID ) ENABLE'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180906_1653__mantis11947.sql b/src/db/migration/migration/V20180906_1653__mantis11947.sql new file mode 100644 index 000000000..3cc4defc6 --- /dev/null +++ b/src/db/migration/migration/V20180906_1653__mantis11947.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDIMPRIME2VIASDEVOLUCAO NUMBER (1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180910_1700__mantis11158.sql b/src/db/migration/migration/V20180910_1700__mantis11158.sql new file mode 100644 index 000000000..9b6e5ebaa --- /dev/null +++ b/src/db/migration/migration/V20180910_1700__mantis11158.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_CAT_IND ADD EMPRESA_ID NUMBER(7) DEFAULT -1 '; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180913_1732__mantis12147.sql b/src/db/migration/migration/V20180913_1732__mantis12147.sql new file mode 100644 index 000000000..ae949882d --- /dev/null +++ b/src/db/migration/migration/V20180913_1732__mantis12147.sql @@ -0,0 +1,5 @@ +declare + begin + execute immediate 'ALTER TABLE PARADA_COD_ORGAOCONCEDENTE MODIFY CODIGO VARCHAR2(9)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180919_1034__mantis10590.sql b/src/db/migration/migration/V20180919_1034__mantis10590.sql new file mode 100644 index 000000000..b5663fea3 --- /dev/null +++ b/src/db/migration/migration/V20180919_1034__mantis10590.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDEXIBEDIFMENORTROCACEECF NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180924_1820__mantis11837.sql b/src/db/migration/migration/V20180924_1820__mantis11837.sql new file mode 100644 index 000000000..3ce22607b --- /dev/null +++ b/src/db/migration/migration/V20180924_1820__mantis11837.sql @@ -0,0 +1,17 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE BOLETO ADD (ORIGENA_ID NUMBER(7),DESTINOA_ID NUMBER(7))'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE CAJA ADD (ORIGENA_ID NUMBER(7),DESTINOA_ID NUMBER(7))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20180925_1405__mantis11955.sql b/src/db/migration/migration/V20180925_1405__mantis11955.sql new file mode 100644 index 000000000..19a2aecb2 --- /dev/null +++ b/src/db/migration/migration/V20180925_1405__mantis11955.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDPERMITETROCAVDAABERTO NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20180927_1844__mantis12260.sql b/src/db/migration/migration/V20180927_1844__mantis12260.sql new file mode 100644 index 000000000..baf84f462 --- /dev/null +++ b/src/db/migration/migration/V20180927_1844__mantis12260.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDEXIBECOMISSAOZERADAAGENCIA NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181004_1120__mantis10918.sql b/src/db/migration/migration/V20181004_1120__mantis10918.sql new file mode 100644 index 000000000..19758c967 --- /dev/null +++ b/src/db/migration/migration/V20181004_1120__mantis10918.sql @@ -0,0 +1,27 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CONF_RESTRICAO_VENDAWEB + (CONFRESTRICAOVENDAWEB_ID NUMBER(7,0) NOT NULL ENABLE, + EMPRESA_ID NUMBER(7,0), + VALOR NUMBER(7,2), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + PRIMARY KEY (CONFRESTRICAOVENDAWEB_ID), + FOREIGN KEY (EMPRESA_ID) + REFERENCES EMPRESA (EMPRESA_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONF_RESTRICAO_VENDAWEB_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181004_1121__mantis10918.sql b/src/db/migration/migration/V20181004_1121__mantis10918.sql new file mode 100644 index 000000000..110adbfde --- /dev/null +++ b/src/db/migration/migration/V20181004_1121__mantis10918.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,''2'',''VDA > AUTORIZACAO > CONFIGURAR RESTRICAO DE CANAL DE VENDA EMPRESA VALOR MINIMO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.CONFRESTRICAOCANALVENTAEMPRESAVALORMIN'',''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181004_1530__mantis12262.sql b/src/db/migration/migration/V20181004_1530__mantis12262.sql new file mode 100644 index 000000000..6fc01ffa8 --- /dev/null +++ b/src/db/migration/migration/V20181004_1530__mantis12262.sql @@ -0,0 +1,39 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO MODIFY ( + PRECIOBASE NUMBER(10, 2), + PRECIOPAGADO NUMBER(10, 2), + DESCUENTOAMPARADO NUMBER(10, 2), + PRECIOCARGOEXTRA NUMBER(10, 2), + PORCCATEGORIA NUMBER(10, 2), + PRECIOPRICING NUMBER(10, 2), + IMPORTECATEGORIA NUMBER(10, 2), + IMPORTETAXAEMBARQUE NUMBER(10, 2), + IMPORTEPEDAGIO NUMBER(10, 2), + IMPORTEOUTROS NUMBER(10, 2), + IMPORTESEGURO NUMBER(10, 2))'; + exception when column_exists then null; +end; + +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA MODIFY ( + PRECIOBASE NUMBER(10, 2), + PRECIOPAGADO NUMBER(10, 2), + DESCUENTOAMPARADO NUMBER(10, 2), + PRECIOCARGOEXTRA NUMBER(10, 2), + PORCCATEGORIA NUMBER(10, 2), + PRECIOPRICING NUMBER(10, 2), + IMPORTECATEGORIA NUMBER(10, 2), + IMPORTETAXAEMBARQUE NUMBER(10, 2), + IMPORTEPEDAGIO NUMBER(10, 2), + IMPORTEOUTROS NUMBER(10, 2), + IMPORTESEGURO NUMBER(10, 2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181005_1740__mantis12349.sql b/src/db/migration/migration/V20181005_1740__mantis12349.sql new file mode 100644 index 000000000..e3426b469 --- /dev/null +++ b/src/db/migration/migration/V20181005_1740__mantis12349.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDPERMREATIVBPEESTNAOBPE NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181015_1152__mantis12339.sql b/src/db/migration/migration/V20181015_1152__mantis12339.sql new file mode 100644 index 000000000..667549666 --- /dev/null +++ b/src/db/migration/migration/V20181015_1152__mantis12339.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''USUARIO_CHECKIN_AUTOMATICO_MONITRIP'', ''USUARIO_CHECKIN_AUTOMATICO_MONITRIP'', ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20181015_1153__mantis12339.sql b/src/db/migration/migration/V20181015_1153__mantis12339.sql new file mode 100644 index 000000000..524828bc6 --- /dev/null +++ b/src/db/migration/migration/V20181015_1153__mantis12339.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''PUNTOVENTA_CHECKIN_AUTOMATICO_MONITRIP'', ''PUNTOVENTA_CHECKIN_AUTOMATICO_MONITRIP'', ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20181015_1154__mantis12339.sql b/src/db/migration/migration/V20181015_1154__mantis12339.sql new file mode 100644 index 000000000..ba1d15a4b --- /dev/null +++ b/src/db/migration/migration/V20181015_1154__mantis12339.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''ESTACION_CHECKIN_AUTOMATICO_MONITRIP'', ''ESTACION_CHECKIN_AUTOMATICO_MONITRIP'', ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20181017_1353__mantis12429.sql b/src/db/migration/migration/V20181017_1353__mantis12429.sql new file mode 100644 index 000000000..344b062b8 --- /dev/null +++ b/src/db/migration/migration/V20181017_1353__mantis12429.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MD_RESUMO_ECF ADD EMPRESA_ID NUMBER(7,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181018_1042__mantis11951.sql b/src/db/migration/migration/V20181018_1042__mantis11951.sql new file mode 100644 index 000000000..19d2901f4 --- /dev/null +++ b/src/db/migration/migration/V20181018_1042__mantis11951.sql @@ -0,0 +1,12 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) values ( + FUNCION_SISTEMA_SEQ.NEXTVAL, + 1, + ''ADM > RELATORIOS >> POSICAO DE VENDA DO BILHETE IDOSO'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOPOSICAOVENDABILHETEIDOSO'', + 1, + CURRENT_DATE, + 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181019_1036__mantis12394.sql b/src/db/migration/migration/V20181019_1036__mantis12394.sql new file mode 100644 index 000000000..690d47953 --- /dev/null +++ b/src/db/migration/migration/V20181019_1036__mantis12394.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA ADD (CODANTTAUX NUMBER(5))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181019_1044__mantis12394.sql b/src/db/migration/migration/V20181019_1044__mantis12394.sql new file mode 100644 index 000000000..dd0daf765 --- /dev/null +++ b/src/db/migration/migration/V20181019_1044__mantis12394.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'update parada set CODANTTAUX = CODANTT'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181022_1040__mantis12391.sql b/src/db/migration/migration/V20181022_1040__mantis12391.sql new file mode 100644 index 000000000..4a77ece07 --- /dev/null +++ b/src/db/migration/migration/V20181022_1040__mantis12391.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_COMISSAO ADD (VALOR_IMPRESSAO_GAP_ALTA NUMBER(7,2), INDPAGACOMISSAOBILHETEOS NUMBER(1,0) DEFAULT 1)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181022_1725__mantis12468.sql b/src/db/migration/migration/V20181022_1725__mantis12468.sql new file mode 100644 index 000000000..555c200c9 --- /dev/null +++ b/src/db/migration/migration/V20181022_1725__mantis12468.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (INTEGRADOTOTVS NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181024_1130__mantis12501.sql b/src/db/migration/migration/V20181024_1130__mantis12501.sql new file mode 100644 index 000000000..574727ee7 --- /dev/null +++ b/src/db/migration/migration/V20181024_1130__mantis12501.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD INDPRES VARCHAR2(1)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181025_1020__mantis12283.sql b/src/db/migration/migration/V20181025_1020__mantis12283.sql new file mode 100644 index 000000000..13866fe7e --- /dev/null +++ b/src/db/migration/migration/V20181025_1020__mantis12283.sql @@ -0,0 +1,32 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE TRANSACAOKONDUTO_PK MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE TRANSACAO_KONDUTO + (TRANSACAOKONDUTO_ID NUMBER(7,0) NOT NULL ENABLE, + BOLETO_ID NUMBER(15,0), + EMPRESA_ID NUMBER(7,0), + KONDUTO_ID VARCHAR2(50), + STATUSTRANSACAO VARCHAR2(2), + STATUSTRANSACAOKONDUTO VARCHAR2(20), + TENTATIVAENVIO NUMBER(3,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT TRANSACAOKONDUTO_PK PRIMARY KEY (TRANSACAOKONDUTO_ID) ENABLE, + FOREIGN KEY (EMPRESA_ID) + REFERENCES EMPRESA (EMPRESA_ID) ENABLE + )'; + exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20181025_1620__mantis12434.sql b/src/db/migration/migration/V20181025_1620__mantis12434.sql new file mode 100644 index 000000000..3770f124a --- /dev/null +++ b/src/db/migration/migration/V20181025_1620__mantis12434.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'insert into constante (constante_id,nombconstante,descconstante,indtipoconstante,valorconstante,indmantenimientousuario,activo,fecmodif,usuario_id) + values (constante_seq.nextval,''EMPRESA_GENERA_FACTURA_ELETRONICA_SICFE'',''EMPRESAS HABILITADAS PARA GERAR FACTURA ELETRONICA - SICFE'',0,''15'',0,1,sysdate,-1)'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181025_1840__mantis12464.sql b/src/db/migration/migration/V20181025_1840__mantis12464.sql new file mode 100644 index 000000000..811cc10a9 --- /dev/null +++ b/src/db/migration/migration/V20181025_1840__mantis12464.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE FLYWAY_SCRIPTS ( + NOME VARCHAR2(100) NOT NULL, + SQL CLOB NOT NULL, + OBSERVACAO VARCHAR2(500), + FECMODIF DATE, + PRIMARY KEY (NOME) + )'; + + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20181026_0958__mantis12391.sql b/src/db/migration/migration/V20181026_0958__mantis12391.sql new file mode 100644 index 000000000..46981e7ab --- /dev/null +++ b/src/db/migration/migration/V20181026_0958__mantis12391.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'UPDATE PTOVTA_COMISSAO SET VALOR_IMPRESSAO_GAP_ALTA = VALOR_IMPRESSAO_GAP WHERE VALOR_IMPRESSAO_GAP IS NOT NULL'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181029_1100__mantis12479.sql b/src/db/migration/migration/V20181029_1100__mantis12479.sql new file mode 100644 index 000000000..a7e2136a9 --- /dev/null +++ b/src/db/migration/migration/V20181029_1100__mantis12479.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDIMPEMBARQDESEMBARQCUPOM NUMBER(1,0) DEFAULT 1 NOT NULL ENABLE'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181031_1100__mantis12393.sql b/src/db/migration/migration/V20181031_1100__mantis12393.sql new file mode 100644 index 000000000..92dc5f931 --- /dev/null +++ b/src/db/migration/migration/V20181031_1100__mantis12393.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_CTRL ADD DESCRICAO VARCHAR2(50)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181101_0951__mantis12283.sql b/src/db/migration/migration/V20181101_0951__mantis12283.sql new file mode 100644 index 000000000..29e53cdd9 --- /dev/null +++ b/src/db/migration/migration/V20181101_0951__mantis12283.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> INTEGRACAO >>> RELATORIOINTEGRACAOANTIFRAUDE'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOINTEGRACAOANTIFRAUDE'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181105_1600__mantis12335.sql b/src/db/migration/migration/V20181105_1600__mantis12335.sql new file mode 100644 index 000000000..82f1790fd --- /dev/null +++ b/src/db/migration/migration/V20181105_1600__mantis12335.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''PARAMETRO_VENDA_MOTORISTA'', ''PARAMETRO_VENDA_MOTORISTA'', ''0'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20181106_1820__mantis12391.sql b/src/db/migration/migration/V20181106_1820__mantis12391.sql new file mode 100644 index 000000000..2b2e9dea8 --- /dev/null +++ b/src/db/migration/migration/V20181106_1820__mantis12391.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD (DATA_INICIAL DATE, DATA_FINAL DATE)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181109_1606__mantis12283.sql b/src/db/migration/migration/V20181109_1606__mantis12283.sql new file mode 100644 index 000000000..f91a0a516 --- /dev/null +++ b/src/db/migration/migration/V20181109_1606__mantis12283.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD ( ANTIFRAUDEKEY VARCHAR2(50) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181109_1740__mantis12282.sql b/src/db/migration/migration/V20181109_1740__mantis12282.sql new file mode 100644 index 000000000..94d83502b --- /dev/null +++ b/src/db/migration/migration/V20181109_1740__mantis12282.sql @@ -0,0 +1,69 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE EMPRESA_EMAIL_CONFIG +( + EMPRESAEMAILCONFIG_ID NUMBER(7, 0) NOT NULL +, EMPRESA_ID NUMBER(7, 0) +, SMTP VARCHAR2(100 BYTE) +, SENHA VARCHAR2(50 BYTE) +, SMTPPORTA VARCHAR2(20 BYTE) +, SMTPEMAIL VARCHAR2(50 BYTE) +, ACTIVO NUMBER(1,0) +, FECMODIF DATE +, USUARIO_ID NUMBER(7,0) +, CONSTRAINT EMPRESA_EMAIL_CONFIG_PK PRIMARY KEY + ( + EMPRESAEMAILCONFIG_ID + ) + ENABLE +) '; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE EMPRESA_EMAIL_CONFIG_SEQ'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE EMPRESA_EMAIL +( + EMPRESAEMAIL_ID NUMBER(7, 0) NOT NULL +, EMPRESA_ID NUMBER(7, 0) +, TEXTOEMAIL CLOB +, TEXTOCUPOMEMBARQUE CLOB +, ASSUNTO VARCHAR2(200 BYTE) +, EMAILDE VARCHAR2(50 BYTE) +, ACTIVO NUMBER(1,0) +, FECMODIF DATE +, USUARIO_ID NUMBER(7,0) +, CONSTRAINT EMPRESA_EMAIL_PK PRIMARY KEY + ( + EMPRESAEMAIL_ID + ) + ENABLE +) '; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE EMPRESA_EMAIL_SEQ'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181113_1808__mantis12557.sql b/src/db/migration/migration/V20181113_1808__mantis12557.sql new file mode 100644 index 000000000..0cc9dbd87 --- /dev/null +++ b/src/db/migration/migration/V20181113_1808__mantis12557.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA ADD (INDTELEFONEOBRIGATORIO NUMBER(1,0) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181116_1452__mantis12736.sql b/src/db/migration/migration/V20181116_1452__mantis12736.sql new file mode 100644 index 000000000..e4c0f9491 --- /dev/null +++ b/src/db/migration/migration/V20181116_1452__mantis12736.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_EMAIL ADD (TEXTOEMAILFISCAL CLOB)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181116_2121__mantis12736.sql b/src/db/migration/migration/V20181116_2121__mantis12736.sql new file mode 100644 index 000000000..e30e93f2d --- /dev/null +++ b/src/db/migration/migration/V20181116_2121__mantis12736.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_EMAIL ADD (ASSUNTOFISCAL VARCHAR2(200))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181119_1200__mantis12622.sql b/src/db/migration/migration/V20181119_1200__mantis12622.sql new file mode 100644 index 000000000..6db999531 --- /dev/null +++ b/src/db/migration/migration/V20181119_1200__mantis12622.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD (INDVOUCHER NUMBER(1,0) DEFAULT 1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181119_1500__mantis12675.sql b/src/db/migration/migration/V20181119_1500__mantis12675.sql new file mode 100644 index 000000000..7f98bcd46 --- /dev/null +++ b/src/db/migration/migration/V20181119_1500__mantis12675.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA MODIFY (TIPOPARADA_ID NUMBER(7,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181120_1200__mantis12736.sql b/src/db/migration/migration/V20181120_1200__mantis12736.sql new file mode 100644 index 000000000..0258af2b5 --- /dev/null +++ b/src/db/migration/migration/V20181120_1200__mantis12736.sql @@ -0,0 +1,17 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE EMPRESA_EMAIL MODIFY (ASSUNTO VARCHAR2(500))'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE EMPRESA_EMAIL MODIFY (ASSUNTOFISCAL VARCHAR2(500))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20181120_1758__mantis12773.sql b/src/db/migration/migration/V20181120_1758__mantis12773.sql new file mode 100644 index 000000000..60b2e3ef3 --- /dev/null +++ b/src/db/migration/migration/V20181120_1758__mantis12773.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDEMITEDABPEVDACALLCENTER NUMBER(1,0), INDOUTRASFPVDACALLCENTER NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181121_2253__mantis12491.sql b/src/db/migration/migration/V20181121_2253__mantis12491.sql new file mode 100644 index 000000000..ccfdc4f14 --- /dev/null +++ b/src/db/migration/migration/V20181121_2253__mantis12491.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''VDA > VENDA EMBARCADA >> BAIXA GERA VENDA FISCAL'', ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUEMBARCADABAIXAGERAVENDAFISCAL'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181122_1800__mantis12735.sql b/src/db/migration/migration/V20181122_1800__mantis12735.sql new file mode 100644 index 000000000..10e270571 --- /dev/null +++ b/src/db/migration/migration/V20181122_1800__mantis12735.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01439); +begin + execute immediate 'ALTER TABLE FISCAL_R7 MODIFY (IMPORTEESTORNO NUMBER(14,0))'; + exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20181123_1121__mantisXSAD.sql b/src/db/migration/migration/V20181123_1121__mantisXSAD.sql new file mode 100644 index 000000000..2313d06a5 --- /dev/null +++ b/src/db/migration/migration/V20181123_1121__mantisXSAD.sql @@ -0,0 +1,5 @@ +declare + begin + execute immediate 'Insert into EMPRESA (EMPRESA_ID,NOMBEMPRESA,INDEXTERNA,INDTIPO,INDPAGOCONDUCTOR,RFC,EQUIVALENCIAELEKTRA_ID,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID) values (''-1'',''TODAS'',null,null,null,null,null,null,''1'',to_date(''26/09/2018 14:53:02'',''DD/MM/YYYY HH24:MI:SS''),''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20181123_1225__mantis12782.sql b/src/db/migration/migration/V20181123_1225__mantis12782.sql new file mode 100644 index 000000000..169a541da --- /dev/null +++ b/src/db/migration/migration/V20181123_1225__mantis12782.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD FECHORVENTA_H DATE'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181123_1407__mantis12783.sql b/src/db/migration/migration/V20181123_1407__mantis12783.sql new file mode 100644 index 000000000..58bbbabfb --- /dev/null +++ b/src/db/migration/migration/V20181123_1407__mantis12783.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (FECHORINTEGRADOTOTVS DATE, CONTADORINTEGRADOTOTVS NUMBER(7,0) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181127_1520__mantis12464.sql b/src/db/migration/migration/V20181127_1520__mantis12464.sql new file mode 100644 index 000000000..0f9c22c76 --- /dev/null +++ b/src/db/migration/migration/V20181127_1520__mantis12464.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FLYWAY_SCRIPTS ADD (SQL_ERRO VARCHAR2(10), DATAHORA_EXECUCAO DATE)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181128_1140__mantis12465.sql b/src/db/migration/migration/V20181128_1140__mantis12465.sql new file mode 100644 index 000000000..136a73c10 --- /dev/null +++ b/src/db/migration/migration/V20181128_1140__mantis12465.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FLYWAY_SCRIPTS ADD (ACTIVO NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181129_1729__mantis12779.sql b/src/db/migration/migration/V20181129_1729__mantis12779.sql new file mode 100644 index 000000000..393cfe70f --- /dev/null +++ b/src/db/migration/migration/V20181129_1729__mantis12779.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CTRL_FECHAMENTO_CAIXA ( + CTRLFECHAMENTOCAIXA_ID NUMBER(15) NOT NULL, + FECCORTE DATE NULL, + FECMODIF DATE NULL, + FECHAMENTO_STATUS VARCHAR2(100) NULL, + ACTIVO NUMBER(1) DEFAULT 0 NOT NULL, + PRIMARY KEY (CTRLFECHAMENTOCAIXA_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE CTRL_FECHAMENTO_CAIXA_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181203_0946__mantis12878.sql b/src/db/migration/migration/V20181203_0946__mantis12878.sql new file mode 100644 index 000000000..bb1ba0e89 --- /dev/null +++ b/src/db/migration/migration/V20181203_0946__mantis12878.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDEMITEDABPEVDAINTERNET NUMBER(1,0) DEFAULT 0 NOT NULL, INDEMITEDABPEVDAINTJ3 NUMBER(1,0) DEFAULT 0 NOT NULL)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181203_1032__mantis12779.sql b/src/db/migration/migration/V20181203_1032__mantis12779.sql new file mode 100644 index 000000000..8993e44af --- /dev/null +++ b/src/db/migration/migration/V20181203_1032__mantis12779.sql @@ -0,0 +1,12 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''RETER_COMISSAO_ADM_FECHAMENTO_CAIXA'', ''RETER_COMISSAO_ADM_FECHAMENTO_CAIXA'', ''0'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'UPDATE CONSTANTE SET ACTIVO = 0 WHERE NOMBCONSTANTE = ''HORA_EXEC_RETENCAO_DIARIA_COMISSAO'''; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181204_1659__mantis12902.sql b/src/db/migration/migration/V20181204_1659__mantis12902.sql new file mode 100644 index 000000000..6bf1c97ef --- /dev/null +++ b/src/db/migration/migration/V20181204_1659__mantis12902.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE PARADA SET FECMODIF = SYSDATE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181205_1638__infra10374.sql b/src/db/migration/migration/V20181205_1638__infra10374.sql new file mode 100644 index 000000000..bf6acbb61 --- /dev/null +++ b/src/db/migration/migration/V20181205_1638__infra10374.sql @@ -0,0 +1,13 @@ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'alter table corrida_tramo modify (corridatramo_id number(10,0))'; + + exception when column_exists then null; + +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181205_1800__mantis12840.sql b/src/db/migration/migration/V20181205_1800__mantis12840.sql new file mode 100644 index 000000000..1001426f9 --- /dev/null +++ b/src/db/migration/migration/V20181205_1800__mantis12840.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE PTOVTA_ANTIFRAUDE ( + PTOVTAANTIFRAUDE_ID NUMBER(7) NOT NULL, + PUNTOVENTA_ID NUMBER(7) NULL, + EMPRESA_ID NUMBER(7) NULL, + TIPO VARCHAR2(50) NULL, + CHAVE VARCHAR2(50) NULL, + FECMODIF DATE NULL, + ACTIVO NUMBER(1) NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (PTOVTAANTIFRAUDE_ID), + FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA, + FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE PTOVTA_ANTIFRAUDE_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181206_1620__mantis12935.sql b/src/db/migration/migration/V20181206_1620__mantis12935.sql new file mode 100644 index 000000000..fc8ac6a48 --- /dev/null +++ b/src/db/migration/migration/V20181206_1620__mantis12935.sql @@ -0,0 +1,22 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table fiscal_j1 add (NUMSERIE20 VARCHAR(20), + DATAMOV VARCHAR2(9), + FISCALIMPRESSORA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table fiscal_j2 add (CNPJEMISSOR VARCHAR(14), + NUMSERIE20 VARCHAR(20), + DATAMOV VARCHAR(9), + FISCALIMPRESSORA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181206_1705__mantis12843.sql b/src/db/migration/migration/V20181206_1705__mantis12843.sql new file mode 100644 index 000000000..61779b44f --- /dev/null +++ b/src/db/migration/migration/V20181206_1705__mantis12843.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (CNPJAUTOREVENTO VARCHAR2(14))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181207_1510__mantis12843.sql b/src/db/migration/migration/V20181207_1510__mantis12843.sql new file mode 100644 index 000000000..0cceb201d --- /dev/null +++ b/src/db/migration/migration/V20181207_1510__mantis12843.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (DHREFERENCIA VARCHAR2(25 BYTE))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181210_1903__mantis12957.sql b/src/db/migration/migration/V20181210_1903__mantis12957.sql new file mode 100644 index 000000000..96854288e --- /dev/null +++ b/src/db/migration/migration/V20181210_1903__mantis12957.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_EMAIL ADD (EMAILCOPIAOCULTA VARCHAR2(200))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181211_1144__mantis12840.sql b/src/db/migration/migration/V20181211_1144__mantis12840.sql new file mode 100644 index 000000000..7350293ac --- /dev/null +++ b/src/db/migration/migration/V20181211_1144__mantis12840.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (PUNTOVENTA_ID NUMBER(7,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181211_1544__mantis12954.sql b/src/db/migration/migration/V20181211_1544__mantis12954.sql new file mode 100644 index 000000000..6bf4a8b22 --- /dev/null +++ b/src/db/migration/migration/V20181211_1544__mantis12954.sql @@ -0,0 +1,44 @@ +--Apaga registros duplicados do estoque de taxa de embarque. +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'DELETE FROM ( +SELECT C.TAXPOL_ID, C.NUMTAXA,C.EMPRESA_ID, C.LOCALIDADE_ID, C.TAXPOLC_ID, C.ACTIVO +FROM TAXPOL C +WHERE C.ROWID <> + ( SELECT MAX(ROWID) FROM TAXPOL CJ WHERE CJ.NUMTAXA = C.NUMTAXA + and CJ.EMPRESA_ID = C.EMPRESA_ID + and CJ.LOCALIDADE_ID = C.LOCALIDADE_ID + ) +ORDER BY C.TAXPOL_ID, C.NUMTAXA +)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + --ORA-01442: a coluna a ser modificada para NOT NULL j NOT NULL + pragma exception_init (column_exists , -1442); +begin + execute immediate 'ALTER TABLE TAXPOL MODIFY ("NUMTAXA" NOT NULL ENABLE)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + --ORA-02261: esta chave exclusiva ou primria j existe na tabela + pragma exception_init (column_exists , -02261); +begin + execute immediate 'ALTER TABLE "TAXPOL" ADD CONSTRAINT "NUMTAXA_UK" UNIQUE ("NUMTAXA", "EMPRESA_ID", "LOCALIDADE_ID")'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + --ORA-02275: esta restrio referencial j existe na tabela + pragma exception_init (column_exists , -2275); +begin + execute immediate 'ALTER TABLE TAXPOL ADD CONSTRAINT "TAXPOLC_FK" FOREIGN KEY ("TAXPOLC_ID") REFERENCES TAXPOLC ("TAXPOLC_ID") ENABLE'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181218_1450__mantis12844.sql b/src/db/migration/migration/V20181218_1450__mantis12844.sql new file mode 100644 index 000000000..c86bf72f9 --- /dev/null +++ b/src/db/migration/migration/V20181218_1450__mantis12844.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (INDCANCNE NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181219_1144__mantis12717.sql b/src/db/migration/migration/V20181219_1144__mantis12717.sql new file mode 100644 index 000000000..e35af5170 --- /dev/null +++ b/src/db/migration/migration/V20181219_1144__mantis12717.sql @@ -0,0 +1,31 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE TAXPOLEXCECAO_PK MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE TAXPOL_EXCECAO + (TAXPOLEXCECAO_ID NUMBER(7,0) NOT NULL ENABLE, + PUNTOVENTA_ID NUMBER(7,0), + LOCALIDADE_ID NUMBER(7,0), + CATEGORIA_ID NUMBER(7,0), + RUTA_ID NUMBER(7,0), + ORGAOCONCEDENTE_ID NUMBER(7,0), + EMPRESA_ID NUMBER(7,0), + DESCTAXAEXCECAO VARCHAR2(200), + FECMODIF DATE, + ACTIVO NUMBER(1,0), + CONSTRAINT TAXPOLEXCECAO_PK PRIMARY KEY (TAXPOLEXCECAO_ID) ENABLE, + FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA (EMPRESA_ID) ON DELETE SET NULL ENABLE, + FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) ON DELETE SET NULL ENABLE, + FOREIGN KEY (LOCALIDADE_ID) REFERENCES PARADA (PARADA_ID) ON DELETE SET NULL ENABLE)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181220_1520__mantis12844.sql b/src/db/migration/migration/V20181220_1520__mantis12844.sql new file mode 100644 index 000000000..2cf70be53 --- /dev/null +++ b/src/db/migration/migration/V20181220_1520__mantis12844.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (JSONBEAN CLOB)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20181225_1703__mantis13076.sql b/src/db/migration/migration/V20181225_1703__mantis13076.sql new file mode 100644 index 000000000..957a3459c --- /dev/null +++ b/src/db/migration/migration/V20181225_1703__mantis13076.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRAMO ADD (INDKMENTRADASAIDAORIGEM NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181226_1540__mantis12843.sql b/src/db/migration/migration/V20181226_1540__mantis12843.sql new file mode 100644 index 000000000..b7017b396 --- /dev/null +++ b/src/db/migration/migration/V20181226_1540__mantis12843.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD BPEEVENTO_ID NUMBER(7)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181227_1830__mantis12884.sql b/src/db/migration/migration/V20181227_1830__mantis12884.sql new file mode 100644 index 000000000..30ea6de92 --- /dev/null +++ b/src/db/migration/migration/V20181227_1830__mantis12884.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE LAST_WAR_VERSION ( + LASTWARVERSION_ID NUMBER(15,0) NOT NULL, + FECMODIF DATE NULL, + VERSAO VARCHAR2(45), + PRIMARY KEY (LASTWARVERSION_ID) + )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181227_1831__mantis12884.sql b/src/db/migration/migration/V20181227_1831__mantis12884.sql new file mode 100644 index 000000000..71f6c0c94 --- /dev/null +++ b/src/db/migration/migration/V20181227_1831__mantis12884.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'create sequence LAST_WAR_VERSION_SEQ minvalue 1 maxvalue 9999999999999999999999999999 start with 1 increment by 1 nocache ORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181228_0923__mantis12840.sql b/src/db/migration/migration/V20181228_0923__mantis12840.sql new file mode 100644 index 000000000..c775a0cd6 --- /dev/null +++ b/src/db/migration/migration/V20181228_0923__mantis12840.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (STATUSENVIO VARCHAR(20))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181228_1722__mantis12840.sql b/src/db/migration/migration/V20181228_1722__mantis12840.sql new file mode 100644 index 000000000..f1a6345ea --- /dev/null +++ b/src/db/migration/migration/V20181228_1722__mantis12840.sql @@ -0,0 +1,11 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (QTDE_PARCELAS NUMBER(3), + MESANO_TARJETA VARCHAR(4), + PRIMEIROS_SEIS_DIGITOS_TARJETA VARCHAR(6), + ULTIMOS_QUATRO_DIGITOS_TARJETA VARCHAR(4), + VALOR NUMBER(7,2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20181228_1842__mantis12840.sql b/src/db/migration/migration/V20181228_1842__mantis12840.sql new file mode 100644 index 000000000..8878387c0 --- /dev/null +++ b/src/db/migration/migration/V20181228_1842__mantis12840.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (NSU VARCHAR(45), + NUMAUTORIZACION VARCHAR(45))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190102_1134__mantis12840.sql b/src/db/migration/migration/V20190102_1134__mantis12840.sql new file mode 100644 index 000000000..aa3092131 --- /dev/null +++ b/src/db/migration/migration/V20190102_1134__mantis12840.sql @@ -0,0 +1,13 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''INTEG_KONDUTO_PERIODO_ENVIO_PENDENTE'', ''INTEG_KONDUTO_PERIODO_ENVIO_PENDENTE'', ''2'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''INTEG_KONDUTO_PERIODO_QT_TENTA_ENVIO'', ''INTEG_KONDUTO_PERIODO_QT_TENTA_ENVIO'', ''2'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190107_1435__mantis13076.sql b/src/db/migration/migration/V20190107_1435__mantis13076.sql new file mode 100644 index 000000000..b00d231e6 --- /dev/null +++ b/src/db/migration/migration/V20190107_1435__mantis13076.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRAMO ADD (CANTKMENTRADASAIDADESTINO NUMBER(7,2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190107_1527__mantis12840.sql b/src/db/migration/migration/V20190107_1527__mantis12840.sql new file mode 100644 index 000000000..0ccfcbfe5 --- /dev/null +++ b/src/db/migration/migration/V20190107_1527__mantis12840.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (DATA_ENVIO DATE)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190108_1454__mantis13110.sql b/src/db/migration/migration/V20190108_1454__mantis13110.sql new file mode 100644 index 000000000..0d8d3d877 --- /dev/null +++ b/src/db/migration/migration/V20190108_1454__mantis13110.sql @@ -0,0 +1,22 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO_DET ADD INDTOTALBUS NUMBER (1,0)'; + exception when column_exists then null; +end; + +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO_DET ADD INDEMBARCADA NUMBER (1,0)'; + exception when column_exists then null; +end; + +/ + +UPDATE FORMA_PAGO_DET SET INDTOTALBUS = 1; +UPDATE FORMA_PAGO_DET SET INDEMBARCADA = 1; diff --git a/src/db/migration/migration/V20190108_1530__mantis14988.sql b/src/db/migration/migration/V20190108_1530__mantis14988.sql new file mode 100644 index 000000000..82ba38c7e --- /dev/null +++ b/src/db/migration/migration/V20190108_1530__mantis14988.sql @@ -0,0 +1,44 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > PRICING > GESTAO DE PRICING > PRICING RAPIDO'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.GESTAODEPRICING.PRICINGESPECIFICO'',''1'',null,''2'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > PRICING> GESTAO DE PRICING > PRICING 2.0'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.GESTAODEPRICING.PRICING'',''1'',null,''2'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > PRICING> GESTAO DE PRICING > GESTAO DE PRICING'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.GESTAODEPRICING.GESTAOPRICING'',''1'',null,''2'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; diff --git a/src/db/migration/migration/V20190108_1639__mantis12840.sql b/src/db/migration/migration/V20190108_1639__mantis12840.sql new file mode 100644 index 000000000..6ffddb24a --- /dev/null +++ b/src/db/migration/migration/V20190108_1639__mantis12840.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (CODIGO_HTTP VARCHAR(10))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190108_1737__mantis14988.sql b/src/db/migration/migration/V20190108_1737__mantis14988.sql new file mode 100644 index 000000000..b95167a05 --- /dev/null +++ b/src/db/migration/migration/V20190108_1737__mantis14988.sql @@ -0,0 +1,155 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE GP_PRICING_ESPECIFICO ( + PRICINGESPECIFICO_ID NUMBER(15,0) NOT NULL ENABLE, + NOMBPRICING VARCHAR2(60 BYTE), + TIPOPTOVTA_ID NUMBER(2,0), + CATEGORIA_ID NUMBER(7,0), + MARCA_ID NUMBER(3,0), + ORIGEN_ID NUMBER(7,0), + DESTINO_ID NUMBER(7,0), + FECHORINICIO DATE, + FECHORFIN DATE, + CLASESERVICIO_ID NUMBER(2,0), + MONEDA_ID NUMBER(7,0), + TARIFA NUMBER(7,2), + TARIFAREDABIERTO NUMBER(7,2), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CORRIDA_ID NUMBER(7,0), + EXIBEVENDA NUMBER(1,0), + CONSTRAINT PK__PRICING PRIMARY KEY (PRICINGESPECIFICO_ID), + CONSTRAINT PRICING_ESP_CORRIDA_FK FOREIGN KEY(CORRIDA_ID) REFERENCES CORRIDA_CTRL (CORRIDA_ID), + CONSTRAINT PRICING_ESP_CLASSE_FK FOREIGN KEY(CLASESERVICIO_ID) REFERENCES CLASE_SERVICIO (CLASESERVICIO_ID), + CONSTRAINT PRICING_ESP_DESTINO_FK FOREIGN KEY(DESTINO_ID) REFERENCES PARADA (PARADA_ID), + CONSTRAINT PRICING_ESP_ORIGEM_FK FOREIGN KEY(ORIGEN_ID) REFERENCES PARADA (PARADA_ID), + CONSTRAINT PRICING_ESP_CATEGORIA_FK FOREIGN KEY(CATEGORIA_ID) REFERENCES CATEGORIA (CATEGORIA_ID), + CONSTRAINT PRICING_ESP_TIPO_PTOVTA_FK FOREIGN KEY(TIPOPTOVTA_ID) REFERENCES TIPO_PTOVTA (TIPOPTOVTA_ID), + CONSTRAINT PRICING_ESP_MONEDA_FK FOREIGN KEY(MONEDA_ID) REFERENCES MONEDA (MONEDA_ID), + CONSTRAINT PRICING_ESP_MARCA_FK FOREIGN KEY(MARCA_ID) REFERENCES MARCA (MARCA_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_ESPECIFICO_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE GP_PRICING_ESP_CATEGORIA( + PRICINGESPECIFICO_CATEGORIAID NUMBER(7,0), + PRICINGESPECIFICO_ID NUMBER (7,0), + CATEGORIA_ID NUMBER (7,0), + FECMODIF DATE, + USUARIO_ID NUMBER (7,0), + ACTIVO NUMBER (1,0), + CONSTRAINT GP_PRICING_ESP_CATEGORIA_PK PRIMARY KEY (PRICINGESPECIFICO_CATEGORIAID), + CONSTRAINT GP_PRICING_CAT_ESP_001_FK FOREIGN KEY(PRICINGESPECIFICO_ID) REFERENCES GP_PRICING_ESPECIFICO (PRICINGESPECIFICO_ID), + CONSTRAINT GP_PRICING_CAT_ESP_002_FK FOREIGN KEY(CATEGORIA_ID) REFERENCES CATEGORIA (CATEGORIA_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_ESP_CATEGORIA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE GP_PRICING_ESPEC_OCUPACION( + PRICINGESPECIFICOOCUPACION_ID NUMBER(7,0) NOT NULL ENABLE, + PRICINGESPECIFICO_ID NUMBER(7,0), + OCUPACIONINICIAL NUMBER(5,2), + OCUPACIONFINAL NUMBER(5,2), + TARIFA NUMBER(7,2), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + DESCUENTO NUMBER(5,2), + CONSTRAINT PK__GP_PRICINGOCUPACION PRIMARY KEY (PRICINGESPECIFICOOCUPACION_ID), + CONSTRAINT FK_GP_PRICING_ESPEC FOREIGN KEY (PRICINGESPECIFICO_ID) REFERENCES GP_PRICING_ESPECIFICO (PRICINGESPECIFICO_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_ESPEC_OCUP_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate ' CREATE TABLE GP_PRICING_ESP_PUNTO_VENTA ( + PRICINGESPPUNTOVENTA_ID NUMBER(15,0) NOT NULL, + PUNTOVENTA_ID NUMBER(15,0) NOT NULL, + PRICINGESPECIFICO_ID NUMBER(15,0) NOT NULL, + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT GP_PRICINGESPPTOVENTA_PK PRIMARY KEY (PRICINGESPPUNTOVENTA_ID), + CONSTRAINT FK_GP_PRICING_ESPECIFICO FOREIGN KEY (PRICINGESPECIFICO_ID) REFERENCES GP_PRICING_ESPECIFICO (PRICINGESPECIFICO_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_ESP_PUNTOV_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE GP_PRICING_ESP_CANAL_VENTA ( + PRICINGESPCANAL_ID NUMBER(15) NOT NULL, + TIPOPTOVTA_ID NUMBER(15) NOT NULL, + PRICINGESPECIFICO_ID NUMBER(15) NOT NULL , + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + CONSTRAINT GP_PRICINGESPCANALVENTA_PK PRIMARY KEY (PRICINGESPCANAL_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_ESP_CANAL_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_ESPEC_OCUP_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20190108_1740__mantis14988.sql b/src/db/migration/migration/V20190108_1740__mantis14988.sql new file mode 100644 index 000000000..5b4761eb8 --- /dev/null +++ b/src/db/migration/migration/V20190108_1740__mantis14988.sql @@ -0,0 +1,472 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE GP_PRICING ( + PRICING_ID NUMBER(7,0) NOT NULL ENABLE, + EMPRESA_ID NUMBER(7,0), + NOMBPRICING VARCHAR2(60 BYTE), + CANTBOLETO NUMBER(3,0), + DESCUENTOPORCENTAJE NUMBER(7,2), + DESCUENTOPORCREDONDO NUMBER(5,2), + INDTRANSFERIBLE NUMBER(1,0), + INDRESERVABLE NUMBER(1,0), + INDCANCELABLE NUMBER(1,0), + CANTDIASANTICIPACION NUMBER(2,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + INDGENERAFERIADOVIAJE VARCHAR2(3 BYTE), + INDGENERAFERIADOVENTA VARCHAR2(3 BYTE), + EXIBEVENDA NUMBER(1,0), + CONSTRAINT PK__GP_PRICING PRIMARY KEY (PRICING_ID), + CONSTRAINT PK__GP_EMPRESA FOREIGN KEY(EMPRESA_ID) REFERENCES EMPRESA (EMPRESA_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_ASIENTO ( + PRICINGASIENTO_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + NUMEASIENTO VARCHAR2(9 BYTE), + PORCENTAJE NUMBER(5,2), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + NOMBIMAGEN VARCHAR2(60 BYTE), + CONSTRAINT PK_GP_PRICING_ASIENTO PRIMARY KEY (PRICINGASIENTO_ID), + CONSTRAINT FK_GP_PRICING_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_ASIENTO_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_MERCADO ( + PRICINGPARADA_ID NUMBER(10,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + ORIGEN_ID NUMBER(7,0), + DESTINO_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_MERCADO PRIMARY KEY (PRICINGPARADA_ID), + CONSTRAINT FK_GP_MERC_DESTINO_ID FOREIGN KEY(DESTINO_ID) REFERENCES PARADA (PARADA_ID), + CONSTRAINT FK_GP_MERC_ORIGEM_ID FOREIGN KEY(ORIGEN_ID) REFERENCES PARADA (PARADA_ID), + CONSTRAINT FK_GP_MERC_PRICING_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_MERCADO_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_MARCA ( + PRICINGMARCA_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + MARCA_ID NUMBER(3,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_MARGA_PRICING PRIMARY KEY (PRICINGMARCA_ID), + CONSTRAINT FK_GP_MARCA_PRICING_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_PRICING_MARCA_ID FOREIGN KEY(MARCA_ID) REFERENCES MARCA (MARCA_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_MARCA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_RUTA ( + PRICINGRUTA_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + RUTA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_RUTA PRIMARY KEY (PRICINGRUTA_ID), + CONSTRAINT FK_GP_RUTA_PRICING_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_RUTA_ID FOREIGN KEY(RUTA_ID) REFERENCES RUTA (RUTA_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_RUTA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_DIA ( + PRICINGDIA_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + INDLUNES NUMBER(1,0), + INDMARTES NUMBER(1,0), + INDMIERCOLES NUMBER(1,0), + INDJUEVES NUMBER(1,0), + INDVIERNES NUMBER(1,0), + INDSABADO NUMBER(1,0), + INDDOMINGO NUMBER(1,0), + HORARIOINICIO DATE, + HORARIOFIN DATE, + FECMODIF DATE, + ACTIVO NUMBER(1,0), + USUARIO_ID NUMBER(7,0), + INDFECVIAJE NUMBER(1,0), + INDFECVENTA NUMBER(1,0), + CONSTRAINT PK_GP_PRICING_DIA PRIMARY KEY (PRICINGDIA_ID), + CONSTRAINT FK_GP_PRICING_DIA_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_DIA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_IMPORTE ( + PRICINGIMPORTE_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + MONEDA_ID NUMBER(7,0), + IMPORTE NUMBER(7,2), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_IMPORTE PRIMARY KEY (PRICINGIMPORTE_ID), + CONSTRAINT FK_GP_PRICING_IMP_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_PRICING_MONEDA_ID FOREIGN KEY(MONEDA_ID) REFERENCES MONEDA (MONEDA_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_IMPORTE_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_TIPOPTOVTA ( + PRICINGTIPOPTOVTA_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + TIPOPTOVTA_ID NUMBER(2,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_TIPOPTVA PRIMARY KEY (PRICINGTIPOPTOVTA_ID), + CONSTRAINT FK_GP_PRICING_TIPOPTVA_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_TIPOPTVA_ID FOREIGN KEY(TIPOPTOVTA_ID) REFERENCES TIPO_PTOVTA (TIPOPTOVTA_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_TIPOPTOVTA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_CATEGORIA ( + PRICINGCATEGORIA_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + CATEGORIA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_CATEGORIA PRIMARY KEY (PRICINGCATEGORIA_ID), + CONSTRAINT FK_GP_PRICING_CAT_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_CATEGORIA_ID FOREIGN KEY(CATEGORIA_ID) REFERENCES CATEGORIA (CATEGORIA_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_CATEGORIA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_VIGENCIA ( + PRICINGVIGENCIA_ID NUMBER(10,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + FECINICIOVIAJE DATE, + FECFINVIAJE DATE, + FECINICIOVENTA DATE, + FECFINVENTA DATE, + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_VIGENCIA PRIMARY KEY (PRICINGVIGENCIA_ID), + CONSTRAINT FK_GP_PRICING_VIG_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_VIGENCIA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_CLASE ( + PRICINGCLASE_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + CLASESERVICIO_ID NUMBER(2,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_CLASSE PRIMARY KEY (PRICINGCLASE_ID), + CONSTRAINT FK_GP_PRICING_CLASE_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_CLASE_SERVICIO_ID FOREIGN KEY(CLASESERVICIO_ID) REFERENCES CLASE_SERVICIO (CLASESERVICIO_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_CLASE_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_CORRIDA ( + PRICINGCORRIDA_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + CORRIDA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_CORRIDA_ID PRIMARY KEY (PRICINGCORRIDA_ID), + CONSTRAINT FK_GP_PRICING_CORRIDA_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_PRICING_CORRIDA_CTRL_ID FOREIGN KEY(CORRIDA_ID) REFERENCES CORRIDA_CTRL (CORRIDA_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_CORRIDA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_PUNTOVENTA ( + PRICINGPTOVTA_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + PUNTOVENTA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_PTVTA PRIMARY KEY (PRICINGPTOVTA_ID), + CONSTRAINT FK_GP_PRICING_PTVTA_ID FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_PRICING_PTVTA FOREIGN KEY(PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_PUNTOVENTA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_TIPOSERVICIO ( + PRICINGTIPOSERVICIO_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0) NOT NULL ENABLE, + TIPOSERVICIO_ID NUMBER(2,0) NOT NULL ENABLE, + ACTIVO NUMBER(1,0) NOT NULL ENABLE, + FECMODIF DATE NOT NULL ENABLE, + USUARIO_ID NUMBER(7,0) NOT NULL ENABLE, + CONSTRAINT PK_GP_PRICING_TPOSERVICIO PRIMARY KEY (PRICINGTIPOSERVICIO_ID), + CONSTRAINT FK_GP_PRICING_TPOSERVICIO FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_PRICING_TIPO_SERVICIO FOREIGN KEY(TIPOSERVICIO_ID) REFERENCES TIPO_SERVICIO (TIPOSERVICIO_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_TIPOSERVICIO_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate ' CREATE TABLE GP_PRICING_CLASSE_TARIFARIA ( + PRICINGCLASSETARIFARIA_ID NUMBER(7,0) NOT NULL ENABLE, + DESCCLASSE_TARIFARIA VARCHAR2(20 BYTE), + SIGLA VARCHAR2(1 BYTE), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_CLASSE_TAR PRIMARY KEY (PRICINGCLASSETARIFARIA_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_CLAS_TAR_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_OCUPA_ANTECIPA ( + PRICINGOCUPAANTECIPA_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + CANTASIENTOSMIN NUMBER(2,0), + CANTASIENTOSMAX NUMBER(2,0), + CANTDIASMIN NUMBER(3,0), + CANTDIASMAX NUMBER(3,0), + PORCENTAJE NUMBER(5,2), + IMPORTE NUMBER(5,2), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + OCUPACIONINICIAL NUMBER(5,2), + OCUPACIONFINAL NUMBER(5,2), + PRICINGCLASSETARIFARIA_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_OCUPA_ANTECIPA PRIMARY KEY (PRICINGOCUPAANTECIPA_ID), + CONSTRAINT FK_GP_PRICING_OCUPA_ANTECIPA FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_PRICING_CLAS_TAR FOREIGN KEY(PRICINGCLASSETARIFARIA_ID) REFERENCES GP_PRICING_CLASSE_TARIFARIA (PRICINGCLASSETARIFARIA_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_OCUPA_ANTECIPA_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_FORMAPAGO ( + PRICINGFORMAPAGO_ID NUMBER(7,0) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0), + FORMAPAGO_ID NUMBER(2,0), + INDEXCEPCION NUMBER(1,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_FORMAPAGO PRIMARY KEY (PRICINGFORMAPAGO_ID), + CONSTRAINT FK_GP_PRICING_FORMAPAGO FOREIGN KEY(PRICING_ID) REFERENCES GP_PRICING (PRICING_ID), + CONSTRAINT FK_GP_PRICING_FORMA_PAGO FOREIGN KEY(FORMAPAGO_ID) REFERENCES FORMA_PAGO (FORMAPAGO_ID) + )'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_FORMAPAGO_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190110_1555__mantis13108.sql b/src/db/migration/migration/V20190110_1555__mantis13108.sql new file mode 100644 index 000000000..797b0dce6 --- /dev/null +++ b/src/db/migration/migration/V20190110_1555__mantis13108.sql @@ -0,0 +1,23 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_SEGURO ADD INDVENDESEGUROOPCEMBARCADA NUMBER (1,0) DEFAULT 1'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_SEGURO ADD INDVENDESEGUROTABELAEMBARCADA NUMBER (1,0) DEFAULT 1'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_SEGURO ADD INDTAXAEMBARQUEEMBARCADA NUMBER (1,0) DEFAULT 1'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190114_1544__mantis13275.sql b/src/db/migration/migration/V20190114_1544__mantis13275.sql new file mode 100644 index 000000000..fbcf7e062 --- /dev/null +++ b/src/db/migration/migration/V20190114_1544__mantis13275.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (TIPO VARCHAR(10))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190114_1844__mantis13281.sql b/src/db/migration/migration/V20190114_1844__mantis13281.sql new file mode 100644 index 000000000..84ef5014b --- /dev/null +++ b/src/db/migration/migration/V20190114_1844__mantis13281.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDEXIGECLICOMPVDACALLCENTER NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190115_1537__mantis13283.sql b/src/db/migration/migration/V20190115_1537__mantis13283.sql new file mode 100644 index 000000000..2101928e0 --- /dev/null +++ b/src/db/migration/migration/V20190115_1537__mantis13283.sql @@ -0,0 +1,14 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (DESCORIGEM VARCHAR(60), + DESCDESTINO VARCHAR(60), + DESCORIGEM_VOLTA VARCHAR(60), + DESCDESTINO_VOLTA VARCHAR(60), + DATASERVICO DATE, + DATASERVICO_VOLTA DATE, + NUMSERVICO VARCHAR(7), + NUMSERVICO_VOLTA VARCHAR(7))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190116_1446__mantis13283.sql b/src/db/migration/migration/V20190116_1446__mantis13283.sql new file mode 100644 index 000000000..cb3ec87ce --- /dev/null +++ b/src/db/migration/migration/V20190116_1446__mantis13283.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (PARADA_ID_VOLTA NUMBER(7))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190116_1539__mantis13304.sql b/src/db/migration/migration/V20190116_1539__mantis13304.sql new file mode 100644 index 000000000..7725c0579 --- /dev/null +++ b/src/db/migration/migration/V20190116_1539__mantis13304.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (NOMECARTAO VARCHAR(60), CLASESERVICIO_VOLTA VARCHAR(60))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190117_1506__mantis13138.sql b/src/db/migration/migration/V20190117_1506__mantis13138.sql new file mode 100644 index 000000000..4aff937f2 --- /dev/null +++ b/src/db/migration/migration/V20190117_1506__mantis13138.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_PARAMGERAL ADD (BOLETO_BANCO_INSTRUCAO VARCHAR2(255))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190117_1948__mantis13336.sql b/src/db/migration/migration/V20190117_1948__mantis13336.sql new file mode 100644 index 000000000..a32441bf4 --- /dev/null +++ b/src/db/migration/migration/V20190117_1948__mantis13336.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (DATA_VENDA DATE, CLASESERVICIO VARCHAR(60), PARADA_ID NUMBER(7), CLIENTE_ID NUMBER(7))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190118_1454__mantis13109.sql b/src/db/migration/migration/V20190118_1454__mantis13109.sql new file mode 100644 index 000000000..7a18c6c78 --- /dev/null +++ b/src/db/migration/migration/V20190118_1454__mantis13109.sql @@ -0,0 +1,18 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_CAT_IND ADD INDTOTALBUS NUMBER (1,0) DEFAULT 1'; + exception when column_exists then null; +end; + +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_CAT_IND ADD INDEMBARCADA NUMBER (1,0) DEFAULT 1'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20190119_1457__mantis13358.sql b/src/db/migration/migration/V20190119_1457__mantis13358.sql new file mode 100644 index 000000000..8e0d01a2e --- /dev/null +++ b/src/db/migration/migration/V20190119_1457__mantis13358.sql @@ -0,0 +1,27 @@ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE FISCAL_J1 MODIFY ( NUMSERIENOTAFISCAL VARCHAR2(8) )'; + + exception when column_exists then null; + +end; +/ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE FISCAL_J2 MODIFY ( NUMSERIENOTAFISCAL VARCHAR2(8) )'; + + exception when column_exists then null; + +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190122_0944__mantis9882.sql b/src/db/migration/migration/V20190122_0944__mantis9882.sql new file mode 100644 index 000000000..566537cbf --- /dev/null +++ b/src/db/migration/migration/V20190122_0944__mantis9882.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD INDPERMITEDEVTOTALRIOCARD NUMBER (1,0) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190122_1400__mantis13252.sql b/src/db/migration/migration/V20190122_1400__mantis13252.sql new file mode 100644 index 000000000..57f33fbf2 --- /dev/null +++ b/src/db/migration/migration/V20190122_1400__mantis13252.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDEMITECANCBPETROCAORIGDEST NUMBER(1,0) DEFAULT 1'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE EMPRESA SET FECMODIF = SYSDATE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190122_1627__mantis13363.sql b/src/db/migration/migration/V20190122_1627__mantis13363.sql new file mode 100644 index 000000000..3ba2fa0a4 --- /dev/null +++ b/src/db/migration/migration/V20190122_1627__mantis13363.sql @@ -0,0 +1,71 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE TK_PASSAGEIRO ( + TKPASSAGEIRO_ID NUMBER(7) NOT NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + NOMBPASAJERO VARCHAR2(180) NULL, + DESCNUMDOC VARCHAR2(45) NULL, + BOLETO_ID NUMBER(15) NULL, + TRANSACAOKONDUTO_ID NUMBER(7) NULL, + DADOSSERVICO VARCHAR2(30) NULL, + NUMSERVICO VARCHAR2(7) NULL, + PRIMARY KEY (TKPASSAGEIRO_ID), + FOREIGN KEY (TRANSACAOKONDUTO_ID) + REFERENCES TRANSACAO_KONDUTO, + FOREIGN KEY (BOLETO_ID) + REFERENCES BOLETO, + FOREIGN KEY (USUARIO_ID) + REFERENCES USUARIO + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE TK_FORMAPAGO ( + TKFORMAPAGO_ID NUMBER(7) NOT NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + QTDE_PARCELAS NUMBER(3) NULL, + MESANO_TARJETA VARCHAR2(6) NULL, + PRIMEIROS_SEIS_DIGITOS_TARJETA VARCHAR2(6) NULL, + ULTIMOS_QUATRO_DIGITOS_TARJETA VARCHAR2(4) NULL, + VALOR NUMBER(7,2) NULL, + NSU VARCHAR2(45) NULL, + NUMAUTORIZACION VARCHAR2(45) NULL, + NOMECLIENTE VARCHAR2(60) NULL, + TIPO VARCHAR2(10) NULL, + TRANSACAOKONDUTO_ID NUMBER(7) NULL, + PRIMARY KEY (TKFORMAPAGO_ID), + FOREIGN KEY (TRANSACAOKONDUTO_ID) + REFERENCES TRANSACAO_KONDUTO, + FOREIGN KEY (USUARIO_ID) + REFERENCES USUARIO + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE TKPASSAGEIRO_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE TKFORMAPAGO_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190123_1828__mantis13363.sql b/src/db/migration/migration/V20190123_1828__mantis13363.sql new file mode 100644 index 000000000..10f02e842 --- /dev/null +++ b/src/db/migration/migration/V20190123_1828__mantis13363.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TRANSACAO_KONDUTO ADD (PARADA_ID_DESTINO NUMBER(7), PARADA_ID_DESTINO_VOLTA NUMBER(7))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190125_1145__mantis13036.sql b/src/db/migration/migration/V20190125_1145__mantis13036.sql new file mode 100644 index 000000000..d561f1662 --- /dev/null +++ b/src/db/migration/migration/V20190125_1145__mantis13036.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''VDA > RECEITA / DESPESA > REGISTRO RECEITA / DESPESA AGENCIA'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUEVENTOEXTRAAGENCIA'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190125_1407__mantis13428.sql b/src/db/migration/migration/V20190125_1407__mantis13428.sql new file mode 100644 index 000000000..2efb3da52 --- /dev/null +++ b/src/db/migration/migration/V20190125_1407__mantis13428.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARIFA ADD (FECHORINTEGRADOTOTVS DATE )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190125_1430__mantis12989.sql b/src/db/migration/migration/V20190125_1430__mantis12989.sql new file mode 100644 index 000000000..16d3633da --- /dev/null +++ b/src/db/migration/migration/V20190125_1430__mantis12989.sql @@ -0,0 +1,17 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD TIPOIMPRESSORARELATORIO NUMBER(2)'; + exception when column_exists then null; +end; +/ +begin + execute immediate 'COMMENT ON COLUMN ESTACION.TIPOIMPRESSORARELATORIO IS ''1-A4, 2-T�rmica'''; +end; +/ +declare +begin + execute immediate 'UPDATE ESTACION SET FECMODIF = SYSDATE'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190208_1520__mantis13539.sql b/src/db/migration/migration/V20190208_1520__mantis13539.sql new file mode 100644 index 000000000..02c53dcc9 --- /dev/null +++ b/src/db/migration/migration/V20190208_1520__mantis13539.sql @@ -0,0 +1,11 @@ +declare + begin + execute immediate 'CREATE SEQUENCE FISCAL_J1_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'CREATE SEQUENCE FISCAL_J2_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190211_1030__mantis12717.sql b/src/db/migration/migration/V20190211_1030__mantis12717.sql new file mode 100644 index 000000000..7f7f3948e --- /dev/null +++ b/src/db/migration/migration/V20190211_1030__mantis12717.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD (HORACANCELAMENTO VARCHAR2(6 BYTE))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190213_1833__mantis13369.sql b/src/db/migration/migration/V20190213_1833__mantis13369.sql new file mode 100644 index 000000000..d6b0637bf --- /dev/null +++ b/src/db/migration/migration/V20190213_1833__mantis13369.sql @@ -0,0 +1,22 @@ +--drop index se existe +DECLARE +itemExists NUMBER; +BEGIN + itemExists := 0; + +SELECT COUNT(INDEX_NAME) INTO itemExists +FROM ALL_INDEXES +WHERE UPPER(INDEX_NAME) LIKE UPPER('PRECIO_VENTAJA__UN'); + + +IF itemExists > 0 THEN +begin + EXECUTE IMMEDIATE 'drop index PRECIO_VENTAJA__UN'; + EXECUTE IMMEDIATE 'ALTER TABLE PRECIO_VENTAJA ADD CONSTRAINT PRECIO_VENTAJA_PK PRIMARY KEY (PRECIOVENTAJA_ID )'; + exception when others then null; +end; +END IF; + +END; + + diff --git a/src/db/migration/migration/V20190218_1112__mantis13461.sql b/src/db/migration/migration/V20190218_1112__mantis13461.sql new file mode 100644 index 000000000..0e69aed61 --- /dev/null +++ b/src/db/migration/migration/V20190218_1112__mantis13461.sql @@ -0,0 +1,20 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + + 'CREATE TABLE DIGITA_ITEM_BOLETO + ( + DIGITAITEMBOLETO_ID NUMBER(7) NOT NULL + , DIGITAITEM_ID NUMBER(3) NOT NULL + , DIGITAVENTA_ID NUMBER(7) NOT NULL + , BOLETO_ID NUMBER(15) NOT NULL + , FECMODIF DATE DEFAULT sysdate + , CONSTRAINT DIGITAITEMBOLETO_ID_PK PRIMARY KEY ( DIGITAITEMBOLETO_ID ) ENABLE + , CONSTRAINT DIGITA_ITEM_BOLETO_BOLETO_FK FOREIGN KEY( BOLETO_ID ) REFERENCES BOLETO( BOLETO_ID )ENABLE + , CONSTRAINT DIGITA_ITEM_BOLETO_ITEM_FK FOREIGN KEY( DIGITAITEM_ID , DIGITAVENTA_ID ) REFERENCES DIGITA_ITEM( DIGITAITEM_ID , DIGITAVENTA_ID )ENABLE + )'; +exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20190221_1045__mantis13649.sql b/src/db/migration/migration/V20190221_1045__mantis13649.sql new file mode 100644 index 000000000..a70896913 --- /dev/null +++ b/src/db/migration/migration/V20190221_1045__mantis13649.sql @@ -0,0 +1,14 @@ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE TARIFA MODIFY TARIFA_ID NUMBER(10,0)'; + + exception when column_exists then null; + +end; +/ diff --git a/src/db/migration/migration/V20190221_1205__mantis_13649_2.sql b/src/db/migration/migration/V20190221_1205__mantis_13649_2.sql new file mode 100644 index 000000000..db1199d9a --- /dev/null +++ b/src/db/migration/migration/V20190221_1205__mantis_13649_2.sql @@ -0,0 +1,29 @@ + +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE TARIFA_CATEGORIA MODIFY TARIFA_ID NUMBER(10,0)'; + + exception when column_exists then null; + +end; +/ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE TARIFA_TIPOPTOVTA MODIFY TARIFA_ID NUMBER(10,0)'; + + exception when column_exists then null; + +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20190221_1505__mantis_13671.sql b/src/db/migration/migration/V20190221_1505__mantis_13671.sql new file mode 100644 index 000000000..87fb4aec6 --- /dev/null +++ b/src/db/migration/migration/V20190221_1505__mantis_13671.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD CERTIFICADO VARCHAR2(20)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V201902221_1223__mantis13461.sql b/src/db/migration/migration/V201902221_1223__mantis13461.sql new file mode 100644 index 000000000..8b77d3756 --- /dev/null +++ b/src/db/migration/migration/V201902221_1223__mantis13461.sql @@ -0,0 +1,5 @@ +declare + begin + execute immediate 'CREATE SEQUENCE DIGITA_ITEM_BOLETO_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20190222_0940__mantis13440.sql b/src/db/migration/migration/V20190222_0940__mantis13440.sql new file mode 100644 index 000000000..cc48ec1ad --- /dev/null +++ b/src/db/migration/migration/V20190222_0940__mantis13440.sql @@ -0,0 +1,79 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD PUNTOVENTA_ID NUMBER(7)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD PUNTOVENTA_CANCELAMENTO_ID NUMBER(7)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD TIPOPTOVTA_ID NUMBER(2)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD DESC_LOCAL_VENDA VARCHAR2(180)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD DESC_LOCAL_CANCELAMENTO VARCHAR2(180)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD UF_VENDA VARCHAR2(2)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD UF_CANCELAMENTO VARCHAR2(2)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD HORACANCELAMENTO VARCHAR2(5)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD NUMKMVIAJE NUMBER(7,2)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TAXPOLV ADD DESCRUTA VARCHAR2(60)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20190222_1700__mantis13686.sql b/src/db/migration/migration/V20190222_1700__mantis13686.sql new file mode 100644 index 000000000..a43b27d85 --- /dev/null +++ b/src/db/migration/migration/V20190222_1700__mantis13686.sql @@ -0,0 +1,14 @@ +declare + + column_exists exception; + + pragma exception_init (column_exists , -01430); + +begin + + execute immediate 'ALTER TABLE CHECKIN_AUTOMATICO MODIFY CHECKINAUTOMATICO_ID NUMBER(15,0)'; + + exception when column_exists then null; + +end; +/ diff --git a/src/db/migration/migration/V20190226_1540__mantis13647.sql b/src/db/migration/migration/V20190226_1540__mantis13647.sql new file mode 100644 index 000000000..a43767cfd --- /dev/null +++ b/src/db/migration/migration/V20190226_1540__mantis13647.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE BPE_CTRL_DISPONIBILIDADE ( + BPECTRLDISP_ID NUMBER(8), + CVEESTADO VARCHAR(3), + EMPRESA_ID NUMBER(7), + SERIE VARCHAR(3), + NUMERO VARCHAR(9), + BPE_REJEITADO_ID NUMBER(7,0), + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (BPECTRLDISP_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE BPE_CTRL_DISPONIBILIDADE_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190226_1545__mantis13650.sql b/src/db/migration/migration/V20190226_1545__mantis13650.sql new file mode 100644 index 000000000..6e626519c --- /dev/null +++ b/src/db/migration/migration/V20190226_1545__mantis13650.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''RELATORIOS > RELATORIOS FINANCEIRO > VENDAS DE REQUISICAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASREQUISICAO'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190227_1840__mantis13647.sql b/src/db/migration/migration/V20190227_1840__mantis13647.sql new file mode 100644 index 000000000..dee5ea7c4 --- /dev/null +++ b/src/db/migration/migration/V20190227_1840__mantis13647.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDREAPROVEITARNUMBPEREJEITADO NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE EMPRESA SET INDREAPROVEITARNUMBPEREJEITADO = 0'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190227_1956__mantis13723.sql b/src/db/migration/migration/V20190227_1956__mantis13723.sql new file mode 100644 index 000000000..0654f3c25 --- /dev/null +++ b/src/db/migration/migration/V20190227_1956__mantis13723.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_EMAIL_CONFIG ADD INDAUTENTICACAO NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190227_2030__mantis13611.sql b/src/db/migration/migration/V20190227_2030__mantis13611.sql new file mode 100644 index 000000000..2c013d4b1 --- /dev/null +++ b/src/db/migration/migration/V20190227_2030__mantis13611.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE INDEX IDX_CHAVE ON CUSTOM (CHAVE)'; + exception when object_exists then null; +end; +/ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval, 1,''ADM > SEGURANCA > CUSTOMIZACAO SISTEMA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.CUSTOM'',1,sysdate,null)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190228_1000__mantis13714.sql b/src/db/migration/migration/V20190228_1000__mantis13714.sql new file mode 100644 index 000000000..30e37e870 --- /dev/null +++ b/src/db/migration/migration/V20190228_1000__mantis13714.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''RELATORIOS > RELATORIOS OPERACIONAIS > EMBARQUE LOCALIDADE'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOEMBARQUELOCALIDADE'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190301_0952__mantis13012.sql b/src/db/migration/migration/V20190301_0952__mantis13012.sql new file mode 100644 index 000000000..cdd70594a --- /dev/null +++ b/src/db/migration/migration/V20190301_0952__mantis13012.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS ADD AIDF_ID NUMBER(15,0)'; + exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20190307_1720__mantis13482.sql b/src/db/migration/migration/V20190307_1720__mantis13482.sql new file mode 100644 index 000000000..a2621e35a --- /dev/null +++ b/src/db/migration/migration/V20190307_1720__mantis13482.sql @@ -0,0 +1,16 @@ +declare +begin + execute immediate + 'INSERT INTO flyway_scripts (NOME, SQL, OBSERVACAO, SQL_ERRO, DATAHORA_EXECUCAO, ACTIVO, FECMODIF) + VALUES ( + ''V20190307_1720__mantis13482'', + ''CREATE INDEX "IDX_CONSULTABOL_FECVENTA_H" ON "BOLETO" ("FECHORVENTA_H") + PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 + PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)'', + ''index do campo fechorventa_h na tabela boleto'', + ''-00001'', + (select TO_DATE(to_char(trunc(sysdate)+1 || '' 03:00:00''), ''YYYY-MM-DD HH24:MI:SS'' ) from dual) , + 1, + SYSDATE)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190308_1702__mantis13702.sql b/src/db/migration/migration/V20190308_1702__mantis13702.sql new file mode 100644 index 000000000..3e0eed675 --- /dev/null +++ b/src/db/migration/migration/V20190308_1702__mantis13702.sql @@ -0,0 +1,12 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'Insert into TIPO_OCUPACION (TIPOOCUPACION_ID,CVETIPOOCUPACION,DESCTIPO,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID) +values (TIPO_OCUPACION_SEQ.nextval, null,''Idoso'',null,1,sysdate,1)'; + execute immediate 'Insert into TIPO_OCUPACION (TIPOOCUPACION_ID,CVETIPOOCUPACION,DESCTIPO,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID) +values (TIPO_OCUPACION_SEQ.nextval, null,''Aposentado'',null,1,sysdate,1)'; + execute immediate 'Insert into TIPO_OCUPACION (TIPOOCUPACION_ID,CVETIPOOCUPACION,DESCTIPO,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID) +values (TIPO_OCUPACION_SEQ.nextval, null,''Pensionista'',null,1,sysdate,1)'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20190311_1447__mantis13702.sql b/src/db/migration/migration/V20190311_1447__mantis13702.sql new file mode 100644 index 000000000..7b349b5a7 --- /dev/null +++ b/src/db/migration/migration/V20190311_1447__mantis13702.sql @@ -0,0 +1,8 @@ +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''VALIDA_IDOSO_AGER'',''VALIDA_IDOSO_AGER'', + null,''12,13'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190311_1552__mantis13702.sql b/src/db/migration/migration/V20190311_1552__mantis13702.sql new file mode 100644 index 000000000..797473163 --- /dev/null +++ b/src/db/migration/migration/V20190311_1552__mantis13702.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD TIPOOCUPACION_ID NUMBER(7,0)'; + exception when object_exists then null; +end; + diff --git a/src/db/migration/migration/V20190312_1508__mantis13471.sql b/src/db/migration/migration/V20190312_1508__mantis13471.sql new file mode 100644 index 000000000..fc13c3cf6 --- /dev/null +++ b/src/db/migration/migration/V20190312_1508__mantis13471.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'INSERT INTO funcion_sistema VALUES (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > GRATUIDADE AGER'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOGRATUIDADEAGER'', 1, SYSDATE, 1)'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20190312_2222__mantis13655.sql b/src/db/migration/migration/V20190312_2222__mantis13655.sql new file mode 100644 index 000000000..a8c606ad1 --- /dev/null +++ b/src/db/migration/migration/V20190312_2222__mantis13655.sql @@ -0,0 +1,13 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (DT_VENDA DATE)'; + exception when column_exists then null; +end; +/ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval, 1,''ADM > RELATORIOS > RELATORIOS > BPe'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.RELATORIO.BPE'',1,sysdate,null)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190314_1009__mantis13559.sql b/src/db/migration/migration/V20190314_1009__mantis13559.sql new file mode 100644 index 000000000..f1f2d95a2 --- /dev/null +++ b/src/db/migration/migration/V20190314_1009__mantis13559.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'INSERT INTO funcion_sistema VALUES (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIOS > RELATORIOS > INTEGRACAO > RECEITAS/DESPESAS DIVERSAS'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIORECEITASDEPESASDIV'', 1, SYSDATE, 1)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20190318_1729__mantis13743.sql b/src/db/migration/migration/V20190318_1729__mantis13743.sql new file mode 100644 index 000000000..f1319e9e5 --- /dev/null +++ b/src/db/migration/migration/V20190318_1729__mantis13743.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDSUBSTITUICAOIGUALSEFAZ NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190319_1131__mantis13559.sql b/src/db/migration/migration/V20190319_1131__mantis13559.sql new file mode 100644 index 000000000..4781e9835 --- /dev/null +++ b/src/db/migration/migration/V20190319_1131__mantis13559.sql @@ -0,0 +1,31 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE LOG_DESPESAS_RECEITAS_DIV + ( + DESPESASRECEITASDIV_ID NUMBER(7) + , USUARIO_ID NUMBER(7) + , DATA_EXEC DATE + , DATA_INICIO DATE + , DATA_FIM DATE + , EMPRESA_ID NUMBER(7) + , PROCESSADO NUMBER(1), + CONSTRAINT LOG_DESPESAS_RECEITAS_DIV_PK PRIMARY KEY + ( + DESPESASRECEITASDIV_ID + ) + ENABLE + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE LOG_DESPESAS_RECEITAS_DIV_SEQ INCREMENT BY 1 START WITH 1 '; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190320_1605__mantis13751.sql b/src/db/migration/migration/V20190320_1605__mantis13751.sql new file mode 100644 index 000000000..c86b1a68d --- /dev/null +++ b/src/db/migration/migration/V20190320_1605__mantis13751.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA ADD INDVENDAEMBARCADA NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190321_1012__mantis13747.sql b/src/db/migration/migration/V20190321_1012__mantis13747.sql new file mode 100644 index 000000000..fb107d334 --- /dev/null +++ b/src/db/migration/migration/V20190321_1012__mantis13747.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > ESQUEMA OPERACIONAL > CONFIGURACAO VENDA EMBARCADA'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.CONFVENDAEMBARCADA'', + ''1'',to_date(''20/03/19'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190321_1710__mantis13746.sql b/src/db/migration/migration/V20190321_1710__mantis13746.sql new file mode 100644 index 000000000..14cf01458 --- /dev/null +++ b/src/db/migration/migration/V20190321_1710__mantis13746.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''ADM > SEGURANCA > DISPOSITIVO VENDA EMBARCADA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.DISPOSITIVOVENDAEMBARCADA'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190322_1417__mantis13747.sql b/src/db/migration/migration/V20190322_1417__mantis13747.sql new file mode 100644 index 000000000..9f9a91937 --- /dev/null +++ b/src/db/migration/migration/V20190322_1417__mantis13747.sql @@ -0,0 +1,73 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE OPERADOR_EMBARCADA ( + OPERADOR_EMBARCADA_ID NUMBER(10,0), + USUARIO_ID NUMBER(7,0), + FECMODIF DATE NULL, + ACTIVO NUMBER(1,0) DEFAULT 0, + PRIMARY KEY (OPERADOR_EMBARCADA_ID) ENABLE, + CONSTRAINT OPERADOR_EMBARCADA_USUARIO_FK FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO(USUARIO_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE OPERADOR_EMBARCADA_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE OPERADOR_EMBARCADA_LINHA ( + OPERADOR_EMBARCADA_LINHA_ID NUMBER(10,0), + OPERADOR_EMBARCADA_ID NUMBER(10,0), + RUTA_ID NUMBER(7,0) NOT NULL, + ACTIVO NUMBER(1,0) DEFAULT 0, + PRIMARY KEY (OPERADOR_EMBARCADA_LINHA_ID) ENABLE, + CONSTRAINT OPERADOR_EMBARCADA_FK FOREIGN KEY (OPERADOR_EMBARCADA_ID) REFERENCES OPERADOR_EMBARCADA(OPERADOR_EMBARCADA_ID) ENABLE, + CONSTRAINT OPERADOR_EMBARCADA_RUTA_FK FOREIGN KEY (RUTA_ID) REFERENCES RUTA(RUTA_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE OPERADOR_EMBARCADA_LINHA_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE OPERADOR_EMBARCADA_SERVICO ( + OPERADOR_EMBARCADA_SERVICO_ID NUMBER(10,0), + OPERADOR_EMBARCADA_ID NUMBER(10,0), + ESQUEMA_CORRIDA_ID NUMBER(7,0) NOT NULL, + ACTIVO NUMBER(1,0) DEFAULT 0, + PRIMARY KEY (OPERADOR_EMBARCADA_SERVICO_ID) ENABLE, + CONSTRAINT OPERADOR_EMBARCADA_SERVICO_FK FOREIGN KEY (OPERADOR_EMBARCADA_ID) REFERENCES OPERADOR_EMBARCADA(OPERADOR_EMBARCADA_ID) ENABLE, + CONSTRAINT OPERADOR_ESQUEMA_SERVICO_FK FOREIGN KEY (ESQUEMA_CORRIDA_ID) REFERENCES ESQUEMA_CORRIDA(ESQUEMACORRIDA_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE OPERADOR_EMBARCADA_SERVICO_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190322_1620__mantis13746.sql b/src/db/migration/migration/V20190322_1620__mantis13746.sql new file mode 100644 index 000000000..ed10038fa --- /dev/null +++ b/src/db/migration/migration/V20190322_1620__mantis13746.sql @@ -0,0 +1,61 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE DISPOSITIVO_EMBARCADA ( + DISPOSITIVOEMBARCADA_ID NUMBER(8), + EMPRESA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7), + DESCRICAO VARCHAR2(200), + REGISTRO VARCHAR2(200), + MAC VARCHAR2(20), + IMEI VARCHAR2(200), + IND_DISP_BLOQUEADO NUMBER(1) DEFAULT 0, + MOTIVO_DISP_BLOQUEADO VARCHAR2(200), + IND_DISP_MANUTENCAO NUMBER(1) DEFAULT 0, + MOTIVO_DISP_MANUTENCAO VARCHAR2(200), + IND_DISP_BAIXADO NUMBER(1) DEFAULT 0, + MOTIVO_DISP_BAIXADO VARCHAR2(200), + FECMODIF DATE, + ACTIVO NUMBER(1), + USUARIO_ID NUMBER(7), + PRIMARY KEY (DISPOSITIVOEMBARCADA_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE DISPOSITIVO_EMBARCADA_SEQ INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE DISPOSITIVO_EMBARCADA_HIST ( + DISPOSITIVO_EMBARCADA_HIST_ID NUMBER(12), + DISPOSITIVOEMBARCADA_ID NUMBER(8), + DESCRICAO VARCHAR2(500), + FECMODIF DATE, + ACTIVO NUMBER(1), + USUARIO_ID NUMBER(7), + PRIMARY KEY (DISPOSITIVO_EMBARCADA_HIST_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE DISPOSITIVO_EMBARCADA_HIST_SEQ INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20190322_1640__mantis13748.sql b/src/db/migration/migration/V20190322_1640__mantis13748.sql new file mode 100644 index 000000000..7e6958ce0 --- /dev/null +++ b/src/db/migration/migration/V20190322_1640__mantis13748.sql @@ -0,0 +1,30 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CTRL_SERIE_EMBARCADA ( + CTRLSERIEEMBARCADA_ID NUMBER(8), + DISPOSITIVOEMBARCADA_ID NUMBER(8), + EMPRESA_ID NUMBER(7), + ESTADO_ID NUMBER(7), + SERIE VARCHAR(3), + NUMEROINICIAL VARCHAR(9), + NUMEROCORRENTE VARCHAR(9), + IND_BAIXADO NUMBER(1) DEFAULT 0, + FECMODIF DATE, + ACTIVO NUMBER(1), + USUARIO_ID NUMBER(7), + PRIMARY KEY (CTRLSERIEEMBARCADA_ID) + )'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE CTRL_SERIE_EMBARCADA_SEQ INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20190323_0951__mantis9999.sql b/src/db/migration/migration/V20190323_0951__mantis9999.sql new file mode 100644 index 000000000..e11409a2a --- /dev/null +++ b/src/db/migration/migration/V20190323_0951__mantis9999.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into MOTIVO_REIMPRESION (MOTIVOREIMPRESION_ID,DESCMOTIVO,ACTIVO,FECMODIF,USUARIO_ID) values (''99'',''EMISSAO SEGUNDA VIA '',''1'',SYSDATE,''1'')'; + exception when dup_val_on_index then null; +end; + diff --git a/src/db/migration/migration/V20190327_1200__mantis13748.sql b/src/db/migration/migration/V20190327_1200__mantis13748.sql new file mode 100644 index 000000000..46fd5729f --- /dev/null +++ b/src/db/migration/migration/V20190327_1200__mantis13748.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CTRL_SERIE_EMBARCADA ADD CTRLSERIEEMBARCADASEQ_ID NUMBER(8)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190327_1550__mantis13748.sql b/src/db/migration/migration/V20190327_1550__mantis13748.sql new file mode 100644 index 000000000..9a4d12531 --- /dev/null +++ b/src/db/migration/migration/V20190327_1550__mantis13748.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CTRL_SERIE_EMBARCADA ADD IND_REUTILIZADO NUMBER(1) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190327_1600__mantis13746.sql b/src/db/migration/migration/V20190327_1600__mantis13746.sql new file mode 100644 index 000000000..eafd543c6 --- /dev/null +++ b/src/db/migration/migration/V20190327_1600__mantis13746.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE DISPOSITIVO_EMBARCADA_HIST ADD TIPO_BLOQUEIO_DISP_EMBARCADA NUMBER(2)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20190327_1801__mantis13959.sql b/src/db/migration/migration/V20190327_1801__mantis13959.sql new file mode 100644 index 000000000..18ff47292 --- /dev/null +++ b/src/db/migration/migration/V20190327_1801__mantis13959.sql @@ -0,0 +1,8 @@ +declare + begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''IS_IMPRIME_TAXAEMBARQUE_SEM_VALIDACAO'',''IS_IMPRIME_TAXAEMBARQUE_SEM_VALIDACAO'', + null,null,null,''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190328_1531__mantis13702.sql b/src/db/migration/migration/V20190328_1531__mantis13702.sql new file mode 100644 index 000000000..dfa3a43a5 --- /dev/null +++ b/src/db/migration/migration/V20190328_1531__mantis13702.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD INDTIPOOCUPACAO NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190329_1700__mantis13748.sql b/src/db/migration/migration/V20190329_1700__mantis13748.sql new file mode 100644 index 000000000..92b5c2928 --- /dev/null +++ b/src/db/migration/migration/V20190329_1700__mantis13748.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''ADM > SEGURANCA > AUTORIZACAO DE USO DE SERIE POR DISPOSITIVO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.AUTORIZACAOUSOSERIEEMBARCADA'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190401_1541__mantis13764.sql b/src/db/migration/migration/V20190401_1541__mantis13764.sql new file mode 100644 index 000000000..019a2172c --- /dev/null +++ b/src/db/migration/migration/V20190401_1541__mantis13764.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'INSERT INTO funcion_sistema VALUES (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIOS > RELATORIOS ESTATISTICOS > VENDA EMBARCADA'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDAEMBARCADA'', 1, SYSDATE, 1)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20190402_1710__mantis13748.sql b/src/db/migration/migration/V20190402_1710__mantis13748.sql new file mode 100644 index 000000000..bfdef49e2 --- /dev/null +++ b/src/db/migration/migration/V20190402_1710__mantis13748.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CTRL_SERIE_EMBARCADA ADD PUNTOVENTA_ID NUMBER(7)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190403_1534__mantis13874.sql b/src/db/migration/migration/V20190403_1534__mantis13874.sql new file mode 100644 index 000000000..37022926a --- /dev/null +++ b/src/db/migration/migration/V20190403_1534__mantis13874.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_DEPOSITO MODIFY (NUMDEPOSITO VARCHAR2(16 BYTE))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190404_1416__mantis13826.sql b/src/db/migration/migration/V20190404_1416__mantis13826.sql new file mode 100644 index 000000000..b3aebadd6 --- /dev/null +++ b/src/db/migration/migration/V20190404_1416__mantis13826.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'INSERT INTO funcion_sistema VALUES (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > OPERACIONAL FINANCEIRO'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOOPERACIONALFINANCEIRO'', 1, SYSDATE, 1)'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20190404_2040__mantis14008.sql b/src/db/migration/migration/V20190404_2040__mantis14008.sql new file mode 100644 index 000000000..46d9b8c27 --- /dev/null +++ b/src/db/migration/migration/V20190404_2040__mantis14008.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (TRIBUTACAOIMPORTACAOIM NUMBER(5,2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190405_1744__mantis13845.sql b/src/db/migration/migration/V20190405_1744__mantis13845.sql new file mode 100644 index 000000000..e9bc93cf7 --- /dev/null +++ b/src/db/migration/migration/V20190405_1744__mantis13845.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''VDA > MAPA VIAGEM > RELATORIO APROVEITAMENTO'', ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENURELATORIOAPROVEITAMENTO'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190409_1107__mantis14038.sql b/src/db/migration/migration/V20190409_1107__mantis14038.sql new file mode 100644 index 000000000..ee596e4f6 --- /dev/null +++ b/src/db/migration/migration/V20190409_1107__mantis14038.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''VDA > CHECKIN > CHECKIN AUTOMATICO > LIBERAR ASSENTO > CONFIRMAR EMBARQUE'',''COM.RJCONSULTORES.VENTABOLETOS.WEB.UTILERIAS.MENU.ITEM.VENTA.HABILITARCONFEMBARQUECHECKINAUTOMATICO'',1,sysdate,1)'; +exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190411_1627__mantis13774.sql b/src/db/migration/migration/V20190411_1627__mantis13774.sql new file mode 100644 index 000000000..75cc74737 --- /dev/null +++ b/src/db/migration/migration/V20190411_1627__mantis13774.sql @@ -0,0 +1,16 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE INTEGRACAO_TOTVS_CAJA ( + INTEGRACAOCAJA_ID NUMBER(15) NOT NULL + , CAJA_ID NUMBER(15) NOT NULL + , INTEGRADOTOTVS NUMBER(5) + , FECHOREFETIVA TIMESTAMP + , MSG_RETORNO CLOB + , CONSTRAINT INTEGRACAO_TOTVS_CAJA_PK PRIMARY KEY ( INTEGRACAOCAJA_ID ) + )'; + + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190411_1650__mantis13746.sql b/src/db/migration/migration/V20190411_1650__mantis13746.sql new file mode 100644 index 000000000..129188f09 --- /dev/null +++ b/src/db/migration/migration/V20190411_1650__mantis13746.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD IMEI_DISPOSITIVO_EMBARCADA VARCHAR(20)'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD IMEI_DISPOSITIVO_EMBARCADA VARCHAR(20)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190415_1650__mantis14005.sql b/src/db/migration/migration/V20190415_1650__mantis14005.sql new file mode 100644 index 000000000..48c1e9727 --- /dev/null +++ b/src/db/migration/migration/V20190415_1650__mantis14005.sql @@ -0,0 +1,11 @@ +declare +begin + execute immediate 'INSERT INTO TIPO_VENTA (TIPOVENTA_ID, DESCTIPOVENTA, ACTIVO, FECMODIF, USUARIO_ID) VALUES (99, ''VENDA EMBARCADA'', 1, SYSDATE, 1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO TIPO_VENTA (TIPOVENTA_ID, DESCTIPOVENTA, ACTIVO, FECMODIF, USUARIO_ID) VALUES (98, ''TPV RESERVACION EMBARCADA'', 1, SYSDATE, 1)'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20190416_1053__mantis14100.sql b/src/db/migration/migration/V20190416_1053__mantis14100.sql new file mode 100644 index 000000000..1661513e0 --- /dev/null +++ b/src/db/migration/migration/V20190416_1053__mantis14100.sql @@ -0,0 +1,3 @@ +DROP SEQUENCE TARIFA_OFICIAL_SEQ; + +CREATE SEQUENCE TARIFA_OFICIAL_SEQ INCREMENT BY 1 MINVALUE 1 MAXVALUE 9999999 CYCLE NOCACHE NOORDER ; \ No newline at end of file diff --git a/src/db/migration/migration/V20190416_1334__mantis13963.sql b/src/db/migration/migration/V20190416_1334__mantis13963.sql new file mode 100644 index 000000000..2c85ae332 --- /dev/null +++ b/src/db/migration/migration/V20190416_1334__mantis13963.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'INSERT INTO MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,ACTIVO,FECMODIF,USUARIO_ID,CVESISTEMA,INDEXIBECANCEL) + VALUES (MOTIVO_CANCELACION_SEQ.NEXTVAL, ''ALTERACAO POLTRONA'', ''B'', 1, SYSDATE, 1, ''ALTERACAO_POLTRONA'', 0)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190418_1900__mantis13776.sql b/src/db/migration/migration/V20190418_1900__mantis13776.sql new file mode 100644 index 000000000..68b948a33 --- /dev/null +++ b/src/db/migration/migration/V20190418_1900__mantis13776.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE INTEGRACAO_TOTVS_CAJA_SEQ INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190418_1901__mantis13776.sql b/src/db/migration/migration/V20190418_1901__mantis13776.sql new file mode 100644 index 000000000..bd21fda3b --- /dev/null +++ b/src/db/migration/migration/V20190418_1901__mantis13776.sql @@ -0,0 +1,19 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE INTEGRACAO_TOTVS_CAJA ADD CONSTRAINT INTEGRACAO_TOTVS_CAJA_FK1 FOREIGN KEY(CAJA_ID )REFERENCES CAJA(CAJA_ID )'; + + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190418_1902__mantis13775.sql b/src/db/migration/migration/V20190418_1902__mantis13775.sql new file mode 100644 index 000000000..fa7f61dac --- /dev/null +++ b/src/db/migration/migration/V20190418_1902__mantis13775.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_REINTEGRACAO_BILHETE_TOTVS'',''CRON_ROTINA_REINTEGRACAO_BILHETE_TOTVS'', + 1,null,null,''0'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190418_1903__mantis13776.sql b/src/db/migration/migration/V20190418_1903__mantis13776.sql new file mode 100644 index 000000000..c8980eb38 --- /dev/null +++ b/src/db/migration/migration/V20190418_1903__mantis13776.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''PATH_LOG_REINTEGRACAO_TOTVS'',''PATH_LOG_REINTEGRACAO_TOTVS'', + 1,''/dados/jboss/log/reintegracao/'',null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190424_1646__mantis14166.sql b/src/db/migration/migration/V20190424_1646__mantis14166.sql new file mode 100644 index 000000000..19966c46d --- /dev/null +++ b/src/db/migration/migration/V20190424_1646__mantis14166.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''VDA > CAIXA > CONSULTA DE BILHETES > TROCAR POLTRONA BP-e'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.CONSULTABOLETO.TROCAPOLTRONA'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190429_1521__mantis14127.sql b/src/db/migration/migration/V20190429_1521__mantis14127.sql new file mode 100644 index 000000000..487988da4 --- /dev/null +++ b/src/db/migration/migration/V20190429_1521__mantis14127.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONFIG_RESTRICCION_PAGO ADD EMPRESA_ID NUMBER(7,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190430_0940__mantis14161.sql b/src/db/migration/migration/V20190430_0940__mantis14161.sql new file mode 100644 index 000000000..4b481961d --- /dev/null +++ b/src/db/migration/migration/V20190430_0940__mantis14161.sql @@ -0,0 +1,6 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table fechamento_deposito modify (numdeposito varchar2(22))'; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190430_1650__mantis13964.sql b/src/db/migration/migration/V20190430_1650__mantis13964.sql new file mode 100644 index 000000000..a77027ee2 --- /dev/null +++ b/src/db/migration/migration/V20190430_1650__mantis13964.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_EMP_PARAM ADD INDNAORESTRINGE2VIABPE NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20190501_0629__mantis13775.sql b/src/db/migration/migration/V20190501_0629__mantis13775.sql new file mode 100644 index 000000000..dfd45e874 --- /dev/null +++ b/src/db/migration/migration/V20190501_0629__mantis13775.sql @@ -0,0 +1 @@ +UPDATE CONSTANTE SET ACTIVO = 0 WHERE NOMBCONSTANTE = 'CRON_ROTINA_REINTEGRACAO_BILHETE_TOTVS'; \ No newline at end of file diff --git a/src/db/migration/migration/V20190502_1900__mantis13945.sql b/src/db/migration/migration/V20190502_1900__mantis13945.sql new file mode 100644 index 000000000..475ea79d7 --- /dev/null +++ b/src/db/migration/migration/V20190502_1900__mantis13945.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval, 1,''ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICO > QUADRO DEMONSTRATIVO DO MOVIMENTO PASSAGEIRO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.QUADRODEMONSTRATIVODOMOVIMENTOPASSAGEIRO'',1,sysdate,null)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190503_1731__mantis13804.sql b/src/db/migration/migration/V20190503_1731__mantis13804.sql new file mode 100644 index 000000000..70ac43cda --- /dev/null +++ b/src/db/migration/migration/V20190503_1731__mantis13804.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD INDBLOQUEIATIPOPASSAGEM NUMBER(1,0) DEFAULT 1'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190507_1700__mantis14171.sql b/src/db/migration/migration/V20190507_1700__mantis14171.sql new file mode 100644 index 000000000..62a6fc21b --- /dev/null +++ b/src/db/migration/migration/V20190507_1700__mantis14171.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD INDVALDOCOBLIGATORIOMONITRIP NUMBER(1,0) DEFAULT 0'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190508_1040__mantis14292.sql b/src/db/migration/migration/V20190508_1040__mantis14292.sql new file mode 100644 index 000000000..ee10e643c --- /dev/null +++ b/src/db/migration/migration/V20190508_1040__mantis14292.sql @@ -0,0 +1,8 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''ESTACAO_EMBARCADA'',''ESTACAO_EMBARCADA'', + 1,'''',null,''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190513_1428__mantis14659.sql b/src/db/migration/migration/V20190513_1428__mantis14659.sql new file mode 100644 index 000000000..f0a3a3aa5 --- /dev/null +++ b/src/db/migration/migration/V20190513_1428__mantis14659.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA MODIFY (CANTPARADOS NUMBER(7, 0) )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190522_0930__mantis14294.sql b/src/db/migration/migration/V20190522_0930__mantis14294.sql new file mode 100644 index 000000000..9d2c33a83 --- /dev/null +++ b/src/db/migration/migration/V20190522_0930__mantis14294.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDVENDAESTUDANTETOTEM NUMBER(1) DEFAULT 0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190523_1638__mantis14443.sql b/src/db/migration/migration/V20190523_1638__mantis14443.sql new file mode 100644 index 000000000..2015e378c --- /dev/null +++ b/src/db/migration/migration/V20190523_1638__mantis14443.sql @@ -0,0 +1,15 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES(FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM > SEGURAN�A > PAINEL BPE'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.PAINEL_BPE'', 1, NULL, 1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES +(CONSTANTE_seq.nextval,''URL_PAINEL_BPE'',''URL_PAINEL_BPE'',''1'',NULL,1,1,null,1)'; + exception when others then null; +end; +/ + diff --git a/src/db/migration/migration/V20190527_1812__mantis14159.sql b/src/db/migration/migration/V20190527_1812__mantis14159.sql new file mode 100644 index 000000000..2751f3ace --- /dev/null +++ b/src/db/migration/migration/V20190527_1812__mantis14159.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD INDMAPAVIAGEMIMPTERMICA NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190530_0916__mantis14278.sql b/src/db/migration/migration/V20190530_0916__mantis14278.sql new file mode 100644 index 000000000..086b2eb68 --- /dev/null +++ b/src/db/migration/migration/V20190530_0916__mantis14278.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > SEGURANCA > CONTINGENCIA'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.CONTINGENCIA'', + ''1'',to_date(''30/05/19'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190530_1500__mantis14485.sql b/src/db/migration/migration/V20190530_1500__mantis14485.sql new file mode 100644 index 000000000..55eaabe70 --- /dev/null +++ b/src/db/migration/migration/V20190530_1500__mantis14485.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,EQUIVALENCIAELEKTRA_ID,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO,CVESISTEMA,INDEXIBECANCEL) + values ((select max(id) from( +select min_a - 1 + level id + from ( select min(motivocancelacion_id) min_a + , max(motivocancelacion_id) max_a + from motivo_cancelacion + ) + connect by level <= max_a - min_a + 1 + minus + select motivocancelacion_id + from motivo_cancelacion)),''REJEICAO SEFAZ'',''B'',null,null,''1'',SYSDATE,''1'',null,''REJEICAO_SEFAZ'',null)'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190530_1700__mantis14278.sql b/src/db/migration/migration/V20190530_1700__mantis14278.sql new file mode 100644 index 000000000..92ea65b52 --- /dev/null +++ b/src/db/migration/migration/V20190530_1700__mantis14278.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE LOG_HISTORICO_CONTINGENCIA ( + LOGHISTORICOCONTINGENCIA_ID NUMBER(10,0), + MOTIVO VARCHAR2(300 BYTE), + USUARIO_ID NUMBER(7,0), + DATAHORA DATE NULL, + EMPRESA_ID NUMBER(7,0), + ESTADO_ID NUMBER(7,0), + STATUS VARCHAR2(20 BYTE), + PRIMARY KEY (LOGHISTORICOCONTINGENCIA_ID) ENABLE, + CONSTRAINT LOGHISTCONT_ID_USUARIO_FK FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO(USUARIO_ID) ENABLE, + CONSTRAINT LOGHISTCONT_ID_EMPRESA_FK FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA(EMPRESA_ID) ENABLE, + CONSTRAINT LOGHISTCONT_ID_ESTADO_FK FOREIGN KEY (ESTADO_ID) REFERENCES ESTADO(ESTADO_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE LOG_HISTORICO_CONTINGENCIA_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190531_1816__mantis14512.sql b/src/db/migration/migration/V20190531_1816__mantis14512.sql new file mode 100644 index 000000000..a3ef7e81c --- /dev/null +++ b/src/db/migration/migration/V20190531_1816__mantis14512.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD TRANSACAOANTERIOR_ID NUMBER(15,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190603_1520__Mantis14554.sql b/src/db/migration/migration/V20190603_1520__Mantis14554.sql new file mode 100644 index 000000000..240d59202 --- /dev/null +++ b/src/db/migration/migration/V20190603_1520__Mantis14554.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (EMPRESA_ID NUMBER(7))'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20190603_1653__mantis14497.sql b/src/db/migration/migration/V20190603_1653__mantis14497.sql new file mode 100644 index 000000000..fa14da539 --- /dev/null +++ b/src/db/migration/migration/V20190603_1653__mantis14497.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'alter table CLASE_SERVICIO ADD COEFICIENTETARIFA NUMBER(14,9)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190604_1714__mantis14278.sql b/src/db/migration/migration/V20190604_1714__mantis14278.sql new file mode 100644 index 000000000..3f2a8eafb --- /dev/null +++ b/src/db/migration/migration/V20190604_1714__mantis14278.sql @@ -0,0 +1,29 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_HISTORICO_CONTINGENCIA ADD IND_AMBIENTE NUMBER(1,0)'; + exception when column_exists then null; +end; +/ +begin + execute immediate 'COMMENT ON COLUMN LOG_HISTORICO_CONTINGENCIA.IND_AMBIENTE IS ''1-Produo, 2-Homologao'''; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_EMAIL ADD DESTINATARIO VARCHAR2(50)'; + exception when column_exists then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES +(CONSTANTE_seq.nextval,''TEMPO_ENVIO_EMAIL_CONTINGENCIA'',''Tempo de envio de email quando em contingncia'',1,30,1,1,null,1)'; + exception when dup_val_on_index then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20190606_1033__Mantis14242.sql b/src/db/migration/migration/V20190606_1033__Mantis14242.sql new file mode 100644 index 000000000..703097498 --- /dev/null +++ b/src/db/migration/migration/V20190606_1033__Mantis14242.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (ESTACION_ID NUMBER(7))'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20190606_1144__mantis14497.sql b/src/db/migration/migration/V20190606_1144__mantis14497.sql new file mode 100644 index 000000000..2f644bdb8 --- /dev/null +++ b/src/db/migration/migration/V20190606_1144__mantis14497.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'alter table ORGAO_CONCEDENTE ADD COEFICIENTETARIFA NUMBER(14,9)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190625_1559__mantis14533.sql b/src/db/migration/migration/V20190625_1559__mantis14533.sql new file mode 100644 index 000000000..2ef44b74e --- /dev/null +++ b/src/db/migration/migration/V20190625_1559__mantis14533.sql @@ -0,0 +1,29 @@ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (cMunIni VARCHAR2(7))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (cMunFim VARCHAR2(7))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (UFIni VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (UFFim VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (nBP VARCHAR2(9))'; +exception when column_exists then null; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190627_1756__mantis14336.sql b/src/db/migration/migration/V20190627_1756__mantis14336.sql new file mode 100644 index 000000000..1e7d55c80 --- /dev/null +++ b/src/db/migration/migration/V20190627_1756__mantis14336.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE ESTACION ADD DT_MAX_PRINT_LOG_SERVIDOR DATE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190702_0945__mantis14842.sql b/src/db/migration/migration/V20190702_0945__mantis14842.sql new file mode 100644 index 000000000..2e7071164 --- /dev/null +++ b/src/db/migration/migration/V20190702_0945__mantis14842.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > ESQUEMA OPERACIONAL > TROCO SIMPLES'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.TROCOSIMPLES'', + ''1'',to_date(''01/07/19'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190702_1358__mantis14842.sql b/src/db/migration/migration/V20190702_1358__mantis14842.sql new file mode 100644 index 000000000..e5726709c --- /dev/null +++ b/src/db/migration/migration/V20190702_1358__mantis14842.sql @@ -0,0 +1,33 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE EMPRESA_TROCOSIMPLES ( + EMPRESA_TROCOSIMPLES_ID NUMBER(10,0), + EMPRESA_ID NUMBER(7,0), + RAZAO_SOCIAL VARCHAR2(256 BYTE), + NOME_FANTASIA VARCHAR2(256 BYTE), + CNPJ VARCHAR2(18 BYTE), + TELEFONE VARCHAR2(256 BYTE), + ENDERECO VARCHAR2(256 BYTE), + VALOR_SUGERIR_TROCO NUMBER(10,2), + TOKEN_EMPRESA VARCHAR2(256 BYTE), + ACTIVO NUMBER(1,0) DEFAULT 1, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7,0), + PRIMARY KEY (EMPRESA_TROCOSIMPLES_ID) ENABLE, + CONSTRAINT EMPRESA_TRSI_USUARIO_FK FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO(USUARIO_ID) ENABLE, + CONSTRAINT EMPRESA_TRSI_EMPRESA_FK FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA(EMPRESA_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE EMPRESA_TROCOSIMPLES_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20190704_1110__mantis14699.sql b/src/db/migration/migration/V20190704_1110__mantis14699.sql new file mode 100644 index 000000000..fc5f2d7d5 --- /dev/null +++ b/src/db/migration/migration/V20190704_1110__mantis14699.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'alter table ORGAO_CONCEDENTE ADD mensagem_intransferivel VARCHAR2(45)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190704_1113__mantis14659.sql b/src/db/migration/migration/V20190704_1113__mantis14659.sql new file mode 100644 index 000000000..94438f421 --- /dev/null +++ b/src/db/migration/migration/V20190704_1113__mantis14659.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'ALTER TABLE CORRIDA MODIFY (CANTPARADOS NUMBER(7, 0))'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20190704_1845__Mantis14816.sql b/src/db/migration/migration/V20190704_1845__Mantis14816.sql new file mode 100644 index 000000000..375fe5b9a --- /dev/null +++ b/src/db/migration/migration/V20190704_1845__Mantis14816.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CUPON_SECRETARIA ADD (PORCDESCUENTOSEGUROOPCIONAL NUMBER(5,2) DEFAULT 0 NOT NULL)'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20190708_1408__mantis14242.sql b/src/db/migration/migration/V20190708_1408__mantis14242.sql new file mode 100644 index 000000000..e372f0f67 --- /dev/null +++ b/src/db/migration/migration/V20190708_1408__mantis14242.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''VALIDAR_DADOS_BPE'',''VALIDAR_DADOS_BPE'', + 1,''false'',null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190709_1032__mantis14844.sql b/src/db/migration/migration/V20190709_1032__mantis14844.sql new file mode 100644 index 000000000..53f70e51b --- /dev/null +++ b/src/db/migration/migration/V20190709_1032__mantis14844.sql @@ -0,0 +1,48 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES + (CONSTANTE_seq.nextval,''TS00_URL_API_TROCO_SIMPLES'',''TROCO SIMPLES. URL da API.'',1, ''https://partner.api.trocosimples.xyz/'',1,1,null,1)'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES + (CONSTANTE_seq.nextval,''TS01_PATH_CONSULTA_SALDO_EMPRESA'',''TROCO SIMPLES. Consulta saldo da empresa'',1, + ''v1/enterprise/{parametro}/balance'',1,1,null,1)'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES + (CONSTANTE_seq.nextval,''TS02_PATH_PEDIDO_ENTREGA_TROCO'',''TROCO SIMPLES. Cria pedido de entrega de troco'',1, + ''v1/transaction/delivery/{parametro}'',1,1,null,1)'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES + (CONSTANTE_seq.nextval,''TS03_PATH_CONFIRMA_TRANSACAO'',''TROCO SIMPLES. Confirma transacao.'',1, + ''v1/transaction/confirm'',1,1,null,1)'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES + (CONSTANTE_seq.nextval,''TS04_PATH_CANCELA_TRANSACAO'',''TROCO SIMPLES. Cancela transacao.'',1, + ''v1/transaction/cancel'',1,1,null,1)'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190709_1445__mantis14533.sql b/src/db/migration/migration/V20190709_1445__mantis14533.sql new file mode 100644 index 000000000..28af2571e --- /dev/null +++ b/src/db/migration/migration/V20190709_1445__mantis14533.sql @@ -0,0 +1,29 @@ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (dhEmb VARCHAR2(25))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (CST00 VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (CST20 VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (CST45 VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (CST90 VARCHAR2(2))'; +exception when column_exists then null; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190709_1446__mantis14533.sql b/src/db/migration/migration/V20190709_1446__mantis14533.sql new file mode 100644 index 000000000..5d4f3b960 --- /dev/null +++ b/src/db/migration/migration/V20190709_1446__mantis14533.sql @@ -0,0 +1,29 @@ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (CSTOutraUF VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (CSTSN VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vBC00 VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (pICMS00 VARCHAR2(5))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vICMS00 VARCHAR2(15))'; +exception when column_exists then null; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190709_1447__mantis14533.sql b/src/db/migration/migration/V20190709_1447__mantis14533.sql new file mode 100644 index 000000000..aa77d6b4d --- /dev/null +++ b/src/db/migration/migration/V20190709_1447__mantis14533.sql @@ -0,0 +1,29 @@ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vBC20 VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (pICMS20 VARCHAR2(5))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vICMS20 VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vBP VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vDesconto VARCHAR2(15))'; +exception when column_exists then null; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190709_1448__mantis14533.sql b/src/db/migration/migration/V20190709_1448__mantis14533.sql new file mode 100644 index 000000000..8d386a5ff --- /dev/null +++ b/src/db/migration/migration/V20190709_1448__mantis14533.sql @@ -0,0 +1,29 @@ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vPgto VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (tpComp01 VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (tpComp02 VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (tpComp03 VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (tpComp04 VARCHAR2(2))'; +exception when column_exists then null; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190709_1449__mantis14533.sql b/src/db/migration/migration/V20190709_1449__mantis14533.sql new file mode 100644 index 000000000..5d3704ea4 --- /dev/null +++ b/src/db/migration/migration/V20190709_1449__mantis14533.sql @@ -0,0 +1,29 @@ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (tpComp05 VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (tpComp06 VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (tpComp99 VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vComp01 VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vComp02 VARCHAR2(15))'; +exception when column_exists then null; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190709_1450__mantis14533.sql b/src/db/migration/migration/V20190709_1450__mantis14533.sql new file mode 100644 index 000000000..a7c7b1ad3 --- /dev/null +++ b/src/db/migration/migration/V20190709_1450__mantis14533.sql @@ -0,0 +1,29 @@ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vComp03 VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vComp04 VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vComp05 VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vComp06 VARCHAR2(15))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (vComp99 VARCHAR2(15))'; +exception when column_exists then null; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190709_1451__mantis14533.sql b/src/db/migration/migration/V20190709_1451__mantis14533.sql new file mode 100644 index 000000000..3ffab8cf2 --- /dev/null +++ b/src/db/migration/migration/V20190709_1451__mantis14533.sql @@ -0,0 +1,17 @@ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (PREDBC VARCHAR2(5))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (CSTOUTRAUF VARCHAR2(2))'; +exception when column_exists then null; + end; +/ +declare column_exists exception; + pragma exception_init (column_exists , -01430); + begin execute immediate 'ALTER TABLE BPE ADD (CSTSN VARCHAR2(2))'; +exception when column_exists then null; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190712_1405__mantis14844.sql b/src/db/migration/migration/V20190712_1405__mantis14844.sql new file mode 100644 index 000000000..506808b76 --- /dev/null +++ b/src/db/migration/migration/V20190712_1405__mantis14844.sql @@ -0,0 +1,11 @@ +declare +begin + execute immediate 'Insert into TIPO_EVENTO_EXTRA (TIPOEVENTOEXTRA_ID,PARAMARTICULO_ID,INDTIPO,IMPMAX,INDVALIDACORTE,INDVALIDADOCUMENTO,INDCONTRAPARTIDA,INDBOLETO, + INDORDENSERVICIO,PORCIVA,FORMAPAGO_ID,USUARIO_ID,FECMODIF,ACTIVO,PARAMARTICULO2_ID,INDTIPO2,FORMAPAGO2_ID,INDOPERACION,DESCTIPOEVENTO, + PROVEEDOR,IMPFISCALNUMOPERACAO,NATUREZA,CONTACONTABIL,INDCONFERENCIAFISICACOMISSAO,CVETIPOEVENTO,CVESISTEMA) + values (TIPO_EVENTO_EXTRA_SEQ.nextval,null,''1'',''99999.99'',null,''0'',null,''0'',null,''0'',1,''1'',sysdate,''1'',null,null,null,''1'', + ''TROCO SIMPLES'',null,null,''RECEITA'',null,null,null,''TIPO_EVENTO_EXTRA_TROCO_SIMPLES'')'; + exception when others then null; +end; + + diff --git a/src/db/migration/migration/V20190719_1530__mantis14845.sql b/src/db/migration/migration/V20190719_1530__mantis14845.sql new file mode 100644 index 000000000..c8e858362 --- /dev/null +++ b/src/db/migration/migration/V20190719_1530__mantis14845.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.nextVal ,''2'',''ADM > ESQUEMA_OPERACIONAL > RELATORIO_TROCO_SIMPLES'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.RELATORIOTROCOSIMPLES'',''1'',to_date(''18/07/19'',''DD/MM/RR''),null)'; +exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190723_1135__mantis15084.sql b/src/db/migration/migration/V20190723_1135__mantis15084.sql new file mode 100644 index 000000000..7176b2e41 --- /dev/null +++ b/src/db/migration/migration/V20190723_1135__mantis15084.sql @@ -0,0 +1,16 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE INTEGRACAO_TOTVS_SERVICO ( + INTEGRACAOSERVICO_ID NUMBER(15) NOT NULL + , ESQUEMACORRIDA_ID NUMBER(7) NOT NULL + , INTEGRADOTOTVS NUMBER(5) + , FECHOREFETIVA TIMESTAMP + , MSG_RETORNO CLOB + , CONSTRAINT INTEGRACAO_TOTVS_SERVICO_PK PRIMARY KEY ( INTEGRACAOSERVICO_ID ) + )'; + + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190723_1136__mantis15084.sql b/src/db/migration/migration/V20190723_1136__mantis15084.sql new file mode 100644 index 000000000..5373921a1 --- /dev/null +++ b/src/db/migration/migration/V20190723_1136__mantis15084.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE INTEGRACAO_TOTVS_SERVICO_SEQ INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190723_1137__mantis15084.sql b/src/db/migration/migration/V20190723_1137__mantis15084.sql new file mode 100644 index 000000000..1981c6b28 --- /dev/null +++ b/src/db/migration/migration/V20190723_1137__mantis15084.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE INTEGRACAO_TOTVS_SERVICO ADD CONSTRAINT INTEGRACAO_TOTVS_SERVICO_FK1 FOREIGN KEY(ESQUEMACORRIDA_ID )REFERENCES ESQUEMA_CORRIDA(ESQUEMACORRIDA_ID )'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; diff --git a/src/db/migration/migration/V20190723_1138__mantis15084.sql b/src/db/migration/migration/V20190723_1138__mantis15084.sql new file mode 100644 index 000000000..283ed8571 --- /dev/null +++ b/src/db/migration/migration/V20190723_1138__mantis15084.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_REINTEGRACAO_SERVICO_TOTVS'',''CRON_ROTINA_REINTEGRACAO_SERVICO_TOTVS'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190723_1646__mantis15084.sql b/src/db/migration/migration/V20190723_1646__mantis15084.sql new file mode 100644 index 000000000..983ed45ae --- /dev/null +++ b/src/db/migration/migration/V20190723_1646__mantis15084.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (FECHORINTEGRADOTOTVS DATE, CONTADORINTEGRADOTOTVS NUMBER(7,0) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190723_1722__Mantis14878.sql b/src/db/migration/migration/V20190723_1722__Mantis14878.sql new file mode 100644 index 000000000..fc45fb991 --- /dev/null +++ b/src/db/migration/migration/V20190723_1722__Mantis14878.sql @@ -0,0 +1,33 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE "IMAGEM" ("IMAGEM_ID" NUMBER(7,0) NOT NULL ENABLE, "IMAGEM" BLOB, "ACTIVO" NUMBER(1,0), "FECMODIF" DATE, "USUARIO_ID" NUMBER(7,0), "NOMBIMAGEM" VARCHAR2(150 BYTE), CONSTRAINT "IMAGEM_PK" PRIMARY KEY ("IMAGEM_ID"))'; + exception when table_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE IMAGEM_SEQ'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE INDEX IDX_NOMBIMAGEM ON IMAGEM (NOMBIMAGEM ASC)'; + exception when object_exists then null; +end; +/ + +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > CATALOGOS > IMAGEM'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.IMAGEM'',''1'',null,''2'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20190726_1621__mantis15085.sql b/src/db/migration/migration/V20190726_1621__mantis15085.sql new file mode 100644 index 000000000..7b49b0398 --- /dev/null +++ b/src/db/migration/migration/V20190726_1621__mantis15085.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_INTEGRACAO_SERVICO_TOTVS'',''CRON_ROTINA_INTEGRACAO_SERVICO_TOTVS'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190729_1652__mantis14849.sql b/src/db/migration/migration/V20190729_1652__mantis14849.sql new file mode 100644 index 000000000..ec729de09 --- /dev/null +++ b/src/db/migration/migration/V20190729_1652__mantis14849.sql @@ -0,0 +1,16 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE INTEGRACAO_TOTVS_REDUCAO ( + INTEGRACAOREDUCAO_ID NUMBER(15) NOT NULL + , FISCALR2_ID NUMBER(15) NOT NULL + , INTEGRADOTOTVS NUMBER(5) + , FECHOREFETIVA TIMESTAMP + , MSG_RETORNO CLOB + , CONSTRAINT INTEGRACAO_TOTVS_REDUCAO_PK PRIMARY KEY ( INTEGRACAOREDUCAO_ID ) + )'; + + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190729_1653__mantis14849.sql b/src/db/migration/migration/V20190729_1653__mantis14849.sql new file mode 100644 index 000000000..ce7a381f4 --- /dev/null +++ b/src/db/migration/migration/V20190729_1653__mantis14849.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE INTEGRACAO_TOTVS_REDUCAO_SEQ INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190729_1654__mantis14849.sql b/src/db/migration/migration/V20190729_1654__mantis14849.sql new file mode 100644 index 000000000..047acff4f --- /dev/null +++ b/src/db/migration/migration/V20190729_1654__mantis14849.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE INTEGRACAO_TOTVS_REDUCAO ADD CONSTRAINT INTEGRACAO_TOTVS_REDUCAO_FK1 FOREIGN KEY(FISCALR2_ID )REFERENCES FISCAL_R2(FISCALR2_ID )'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; diff --git a/src/db/migration/migration/V20190729_1655__mantis14849.sql b/src/db/migration/migration/V20190729_1655__mantis14849.sql new file mode 100644 index 000000000..f54e3ec5f --- /dev/null +++ b/src/db/migration/migration/V20190729_1655__mantis14849.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_REINTEGRACAO_REDUCAO_TOTVS'',''CRON_ROTINA_REINTEGRACAO_REDUCAO_TOTVS'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190729_1656__mantis14849.sql b/src/db/migration/migration/V20190729_1656__mantis14849.sql new file mode 100644 index 000000000..9c0ee509b --- /dev/null +++ b/src/db/migration/migration/V20190729_1656__mantis14849.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_R2 ADD (FECHORINTEGRADOTOTVS DATE, CONTADORINTEGRADOTOTVS NUMBER(7,0) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190729_1657__mantis14849.sql b/src/db/migration/migration/V20190729_1657__mantis14849.sql new file mode 100644 index 000000000..c73623c5e --- /dev/null +++ b/src/db/migration/migration/V20190729_1657__mantis14849.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_INTEGRACAO_REDUCAO_TOTVS'',''CRON_ROTINA_INTEGRACAO_REDUCAO_TOTVS'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190731_1053__mantis15173.sql b/src/db/migration/migration/V20190731_1053__mantis15173.sql new file mode 100644 index 000000000..64656d17d --- /dev/null +++ b/src/db/migration/migration/V20190731_1053__mantis15173.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDIMPLOGOBILHETEVTAEMBARCADA NUMBER(1) )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190731_1108__mantis15171.sql b/src/db/migration/migration/V20190731_1108__mantis15171.sql new file mode 100644 index 000000000..32431f96d --- /dev/null +++ b/src/db/migration/migration/V20190731_1108__mantis15171.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDIMPRIMERELFECHDETEMBARCADA NUMBER(1) )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; diff --git a/src/db/migration/migration/V20190801_1410__mantis15157.sql b/src/db/migration/migration/V20190801_1410__mantis15157.sql new file mode 100644 index 000000000..e2e491467 --- /dev/null +++ b/src/db/migration/migration/V20190801_1410__mantis15157.sql @@ -0,0 +1,31 @@ +-- CREATE TABLE/CREATE SEQUENCE +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE RUTA_ICMS_EXCEPCION ( + RUTAICMSEXCEPCION_ID NUMBER(7) NOT NULL, + ORIGEN_ID NUMBER(7) NULL, + DESTINO_ID NUMBER(7) NULL, + RUTA_ID NUMBER(7) NULL, + INDTRIBTARIFA NUMBER(1) NULL, + INDTRIBTAXAEMBARQUE NUMBER(1) NULL, + INDTRIBPEDAGIO NUMBER(1) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (RUTAICMSEXCEPCION_ID), + FOREIGN KEY (RUTA_ID) REFERENCES RUTA, + FOREIGN KEY (DESTINO_ID) REFERENCES PARADA, + FOREIGN KEY (ORIGEN_ID) REFERENCES PARADA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE RUTA_ICMS_EXCEPCION_SEQ INCREMENT BY 1 START WITH 1 NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190801_1429__mantis15174.sql b/src/db/migration/migration/V20190801_1429__mantis15174.sql new file mode 100644 index 000000000..8b9529d51 --- /dev/null +++ b/src/db/migration/migration/V20190801_1429__mantis15174.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD (INDVALDOCOBLIGATORIOEMBARCADA NUMBER(1) )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; diff --git a/src/db/migration/migration/V20190808_1612__mantis15274.sql b/src/db/migration/migration/V20190808_1612__mantis15274.sql new file mode 100644 index 000000000..af2efcf63 --- /dev/null +++ b/src/db/migration/migration/V20190808_1612__mantis15274.sql @@ -0,0 +1,13 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'update empresa set INDIMPLOGOBILHETEVTAEMBARCADA = INDIMPRIMELOGOBILHETEVENDAEMBARCADA, INDIMPRIMERELFECHDETEMBARCADA = INDIMPRIMERELFECHAMENTODETALHADOEMBARCADA'; + exception + when dup_val_on_index then null; + when except_02291 then null; + when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190808_1614__mantis15274.sql b/src/db/migration/migration/V20190808_1614__mantis15274.sql new file mode 100644 index 000000000..019ed14ca --- /dev/null +++ b/src/db/migration/migration/V20190808_1614__mantis15274.sql @@ -0,0 +1,31 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDIMPLOGOBILHETEVTAEMBARCADA NUMBER(1) )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDIMPRIMERELFECHDETEMBARCADA NUMBER(1) )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; diff --git a/src/db/migration/migration/V20190820_1444__mantis15267.sql b/src/db/migration/migration/V20190820_1444__mantis15267.sql new file mode 100644 index 000000000..c68ce6115 --- /dev/null +++ b/src/db/migration/migration/V20190820_1444__mantis15267.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE_CTRL_DISPONIBILIDADE ADD (TIPO_VENDA VARCHAR(20))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190820_1445__mantis15267.sql b/src/db/migration/migration/V20190820_1445__mantis15267.sql new file mode 100644 index 000000000..48beeec48 --- /dev/null +++ b/src/db/migration/migration/V20190820_1445__mantis15267.sql @@ -0,0 +1,39 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'merge into bpe_ctrl_disponibilidade cd1 + using + ( + select b.tipoventa_id, cd.bpectrldisp_id, cd.tipo_venda + from bpe_ctrl_disponibilidade cd + join bpe bpe on bpe.bpe_id = cd.bpe_rejeitado_id + left join boleto b on b.boleto_id = bpe.boleto_id + where cd.activo = 1 + and b.tipoventa_id = 99 + and cd.tipo_venda is null + ) t on (cd1.bpectrldisp_id = t.bpectrldisp_id) + WHEN MATCHED THEN UPDATE SET cd1.tipo_venda = ''EMBARCADA'' + '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'merge into bpe_ctrl_disponibilidade cd1 + using + ( + select b.tipoventa_id, cd.bpectrldisp_id, cd.tipo_venda + from bpe_ctrl_disponibilidade cd + join bpe bpe on bpe.bpe_id = cd.bpe_rejeitado_id + left join boleto b on b.boleto_id = bpe.boleto_id + where cd.activo = 1 + and b.tipoventa_id <> 99 + and cd.tipo_venda is null + ) t on (cd1.bpectrldisp_id = t.bpectrldisp_id) + WHEN MATCHED THEN UPDATE SET cd1.tipo_venda = ''TOTALBUS'' + '; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190821_1155__mantis15347.sql b/src/db/migration/migration/V20190821_1155__mantis15347.sql new file mode 100644 index 000000000..2bd7acd7d --- /dev/null +++ b/src/db/migration/migration/V20190821_1155__mantis15347.sql @@ -0,0 +1,39 @@ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update FUNCION_SISTEMA set NOMBFUNCION=''ADM > RELATORIOS >> INTEGRACAO >>> BPE'' where NOMBFUNCION=''ADM > RELATORIOS >> BPE'' and DESCRUTA=''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE'''; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update FUNCION_SISTEMA set NOMBFUNCION=''ADM > RELATORIOS >> INTEGRACAO >>> BPE >>>> EXPORTACAO'' where NOMBFUNCION=''ADM > RELATORIOS >> BPE >>> EXPORTACAO'' and DESCRUTA=''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.EXPORTACAO'''; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update FUNCION_SISTEMA set NOMBFUNCION=''ADM > RELATORIOS >> INTEGRACAO >>> BPE >>>> RDI'' where NOMBFUNCION=''ADM > RELATORIOS >> BPE >>> RDI'' and DESCRUTA=''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.RDI'''; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update FUNCION_SISTEMA set NOMBFUNCION=''ADM > RELATORIOS >> INTEGRACAO >>> BPE >>>> FINANCIERO'' where NOMBFUNCION=''ADM > RELATORIOS >> BPE >>> FINANCIERO'' and DESCRUTA=''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.FINANCIERO'''; + exception when ja_existe then null; +end; +/ +declare + ja_existe exception; + pragma exception_init (ja_existe , -00001); +begin + execute immediate 'update FUNCION_SISTEMA set NOMBFUNCION=''ADM > RELATORIOS >> INTEGRACAO >>> BPE >>>> DEVOLUCION'' where NOMBFUNCION=''ADM > RELATORIOS >> BPE >>> DEVOLUCION'' and DESCRUTA=''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.DEVOLUCION'''; + exception when ja_existe then null; +end; diff --git a/src/db/migration/migration/V20190824_1110__mantis15431.sql b/src/db/migration/migration/V20190824_1110__mantis15431.sql new file mode 100644 index 000000000..b8ea8c2a6 --- /dev/null +++ b/src/db/migration/migration/V20190824_1110__mantis15431.sql @@ -0,0 +1,40 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE COBRANCA_ADC_SEQ INCREMENT BY 1 START WITH 1 NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE COBRANCA_ADC_PUNTO_VENTA ( + COBRANCAADDPUNTOVENTA_ID NUMBER(7) NOT NULL, + PUNTOVENTA_ID NUMBER(7) NOT NULL, + DESCRICAO VARCHAR2(30 BYTE) NOT NULL, + VALOR NUMBER(7,2) NOT NULL, + EMPRESA_ID NUMBER(7,0) NOT NULL, + DATAINICIAL DATE NOT NULL, + DATAFINAL DATE NOT NULL, + DIARIO NUMBER(1), + SEMANAL NUMBER(1), + MENSAL NUMBER(1), + SEGUNDA NUMBER(1), + TERCA NUMBER(1), + QUARTA NUMBER(1), + QUINTA NUMBER(1), + SEXTA NUMBER(1), + PRIMEIRO_DIA_UTIL NUMBER(1), + ULTIMO_DIA_UTIL NUMBER(1), + DESCONTO_PROXIMO_CICLO NUMBER(1), + DESCONTO_PROXIMO_DIA NUMBER(1), + ACTIVO NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (COBRANCAADDPUNTOVENTA_ID), + FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA + )'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20190826_1430__mantis15134.sql b/src/db/migration/migration/V20190826_1430__mantis15134.sql new file mode 100644 index 000000000..9d7e94cca --- /dev/null +++ b/src/db/migration/migration/V20190826_1430__mantis15134.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.nextVal, 1, ''ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICOS > MOVIMENTACOES DE BILHETES'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOMOVIMENTACAOBILHETE'', 1, SYSDATE, 1)'; +exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190830_1715__mantis15099.sql b/src/db/migration/migration/V20190830_1715__mantis15099.sql new file mode 100644 index 000000000..0d96edfbc --- /dev/null +++ b/src/db/migration/migration/V20190830_1715__mantis15099.sql @@ -0,0 +1,16 @@ +-- ALTER TABLE ADD COLUMN +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE TAXPOL_EXCECAO ADD (INDBLOQUEIAIMPRTXEMBARQUE NUMBER(1) )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190830_1850__mantis15235.sql b/src/db/migration/migration/V20190830_1850__mantis15235.sql new file mode 100644 index 000000000..146a5f85f --- /dev/null +++ b/src/db/migration/migration/V20190830_1850__mantis15235.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDCODBARCPEMBARQUE NUMBER(1) default 1 )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190902_1445__mantis15199.sql b/src/db/migration/migration/V20190902_1445__mantis15199.sql new file mode 100644 index 000000000..267997224 --- /dev/null +++ b/src/db/migration/migration/V20190902_1445__mantis15199.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.nextVal, 1, ''ADM > RELATORIOS > RELATORIOS > RELATORIOS ESTATISTICOS > ENCERRAMENTO DO CHECKIN'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOENCERRAMENTOCHECKIN'', 1, SYSDATE, 1)'; +exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190903_1711__mantis15703.sql b/src/db/migration/migration/V20190903_1711__mantis15703.sql new file mode 100644 index 000000000..37d8689d0 --- /dev/null +++ b/src/db/migration/migration/V20190903_1711__mantis15703.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''BPE_SERIE_RECARGA_BANCO'', ''BPE_SERIE_RECARGA_BANCO'', ''10'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190904_1140__mantis15465.sql b/src/db/migration/migration/V20190904_1140__mantis15465.sql new file mode 100644 index 000000000..c0100adb4 --- /dev/null +++ b/src/db/migration/migration/V20190904_1140__mantis15465.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (INDPCD NUMBER(1), INFOPCD VARCHAR(50))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190905_1027__mantis15119.sql b/src/db/migration/migration/V20190905_1027__mantis15119.sql new file mode 100644 index 000000000..563a8d1aa --- /dev/null +++ b/src/db/migration/migration/V20190905_1027__mantis15119.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,''2'',''ADM > CONFIGURAO COMERCIAL > CONFIGURAR CUSTOM TOTEM'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFCOMERCIALES.MENU.CONFTOTEM'',''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190905_1654__mantis15119.sql b/src/db/migration/migration/V20190905_1654__mantis15119.sql new file mode 100644 index 000000000..b9cd6ea5a --- /dev/null +++ b/src/db/migration/migration/V20190905_1654__mantis15119.sql @@ -0,0 +1,26 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE CONF_TOTEM ( + CONFTOTEM_ID NUMBER(7) NOT NULL, + CHAVE VARCHAR2(100) NULL, + VALOR VARCHAR2(100) NULL, + ACTIVO NUMBER(1), + SISTEMA NUMBER(1), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY ( CONFTOTEM_ID ) + )'; + + exception when table_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "CONF_TOTEM_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190907_1438__mantis14989.sql b/src/db/migration/migration/V20190907_1438__mantis14989.sql new file mode 100644 index 000000000..ab8511636 --- /dev/null +++ b/src/db/migration/migration/V20190907_1438__mantis14989.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING_OCUPA_ANTECIPA ADD COR VARCHAR(7)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190909_2118__mantis15432.sql b/src/db/migration/migration/V20190909_2118__mantis15432.sql new file mode 100644 index 000000000..58fad8784 --- /dev/null +++ b/src/db/migration/migration/V20190909_2118__mantis15432.sql @@ -0,0 +1,30 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE COBRANCA_ADC_HIST_SEQ INCREMENT BY 1 START WITH 1 NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE COBRANCA_ADICIONAL_HISTORICO ( + COBRANCAADICIONALHISTORICO_ID NUMBER(15,0) NOT NULL, + COBRANCAADDPUNTOVENTA_ID NUMBER(7) NOT NULL, + CONTACORRENTEPTOVTA_ID NUMBER(15,0), + PUNTOVENTA_ID NUMBER(7) NOT NULL, + VALOR_COBRANCA NUMBER(7,2) NOT NULL, + VALOR_ACUMULADO NUMBER(7,2) NOT NULL, + VALOR_APLICADO NUMBER(7,2) NOT NULL, + COBRANCA_EFETUADA NUMBER(1) NOT NULL, + FREQUENCIA_NA_DATA VARCHAR2(30 BYTE), + DATA_REGISTRO DATE NOT NULL, + MOTIVO VARCHAR2(350 BYTE), + USUARIO_ID NUMBER(7), + PRIMARY KEY (COBRANCAADICIONALHISTORICO_ID), + FOREIGN KEY (COBRANCAADDPUNTOVENTA_ID) REFERENCES COBRANCA_ADC_PUNTO_VENTA + )'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20190912_1616__mantis15650.sql b/src/db/migration/migration/V20190912_1616__mantis15650.sql new file mode 100644 index 000000000..470435dc5 --- /dev/null +++ b/src/db/migration/migration/V20190912_1616__mantis15650.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDEMITECOMPCANCELSITEF NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190915_1851__mantis15644.sql b/src/db/migration/migration/V20190915_1851__mantis15644.sql new file mode 100644 index 000000000..fe34eb110 --- /dev/null +++ b/src/db/migration/migration/V20190915_1851__mantis15644.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA_COMBINACION ADD (INDUSAPRICING NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190917_1531__mantis15749.sql b/src/db/migration/migration/V20190917_1531__mantis15749.sql new file mode 100644 index 000000000..fab4d864b --- /dev/null +++ b/src/db/migration/migration/V20190917_1531__mantis15749.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD (INDNAOIMPPOLCONSUMIDOR NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190918_1020__mantis15727.sql b/src/db/migration/migration/V20190918_1020__mantis15727.sql new file mode 100644 index 000000000..2dd81d20e --- /dev/null +++ b/src/db/migration/migration/V20190918_1020__mantis15727.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDIMPRIMIRCOMPPAGSEGOPCIONAL NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190919_1430__mantis15431.sql b/src/db/migration/migration/V20190919_1430__mantis15431.sql new file mode 100644 index 000000000..7c65e58bb --- /dev/null +++ b/src/db/migration/migration/V20190919_1430__mantis15431.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextVal, 1, ''ADM > CATALOGO > PUNTO VENTA > COBRANCA ADICIONAL'', + ''COM.RJCONSULTORES.ADMINISTRACION.PUNTOVENTA.COBRANCAADICIONAL'', 1, SYSDATE, 1)'; +exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190923_1105__mantis14990.sql b/src/db/migration/migration/V20190923_1105__mantis14990.sql new file mode 100644 index 000000000..d3cf89e7f --- /dev/null +++ b/src/db/migration/migration/V20190923_1105__mantis14990.sql @@ -0,0 +1,10 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (INDESTADIAMINIMA NUMBER(1), CANTDIAS_ESTADIAMINIMA NUMBER(3), + INDLUN_ESTADIAMINIMA NUMBER(1), INDMAR_ESTADIAMINIMA NUMBER(1), INDMIE_ESTADIAMINIMA NUMBER(1), + INDJUE_ESTADIAMINIMA NUMBER(1), INDVIE_ESTADIAMINIMA NUMBER(1), INDSAB_ESTADIAMINIMA NUMBER(1), + INDDOM_ESTADIAMINIMA NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190923_1117__mantis15219.sql b/src/db/migration/migration/V20190923_1117__mantis15219.sql new file mode 100644 index 000000000..d49d39e9f --- /dev/null +++ b/src/db/migration/migration/V20190923_1117__mantis15219.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (PORCFECP NUMBER(7,2))'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190923_1145__mantis16000.sql b/src/db/migration/migration/V20190923_1145__mantis16000.sql new file mode 100644 index 000000000..c820c0121 --- /dev/null +++ b/src/db/migration/migration/V20190923_1145__mantis16000.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDENCERRAVIAGEMFECHORLLEGADA NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190926_1215__mantis15910.sql b/src/db/migration/migration/V20190926_1215__mantis15910.sql new file mode 100644 index 000000000..209f46253 --- /dev/null +++ b/src/db/migration/migration/V20190926_1215__mantis15910.sql @@ -0,0 +1,13 @@ +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE CLIENTE_DESCUENTO RENAME COLUMN INDFORMAVALIDACIONESTUDIATNTE TO INDFORMAVALIDACIONESTUDIANTE'; + + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190927_1706__mantis15631.sql b/src/db/migration/migration/V20190927_1706__mantis15631.sql new file mode 100644 index 000000000..5edb42fbc --- /dev/null +++ b/src/db/migration/migration/V20190927_1706__mantis15631.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDIMPSEGOPCIONALENTVDAPOSTERI NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20190927_1739__mantis16129.sql b/src/db/migration/migration/V20190927_1739__mantis16129.sql new file mode 100644 index 000000000..4bfc5b4d5 --- /dev/null +++ b/src/db/migration/migration/V20190927_1739__mantis16129.sql @@ -0,0 +1 @@ +UPDATE TIPO_EVENTO_EXTRA SET desctipoevento = 'TAXA CONVENIENCIA' WHERE cvesistema = 'TAXA_CONVENIENCIA_TARIFA'; \ No newline at end of file diff --git a/src/db/migration/migration/V20190930_1205__mantis15906.sql b/src/db/migration/migration/V20190930_1205__mantis15906.sql new file mode 100644 index 000000000..17735dd33 --- /dev/null +++ b/src/db/migration/migration/V20190930_1205__mantis15906.sql @@ -0,0 +1,12 @@ +declare +begin + execute immediate 'update cliente_direccion cd set activo=1 where activo is null and exists (select 1 from cliente c where c.cliente_id = cd.cliente_id and c.activo=1)'; + exception when others then null; +end; +/ + +declare +begin + execute immediate 'update cliente_direccion cd set activo=0 where activo is null and exists (select 1 from cliente c where c.cliente_id = cd.cliente_id and c.activo=0)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191001_1444__mantis15643.sql b/src/db/migration/migration/V20191001_1444__mantis15643.sql new file mode 100644 index 000000000..fa4a13e58 --- /dev/null +++ b/src/db/migration/migration/V20191001_1444__mantis15643.sql @@ -0,0 +1,52 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CONF_RESTRICAO_TRAMO ( + CONFRESTRICAOTRAMO_ID NUMBER(15,0) NOT NULL, + CONFRESTRICAOCANALVENTA_ID NUMBER(15,0), + TIPOPTOVTA_ID NUMBER(2), + ORIGEN_ID NUMBER(7), + DESTINO_ID NUMBER(7), + TEMPOPERMITIR DATE, + SEGUNDA NUMBER(1,0), + TERCA NUMBER(1,0), + QUARTA NUMBER(1,0), + QUINTA NUMBER(1,0), + SEXTA NUMBER(1,0), + SABADO NUMBER(1,0), + DOMINGO NUMBER(1,0), + USUARIO_ID NUMBER(7), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + PRIMARY KEY (CONFRESTRICAOTRAMO_ID), + FOREIGN KEY (CONFRESTRICAOCANALVENTA_ID) REFERENCES CONF_RESTRICAO_CANALVENTA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE "CONF_RESTRICAO_TRAMO_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE conf_restricao_ptovta ADD CONFRESTRICAOTRAMO_ID NUMBER(15,0) constraint CONFRESTRICAOPTOVTA_TRAMO_FK references CONF_RESTRICAO_TRAMO(CONFRESTRICAOTRAMO_ID) '; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE conf_restricao_excecao ADD CONFRESTRICAOTRAMO_ID NUMBER(15,0) constraint CONFRESTRICAOEXCECAO_TRAMO_FK references CONF_RESTRICAO_TRAMO(CONFRESTRICAOTRAMO_ID) '; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20191002_1010__mantis16198.sql b/src/db/migration/migration/V20191002_1010__mantis16198.sql new file mode 100644 index 000000000..162fa5a89 --- /dev/null +++ b/src/db/migration/migration/V20191002_1010__mantis16198.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'UPDATE EMPRESA_IMPOSTO SET INDREDBASEICMSBPE=0 WHERE INDREDBASEICMSBPE IS NULL'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191002_1030__mantis15657.sql b/src/db/migration/migration/V20191002_1030__mantis15657.sql new file mode 100644 index 000000000..814f85e16 --- /dev/null +++ b/src/db/migration/migration/V20191002_1030__mantis15657.sql @@ -0,0 +1,13 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextVal, 1, ''ADM > RELATORIOS > INTEGRACAO > CASH MONITOR'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.INTEGRACION.CASHMONITOR'', 1, SYSDATE, 1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextVal, 1, ''ADM > RELATORIOS > INTEGRACAO > CASH MONITOR > VENDA DE CARTAO'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.INTEGRACION.CASHMONITOR.RELATORIOVENDACARTAOCASHMONITOR'', 1, SYSDATE, 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191002_1503__mantis15643.sql b/src/db/migration/migration/V20191002_1503__mantis15643.sql new file mode 100644 index 000000000..c235e8736 --- /dev/null +++ b/src/db/migration/migration/V20191002_1503__mantis15643.sql @@ -0,0 +1,77 @@ +DECLARE + sequencia NUMBER(15, 0); +BEGIN + FOR r IN ( + SELECT + confrestricaocanalventa_id, + tipoptovta_id, + origen_id, + destino_id, + tempopermitir, + segunda, + terca, + quarta, + quinta, + sexta, + sabado, + domingo, + usuario_id, + activo, + fecmodif + FROM + conf_restricao_canalventa + WHERE + fecfinvigencia >= SYSDATE + AND activo = 1 + ) LOOP + sequencia := conf_restricao_tramo_seq.nextval; + INSERT INTO conf_restricao_tramo ( + confrestricaotramo_id, + confrestricaocanalventa_id, + tipoptovta_id, + origen_id, + destino_id, + tempopermitir, + segunda, + terca, + quarta, + quinta, + sexta, + sabado, + domingo, + usuario_id, + activo, + fecmodif + ) VALUES ( + sequencia, + r.confrestricaocanalventa_id, + r.tipoptovta_id, + r.origen_id, + r.destino_id, + r.tempopermitir, + r.segunda, + r.terca, + r.quarta, + r.quinta, + r.sexta, + r.sabado, + r.domingo, + r.usuario_id, + r.activo, + r.fecmodif + ); + + UPDATE conf_restricao_excecao cre + SET + cre.confrestricaotramo_id = sequencia + WHERE + cre.confrestricaocanalventa_id = r.confrestricaocanalventa_id; + + UPDATE conf_restricao_ptovta crp + SET + crp.confrestricaotramo_id = sequencia + WHERE + crp.confrestricaocanalventa_id = r.confrestricaocanalventa_id; + + END LOOP; +END; \ No newline at end of file diff --git a/src/db/migration/migration/V20191003_1015__mantis16201.sql b/src/db/migration/migration/V20191003_1015__mantis16201.sql new file mode 100644 index 000000000..0cc3d2063 --- /dev/null +++ b/src/db/migration/migration/V20191003_1015__mantis16201.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE PAIS ADD (CODIGOBACENPAIS VARCHAR2(18 BYTE))'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191007_1730__mantis16087.sql b/src/db/migration/migration/V20191007_1730__mantis16087.sql new file mode 100644 index 000000000..5db5ad185 --- /dev/null +++ b/src/db/migration/migration/V20191007_1730__mantis16087.sql @@ -0,0 +1,87 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.nextVal, 1, ''ADM > ADM. DE PRECO > ALTERACAO DE PRECO - EMBARCADA'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.TARIFAEMBARCADA'', 1, SYSDATE, 1)'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE TARIFA_EMBARCADA_SEQ INCREMENT BY 1 START WITH 1 NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE TARIFA_EMBARCADA_HIST_SEQ INCREMENT BY 1 START WITH 1 NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE TARIFA_EMBARCADA ( + TARIFAEMBARCADA_ID NUMBER(15,0) NOT NULL, + PRECIO NUMBER(10,2), + PRECIOREDABIERTO NUMBER(7,2), + TRAMO_ID NUMBER(7,0), + MARCA_ID NUMBER(3,0), + CLASESERVICIO_ID NUMBER(2,0), + PRECIOORIGINAL NUMBER(10,2), + MONEDA_ID NUMBER(7,0), + VIGENCIATARIFA_ID NUMBER(7,0), + STATUSTARIFA VARCHAR2(3 BYTE), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + IMPORTETAXAEMBARQUE NUMBER(7,2), + IMPORTEPEDAGIO NUMBER(7,2), + IMPORTEOUTROS NUMBER(7,2), + IMPORTESEGURO NUMBER(7,2), + ORGAOCONCEDENTE_ID NUMBER(7,2), + RUTA_ID NUMBER(7,0), + ORIGEN_ID NUMBER(7,0), + DESTINO_ID NUMBER(7,0), + INTEGRADOTOTVS NUMBER(1,0) DEFAULT 1, + IMPORTETPP NUMBER(7,2), + PRIMARY KEY (TARIFAEMBARCADA_ID), + FOREIGN KEY (TRAMO_ID) REFERENCES TRAMO, + FOREIGN KEY (MARCA_ID) REFERENCES MARCA, + FOREIGN KEY (CLASESERVICIO_ID) REFERENCES CLASE_SERVICIO, + FOREIGN KEY (MONEDA_ID) REFERENCES MONEDA, + FOREIGN KEY (VIGENCIATARIFA_ID) REFERENCES VIGENCIA_TARIFA, + FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE, + FOREIGN KEY (RUTA_ID) REFERENCES RUTA, + FOREIGN KEY (ORIGEN_ID) REFERENCES PARADA, + FOREIGN KEY (DESTINO_ID) REFERENCES PARADA)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE TARIFA_EMBARCADA_HIST ( + TARIFAEMBARCADAHIST_ID NUMBER(15,0) NOT NULL, + PRECIO NUMBER(10,2), + PRECIOREDABIERTO NUMBER(7,2), + PRECIOORIGINAL NUMBER(10,2), + STATUSTARIFA VARCHAR2(1 BYTE), + MONEDA_ID NUMBER(7,0), + CLASESERVICIO_ID NUMBER(2,0), + MARCA_ID NUMBER(3,0), + VIGENCIATARIFA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + PRIMARY KEY (TARIFAEMBARCADAHIST_ID), + FOREIGN KEY (MONEDA_ID) REFERENCES MONEDA, + FOREIGN KEY (CLASESERVICIO_ID) REFERENCES CLASE_SERVICIO, + FOREIGN KEY (MARCA_ID) REFERENCES MARCA, + FOREIGN KEY (VIGENCIATARIFA_ID) REFERENCES VIGENCIA_TARIFA)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191007_2125__mantis15545.sql b/src/db/migration/migration/V20191007_2125__mantis15545.sql new file mode 100644 index 000000000..cc44226d0 --- /dev/null +++ b/src/db/migration/migration/V20191007_2125__mantis15545.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDCUOTANUNCALIBERAR NUMBER(1,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191011_0925__mantis15886.sql b/src/db/migration/migration/V20191011_0925__mantis15886.sql new file mode 100644 index 000000000..0bc726d83 --- /dev/null +++ b/src/db/migration/migration/V20191011_0925__mantis15886.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD INDNAOPERMITEVENDADUASGRAT NUMBER(1,0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191011_1500__mantis16383.sql b/src/db/migration/migration/V20191011_1500__mantis16383.sql new file mode 100644 index 000000000..166311f47 --- /dev/null +++ b/src/db/migration/migration/V20191011_1500__mantis16383.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD (IMEI VARCHAR(20))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191014_1500__mantis14991.sql b/src/db/migration/migration/V20191014_1500__mantis14991.sql new file mode 100644 index 000000000..c2c3cf265 --- /dev/null +++ b/src/db/migration/migration/V20191014_1500__mantis14991.sql @@ -0,0 +1,150 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_GESTAO_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE BOLETO_GP_PRICING_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (INDSOBREPOSICAO NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING_ESPECIFICO ADD (INDSOBREPOSICAO NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (COLOR VARCHAR2(7 BYTE) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING_ESPECIFICO ADD (COLOR VARCHAR2(7 BYTE) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (INDGESTAO NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (INDAGRUPADODIA NUMBER(1) DEFAULT 0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (INDAGRUPADOSERVICO NUMBER(1) DEFAULT 0 )'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE GP_PRICING_GESTAO +( + PRICINGGESTAO_ID NUMBER(7) NOT NULL +, PRICING_ID NUMBER(7) +, CORRIDA_ID NUMBER(7) +, FECCORRIDA DATE +, ACTIVO NUMBER(1) +, FECMODIF DATE +, USUARIO_ID NUMBER(7) +, CONSTRAINT GP_PRICING_GESTAO_PK PRIMARY KEY + ( + PRICINGGESTAO_ID + ) + ENABLE +)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE BOLETO_GP_PRICING +( + BOLETOPRICING_ID NUMBER(15, 0) NOT NULL +, BOLETO_ID NUMBER(15, 0) +, PRICING_ID NUMBER(7, 0) +, PRICINGESPECIFICO_ID NUMBER(15, 0) +, INDREPLICA NUMBER(1, 0) +, ACTIVO NUMBER(1, 0) +, FECMODIF DATE +, USUARIO_ID NUMBER(7, 0) +, NODO_ID NUMBER(2, 0) +, PRICINGCLASSETARIFARIA_ID NUMBER(7, 0) +) '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE GP_PRICING_ESPEC_OCUPACION +( + PRICINGESPECIFICOOCUPACION_ID NUMBER(7, 0) NOT NULL +, PRICINGESPECIFICO_ID NUMBER(7, 0) +, OCUPACIONINICIAL NUMBER(5, 2) +, OCUPACIONFINAL NUMBER(5, 2) +, TARIFA NUMBER(7, 2) +, ACTIVO NUMBER(1, 0) +, FECMODIF DATE +, USUARIO_ID NUMBER(7, 0) +, DESCUENTO NUMBER(5, 2) +) '; + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE GP_PRICING_ESPEC_OCUPACION +ADD CONSTRAINT GP_PRICING_ESPEC_OCUPACION FOREIGN KEY +( + PRICINGESPECIFICO_ID +) +REFERENCES GP_PRICING_ESPECIFICO +( + PRICINGESPECIFICO_ID +) +ENABLE'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20191014_1648__mantis16516.sql b/src/db/migration/migration/V20191014_1648__mantis16516.sql new file mode 100644 index 000000000..2f199e5d7 --- /dev/null +++ b/src/db/migration/migration/V20191014_1648__mantis16516.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDTABELAPRECOEMBARCADA NUMBER(1))'; + + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191016_1015__mantis16540.sql b/src/db/migration/migration/V20191016_1015__mantis16540.sql new file mode 100644 index 000000000..5e97e0647 --- /dev/null +++ b/src/db/migration/migration/V20191016_1015__mantis16540.sql @@ -0,0 +1,13 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,2,''VENDA EMBARCADA > MENU EMBARCADA > VENDA MANUAL EMBARCADA'', ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUVENTAMANUALEMBARCADA'',1,SYSDATE,-1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,2,''VENDA EMBARCADA > MENU EMBARCADA'', ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.MENUEMBARCADA'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191017_1741__mantis15545.sql b/src/db/migration/migration/V20191017_1741__mantis15545.sql new file mode 100644 index 000000000..778bcec30 --- /dev/null +++ b/src/db/migration/migration/V20191017_1741__mantis15545.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (INDCUOTANUNCALIBERAR DEFAULT 0)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191018_1718__mantis16161.sql b/src/db/migration/migration/V20191018_1718__mantis16161.sql new file mode 100644 index 000000000..0ba0d6556 --- /dev/null +++ b/src/db/migration/migration/V20191018_1718__mantis16161.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_EVENTO_EXTRA (TIPOEVENTOEXTRA_ID, PARAMARTICULO_ID, INDTIPO, IMPMAX, INDVALIDACORTE, INDVALIDADOCUMENTO, INDCONTRAPARTIDA, INDBOLETO, INDORDENSERVICIO, PORCIVA, FORMAPAGO_ID, USUARIO_ID, ACTIVO, PARAMARTICULO2_ID, INDTIPO2, FORMAPAGO2_ID, INDOPERACION, DESCTIPOEVENTO, PROVEEDOR, IMPFISCALNUMOPERACAO, NATUREZA, CONTACONTABIL, INDCONFERENCIAFISICACOMISSAO, CVETIPOEVENTO, CVESISTEMA, INDVALIDAESTOQUE) + VALUES (99999, null, ''1'', 99999, null, 0, null, 0, null, 0, null, 6486, 0, null, null, null, 1, ''DIFERENCA DE TROCA OCD'', null, null, null, ''0'', null, null, null, 0)'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191023_1052__mantis15999.sql b/src/db/migration/migration/V20191023_1052__mantis15999.sql new file mode 100644 index 000000000..d2290862c --- /dev/null +++ b/src/db/migration/migration/V20191023_1052__mantis15999.sql @@ -0,0 +1,42 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'ALTER TABLE BOLETO ADD PAIS_RESIDENCIA VARCHAR2(20)'; + exception when object_exists then null; +end; + +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -01430 ); +begin + execute immediate 'ALTER TABLE CAJA ADD PAIS_RESIDENCIA VARCHAR2(20)'; + exception when object_exists then null; +end; + +/ + +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO tipo_identificacion VALUES (26, ''DNI'', 1, CURRENT_DATE, 1)'; + exception when dup_val_on_index then null; +end; + +/ + +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_OCUPACION (TIPOOCUPACION_ID, DESCTIPO, ACTIVO, USUARIO_ID, FECMODIF) VALUES (TIPO_OCUPACION_SEQ.nextval, ''PROFISSIONAL'', ''1'', ''1'', CURRENT_DATE)'; + exception when dup_val_on_index then null; +end; + + + + + diff --git a/src/db/migration/migration/V20191023_1704__mantis16623.sql b/src/db/migration/migration/V20191023_1704__mantis16623.sql new file mode 100644 index 000000000..35aab4a5f --- /dev/null +++ b/src/db/migration/migration/V20191023_1704__mantis16623.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_INTEGRACAO_CORRIDA_TOTVS'',''CRON_ROTINA_INTEGRACAO_CORRIDA_TOTVS'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191023_1705__mantis16623.sql b/src/db/migration/migration/V20191023_1705__mantis16623.sql new file mode 100644 index 000000000..c4a4edb88 --- /dev/null +++ b/src/db/migration/migration/V20191023_1705__mantis16623.sql @@ -0,0 +1,17 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE INTEGRACAO_TOTVS_CORRIDA ( + INTEGRACAOCORRIDA_ID NUMBER(15) NOT NULL + , CORRIDA_ID NUMBER(7) NOT NULL + , FECCORRIDA DATE NOT NULL + , INTEGRADOTOTVS NUMBER(5) + , FECHOREFETIVA TIMESTAMP + , MSG_RETORNO CLOB + , CONSTRAINT INTEGRACAO_TOTVS_CORRIDA_PK PRIMARY KEY ( INTEGRACAOCORRIDA_ID ) + )'; + + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191023_1706__mantis16623.sql b/src/db/migration/migration/V20191023_1706__mantis16623.sql new file mode 100644 index 000000000..a6ce00283 --- /dev/null +++ b/src/db/migration/migration/V20191023_1706__mantis16623.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE INTEGRACAO_TOTVS_CORRIDA ADD CONSTRAINT INTEGRACAO_TOTVS_CORRIDA_FK1 FOREIGN KEY(CORRIDA_ID, FECCORRIDA )REFERENCES CORRIDA(CORRIDA_ID, FECCORRIDA )'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; diff --git a/src/db/migration/migration/V20191023_1707__mantis16623.sql b/src/db/migration/migration/V20191023_1707__mantis16623.sql new file mode 100644 index 000000000..c94705367 --- /dev/null +++ b/src/db/migration/migration/V20191023_1707__mantis16623.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE INTEGRACAO_TOTVS_CORRIDA_SEQ INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191024_1018__mantis16623.sql b/src/db/migration/migration/V20191024_1018__mantis16623.sql new file mode 100644 index 000000000..eee96b203 --- /dev/null +++ b/src/db/migration/migration/V20191024_1018__mantis16623.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CORRIDA ADD (FECHORINTEGRADOTOTVS DATE, CONTADORINTEGRADOTOTVS NUMBER(7,0) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191025_1003__mantis16767.sql b/src/db/migration/migration/V20191025_1003__mantis16767.sql new file mode 100644 index 000000000..0707b377c --- /dev/null +++ b/src/db/migration/migration/V20191025_1003__mantis16767.sql @@ -0,0 +1,59 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + except_01440 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); + pragma exception_init (except_01440 , -01440); +begin + execute immediate 'ALTER TABLE BPE MODIFY BPE_ID NUMBER(22,0)'; + + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; + when except_01440 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + except_01440 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); + pragma exception_init (except_01440 , -01440); +begin + execute immediate 'ALTER TABLE BPE MODIFY BPEEVENTO_ID NUMBER(22,0)'; + + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; + when except_01440 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + except_01440 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); + pragma exception_init (except_01440 , -01440); +begin + execute immediate 'ALTER TABLE BPE MODIFY BPESUBSTITUICAO_ID NUMBER(22,0)'; + + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; + when except_01440 then null; +end; diff --git a/src/db/migration/migration/V20191028_1712__mantis16732.sql b/src/db/migration/migration/V20191028_1712__mantis16732.sql new file mode 100644 index 000000000..e9010dab8 --- /dev/null +++ b/src/db/migration/migration/V20191028_1712__mantis16732.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE INSCRICAO_ESTADUAL ADD (ORIGEM_ID_IEDESCENTRALIZADA NUMBER(7), INDHABILITAIEDESCENTRALIZADA NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191028_1713__mantis16732.sql b/src/db/migration/migration/V20191028_1713__mantis16732.sql new file mode 100644 index 000000000..be8f5e999 --- /dev/null +++ b/src/db/migration/migration/V20191028_1713__mantis16732.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CUSTOM (CUSTOM_ID, SISTEMA, CHAVE, VALOR, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CUSTOM_SEQ.nextval, 3, ''isHabilitaIEDescentralizada'', ''0'', 0, sysdate, 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191028_1714__mantis16732.sql b/src/db/migration/migration/V20191028_1714__mantis16732.sql new file mode 100644 index 000000000..7dee2a994 --- /dev/null +++ b/src/db/migration/migration/V20191028_1714__mantis16732.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE INSCRICAO_ESTADUAL ADD CONSTRAINTS ORIGEM_ID_IEDESC_FK FOREIGN KEY(ORIGEM_ID_IEDESCENTRALIZADA) REFERENCES PARADA(PARADA_ID)'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191029_1132__mantis16732.sql b/src/db/migration/migration/V20191029_1132__mantis16732.sql new file mode 100644 index 000000000..9834b1026 --- /dev/null +++ b/src/db/migration/migration/V20191029_1132__mantis16732.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CTRL_SERIE_BPE ADD (INSCRICAOESTADUAL_ID NUMBER(7))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191029_1133__mantis16732.sql b/src/db/migration/migration/V20191029_1133__mantis16732.sql new file mode 100644 index 000000000..dafdbaa47 --- /dev/null +++ b/src/db/migration/migration/V20191029_1133__mantis16732.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE_CTRL_DISPONIBILIDADE ADD (INSCRICAOESTADUAL_ID NUMBER(7))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191030_1714__mantis16543.sql b/src/db/migration/migration/V20191030_1714__mantis16543.sql new file mode 100644 index 000000000..73973c83f --- /dev/null +++ b/src/db/migration/migration/V20191030_1714__mantis16543.sql @@ -0,0 +1,5 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''RELATORIO_BPE_OTIMIZADO'',''RELATORIO BPE OTIMIZADO'',''1'',''false'',''1'',''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191106_1426__mantis16970.sql b/src/db/migration/migration/V20191106_1426__mantis16970.sql new file mode 100644 index 000000000..2f019ce1b --- /dev/null +++ b/src/db/migration/migration/V20191106_1426__mantis16970.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE DISPOSITIVO_EMBARCADA ADD (IND_VENDE_BPE NUMBER(1,0) )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191107_1730__mantis14037.sql b/src/db/migration/migration/V20191107_1730__mantis14037.sql new file mode 100644 index 000000000..4cdf13ad6 --- /dev/null +++ b/src/db/migration/migration/V20191107_1730__mantis14037.sql @@ -0,0 +1,8 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''IS_FECHAMENTO_RUNNING'',''IS_FECHAMENTO_RUNNING'', + 1,''0'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191120_1129__mantis16864.sql b/src/db/migration/migration/V20191120_1129__mantis16864.sql new file mode 100644 index 000000000..7b391d629 --- /dev/null +++ b/src/db/migration/migration/V20191120_1129__mantis16864.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_PARAMGERAL ADD (BOLETO_BANCO_INSTRUCAO2 VARCHAR2(89), BOLETO_BANCO_INSTRUCAO3 VARCHAR2(89),BOLETO_BANCO_INSTRUCAO_SACADO VARCHAR2(89))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191126_1553__mantis14996.sql b/src/db/migration/migration/V20191126_1553__mantis14996.sql new file mode 100644 index 000000000..fdee96abf --- /dev/null +++ b/src/db/migration/migration/V20191126_1553__mantis14996.sql @@ -0,0 +1,12 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > RELATORIOS > FINANCEIRO > PRECOS PRATICADOS'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOPRECOSPRATICADOS'',''1'',null,''2'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V2019114_1709__mantis16996.sql b/src/db/migration/migration/V2019114_1709__mantis16996.sql new file mode 100644 index 000000000..9d8749b70 --- /dev/null +++ b/src/db/migration/migration/V2019114_1709__mantis16996.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE AUDITORIA_CHAVE MODIFY VALOR VARCHAR2(600 BYTE)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191206_1400__mantis14993.sql b/src/db/migration/migration/V20191206_1400__mantis14993.sql new file mode 100644 index 000000000..fa416b238 --- /dev/null +++ b/src/db/migration/migration/V20191206_1400__mantis14993.sql @@ -0,0 +1,29 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE GP_PRICING_HISTORICO_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE GP_PRICING_HISTORICO ( + PRICINGHISTORICO_ID NUMBER(15,0) NOT NULL ENABLE, + PRICING_ID NUMBER(15,0), + ISESPECIFICO NUMBER(1,0), + DESCRICAO VARCHAR2(500), + VALORANTERIOR VARCHAR2(100), + VALORNOVO VARCHAR2(100), + CAMPOALTERADO VARCHAR2(100), + CLASSEALTERADA VARCHAR2(100), + CLASSEPRINCIPAL VARCHAR2(100), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK__PRICING_HISTORICO PRIMARY KEY (PRICINGHISTORICO_ID))'; + exception when others then null; +end; + + \ No newline at end of file diff --git a/src/db/migration/migration/V20191209_1629__mantis17283.sql b/src/db/migration/migration/V20191209_1629__mantis17283.sql new file mode 100644 index 000000000..45e5b720d --- /dev/null +++ b/src/db/migration/migration/V20191209_1629__mantis17283.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDIMPRESSAOCANHOTOEMBARCADA NUMBER(1))'; + + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191210_1610__mantis14993.sql b/src/db/migration/migration/V20191210_1610__mantis14993.sql new file mode 100644 index 000000000..e5df39d22 --- /dev/null +++ b/src/db/migration/migration/V20191210_1610__mantis14993.sql @@ -0,0 +1,20 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS > RELATORIO DE MUDANCAS PRICING'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.RELATORIOSDEMUDANCAS.RELATORIOSDEMUDANCASPRICING'',1,SYSDATE, -1)'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS > RELATORIO DE MUDANCAS'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.RELATORIOSDEMUDANCAS'',1,SYSDATE, -1)'; + exception when others then null; +end; + \ No newline at end of file diff --git a/src/db/migration/migration/V20191211_1057__mantis17529.sql b/src/db/migration/migration/V20191211_1057__mantis17529.sql new file mode 100644 index 000000000..8fd952690 --- /dev/null +++ b/src/db/migration/migration/V20191211_1057__mantis17529.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > SEGURANCA > REENVIO BP-e'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.REENVIO_BPE'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191211_1129__mantis14994.sql b/src/db/migration/migration/V20191211_1129__mantis14994.sql new file mode 100644 index 000000000..83f1550a5 --- /dev/null +++ b/src/db/migration/migration/V20191211_1129__mantis14994.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE SEQUENCE TARIFA_HISTORICO_SEQ START WITH 1 INCREMENT BY 1'; + exception when others then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); + begin + execute immediate 'CREATE TABLE TARIFA_HISTORICO ( + TARIFAHISTORICO_ID NUMBER(15,0) NOT NULL ENABLE, + TARIFA_ID NUMBER(15,0), + DESCRICAO VARCHAR2(500), + VALORANTERIOR VARCHAR2(100), + VALORNOVO VARCHAR2(100), + CAMPOALTERADO VARCHAR2(100), + CLASSEALTERADA VARCHAR2(100), + CLASSEPRINCIPAL VARCHAR2(100), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK__TARIFA_HISTORICO PRIMARY KEY (TARIFAHISTORICO_ID))'; + exception when others then null; +end; + + \ No newline at end of file diff --git a/src/db/migration/migration/V20191211_1847__mantis14994.sql b/src/db/migration/migration/V20191211_1847__mantis14994.sql new file mode 100644 index 000000000..261c73a1e --- /dev/null +++ b/src/db/migration/migration/V20191211_1847__mantis14994.sql @@ -0,0 +1,26 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE SECRETARIA_RUTA ( + SECRETARIARUTA_ID INTEGER NOT NULL, + SECRETARIA_ID NUMBER(7) NULL, + RUTA_ID NUMBER(7) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (SECRETARIARUTA_ID), + FOREIGN KEY (RUTA_ID) REFERENCES RUTA, + FOREIGN KEY (SECRETARIA_ID) REFERENCES SECRETARIA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE SECRETARIARUTA_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191211_1848__mantis14994.sql b/src/db/migration/migration/V20191211_1848__mantis14994.sql new file mode 100644 index 000000000..3e1e8066c --- /dev/null +++ b/src/db/migration/migration/V20191211_1848__mantis14994.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE SECRETARIA_PARADA ( + SECRETARIAPARADA_ID INTEGER NOT NULL, + SECRETARIA_ID NUMBER(7) NULL, + ORIGEN_ID NUMBER(7) NULL, + DESTINO_ID NUMBER(7) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (SECRETARIAPARADA_ID), + FOREIGN KEY (SECRETARIA_ID) REFERENCES SECRETARIA, + FOREIGN KEY (DESTINO_ID) REFERENCES PARADA, + FOREIGN KEY (ORIGEN_ID) REFERENCES PARADA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE SECRETARIAPARADA_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191211_1849__mantis14994.sql b/src/db/migration/migration/V20191211_1849__mantis14994.sql new file mode 100644 index 000000000..a210be0ee --- /dev/null +++ b/src/db/migration/migration/V20191211_1849__mantis14994.sql @@ -0,0 +1,26 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE SECRETARIA_PUNTOVENTA ( + SECRETARIAPUNTOVENTA_ID INTEGER NOT NULL, + SECRETARIA_ID NUMBER(7) NULL, + PUNTOVENTA_ID NUMBER(7) NULL, + ACTIVO NUMBER(1) NULL, + USUARIO_ID NUMBER(7) NULL, + FECMODIF DATE NULL, + PRIMARY KEY (SECRETARIAPUNTOVENTA_ID), + FOREIGN KEY (SECRETARIA_ID) REFERENCES SECRETARIA, + FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE SECRETARIAPUNTOVENTA_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191211_1850__mantis14994.sql b/src/db/migration/migration/V20191211_1850__mantis14994.sql new file mode 100644 index 000000000..c3e29900c --- /dev/null +++ b/src/db/migration/migration/V20191211_1850__mantis14994.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CUPON_SECRETARIA ADD CREDITO NUMBER(10,2)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191218_1106__mantis14997.sql b/src/db/migration/migration/V20191218_1106__mantis14997.sql new file mode 100644 index 000000000..6c4a4f7be --- /dev/null +++ b/src/db/migration/migration/V20191218_1106__mantis14997.sql @@ -0,0 +1,14 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > RELATORIOS > RELATORIO DE VENDAS CONEXAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOCONEXOES'', +''1'',to_date(''10/12/19'',''DD/MM/RR''),''-1'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191218_1109__mantis14998.sql b/src/db/migration/migration/V20191218_1109__mantis14998.sql new file mode 100644 index 000000000..596a278f2 --- /dev/null +++ b/src/db/migration/migration/V20191218_1109__mantis14998.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''ADM > RELATORIOS > RELATORIOS > RELATORIOS OPERACIONAIS > CANAL DE EMISSAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDACANALEMISSAO'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191219_1050__mantis17313.sql b/src/db/migration/migration/V20191219_1050__mantis17313.sql new file mode 100644 index 000000000..68d6de529 --- /dev/null +++ b/src/db/migration/migration/V20191219_1050__mantis17313.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_OPERACION_CC (TIPOOPERACIONCC_ID, DESCTIPO, CVETIPO, INDCREDITO, ACTIVO, FECMODIF, USUARIO_ID) VALUES (6, ''COBRANCA ADICIONAL'', ''CA'', 0, 1, SYSDATE, 99)'; + + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191219_1559__mantis17120.sql b/src/db/migration/migration/V20191219_1559__mantis17120.sql new file mode 100644 index 000000000..a95d9f4db --- /dev/null +++ b/src/db/migration/migration/V20191219_1559__mantis17120.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''VDA > VENDA > CANCELAMENTO BP-e MIGRACAO'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUCANCELAMENTOBPEMIGRACAO'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20191230_1420__mantis17264.sql b/src/db/migration/migration/V20191230_1420__mantis17264.sql new file mode 100644 index 000000000..33ac9528a --- /dev/null +++ b/src/db/migration/migration/V20191230_1420__mantis17264.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE USUARIO ADD ESTACIONINTERNET_ID NUMBER(7)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200103_1045__mantis17121.sql b/src/db/migration/migration/V20200103_1045__mantis17121.sql new file mode 100644 index 000000000..4a1e26544 --- /dev/null +++ b/src/db/migration/migration/V20200103_1045__mantis17121.sql @@ -0,0 +1,88 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE COTACAO ( +COTACAO_ID NUMBER(7,0) NOT NULL, +MONEDA_ID NUMBER(7,0), +VALOR NUMBER(10,2), +FECMODIF DATE, +ACTIVO NUMBER(1,0), +USUARIO_ID NUMBER(7,0), +CONSTRAINT COTACAO_PK PRIMARY KEY(COTACAO_ID), +CONSTRAINT COTACAO_MONEDA_FK + FOREIGN KEY (MONEDA_ID) + REFERENCES MONEDA(MONEDA_ID) +)'; + exception when object_exists then null; +end; + +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE COTACAO_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; + +/ + +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > ADM DE PRECO > COTACAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.COTACAO'', +''1'',to_date(''23/12/19'',''DD/MM/RR''),''-1'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + +/ + +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE BOLETO ADD COTACAO_ID NUMBER(7,0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; + + +/ + +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE BOLETO +ADD CONSTRAINT FK_BOLETO_COTACAO + FOREIGN KEY (COTACAO_ID) + REFERENCES COTACAO (COTACAO_ID)'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200108_1425__mantis16776.sql b/src/db/migration/migration/V20200108_1425__mantis16776.sql new file mode 100644 index 000000000..f13f113b2 --- /dev/null +++ b/src/db/migration/migration/V20200108_1425__mantis16776.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDIMPRIMEQRCODEADICIONAL NUMBER(1,0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200112_1934__mantis20761.sql b/src/db/migration/migration/V20200112_1934__mantis20761.sql new file mode 100644 index 000000000..fc568b836 --- /dev/null +++ b/src/db/migration/migration/V20200112_1934__mantis20761.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD NUMCORRIDAPISOEXTRA2 NUMBER(7,0) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; diff --git a/src/db/migration/migration/V20200114_1129__mantis17842.sql b/src/db/migration/migration/V20200114_1129__mantis17842.sql new file mode 100644 index 000000000..b02b63792 --- /dev/null +++ b/src/db/migration/migration/V20200114_1129__mantis17842.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONSTANTE MODIFY DESCCONSTANTE VARCHAR2(200)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200114_1130__mantis17842.sql b/src/db/migration/migration/V20200114_1130__mantis17842.sql new file mode 100644 index 000000000..b881fa6ec --- /dev/null +++ b/src/db/migration/migration/V20200114_1130__mantis17842.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''BPE_CONTINGENCIA_AUTOMATICA'', ''ATIVA CONTINGENCIA AUTOMATICA EM CASO DE TIMEOUT SEFAZ'', ''FALSE'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200114_1131__mantis17842.sql b/src/db/migration/migration/V20200114_1131__mantis17842.sql new file mode 100644 index 000000000..4a3d618fd --- /dev/null +++ b/src/db/migration/migration/V20200114_1131__mantis17842.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_HISTORICO_CONTINGENCIA ADD (INDAUTOMATICA NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200114_1320__jira206.sql b/src/db/migration/migration/V20200114_1320__jira206.sql new file mode 100644 index 000000000..ea2d7485a --- /dev/null +++ b/src/db/migration/migration/V20200114_1320__jira206.sql @@ -0,0 +1,59 @@ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE GP_PRICING_ASIENTO ADD (VALORADICIONALPRICING NUMBER(5,2) )'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (HORAANTECIPA DATE )'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (VALORADICIONALPRICING NUMBER(5,2) )'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (PORCADICIONALPRICING NUMBER(5,2) )'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (REDONDEO NUMBER(1) )'; + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200115_1138__mantis17842.sql b/src/db/migration/migration/V20200115_1138__mantis17842.sql new file mode 100644 index 000000000..5d221e933 --- /dev/null +++ b/src/db/migration/migration/V20200115_1138__mantis17842.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''BPE_QTDE_TIMEOUT_SEFAZ'', ''CONTADOR DE TIMEOUTS SEFAZ PARA ATIVACAO CONTINGENCIA AUTOMATICA'', ''15'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200115_1139__mantis17842.sql b/src/db/migration/migration/V20200115_1139__mantis17842.sql new file mode 100644 index 000000000..bf7141c50 --- /dev/null +++ b/src/db/migration/migration/V20200115_1139__mantis17842.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''BPE_TEMPO_REMOVE_CONTINGENCIA_AUTOMATICA'', ''TEMPO PARA REMOVER CONTINGENCIA AUTOMATICA VIA TIMEOUT (EM MINUTOS)'', ''5'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200124_1559__mantis16789.sql b/src/db/migration/migration/V20200124_1559__mantis16789.sql new file mode 100644 index 000000000..8f213b850 --- /dev/null +++ b/src/db/migration/migration/V20200124_1559__mantis16789.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDEMITESOMENTECUPOMEMBARQUE NUMBER(1), QTDE_VIAS_CUPOM_EMBARQUE NUMBER(5))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200124_1600__mantis16789.sql b/src/db/migration/migration/V20200124_1600__mantis16789.sql new file mode 100644 index 000000000..65b2da535 --- /dev/null +++ b/src/db/migration/migration/V20200124_1600__mantis16789.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) + values (funcion_sistema_seq.nextval,1,''ADM > CONFIGURACAO COMERCIAL > CONFIG. TIPO PASSAGEM > EMITE SOMENTE CUPOM EMBARQUE'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.CONFIGTIPOPASSAGEM.EMITESOMENTECPEMB'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200124_1655__mantis17509.sql b/src/db/migration/migration/V20200124_1655__mantis17509.sql new file mode 100644 index 000000000..a6e163296 --- /dev/null +++ b/src/db/migration/migration/V20200124_1655__mantis17509.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (INDALIQUOTABPEUFDESTINO NUMBER(1) )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200126_1119__mantis18028.sql b/src/db/migration/migration/V20200126_1119__mantis18028.sql new file mode 100644 index 000000000..d3b23c568 --- /dev/null +++ b/src/db/migration/migration/V20200126_1119__mantis18028.sql @@ -0,0 +1,36 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE PRICING_CTRL ( + PRICINGCTRL_ID NUMBER(7) NOT NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (PRICINGCTRL_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE PRICING_CTRL_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > PRICING > CONFIGURACAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MENU.CONFIGURACAO'', +''1'',sysdate,''-1'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200128_1625__mantis17509.sql b/src/db/migration/migration/V20200128_1625__mantis17509.sql new file mode 100644 index 000000000..e2426477c --- /dev/null +++ b/src/db/migration/migration/V20200128_1625__mantis17509.sql @@ -0,0 +1,36 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE "ALIQUOTA_ESTADO_DESTINO" + ( "ALIQUOTAESTADODESTINO_ID" NUMBER(10,0), + "ESTADO_ID" NUMBER(7,0), + "ALIQUOTA" NUMBER(5,2), + "EMPRESAIMPOSTO_ID" NUMBER(7,0), + "ACTIVO" NUMBER(1,0), + "FECMODIF" DATE, + "USUARIO_ID" NUMBER(7,0), + PRIMARY KEY ("ALIQUOTAESTADODESTINO_ID") + USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 + STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 + PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 + BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) + TABLESPACE "USERS" ENABLE, + CONSTRAINT "FK_ALIQUOTA_ESTADO_DESTINO_USU" FOREIGN KEY ("USUARIO_ID") + REFERENCES "USUARIO" ("USUARIO_ID") ENABLE, + CONSTRAINT "ALIQUOTAESTADODESTINO_ID_ES_FK" FOREIGN KEY ("ESTADO_ID") + REFERENCES "ESTADO" ("ESTADO_ID") ENABLE, + CONSTRAINT "ALIQUO_EST_DEST_ID_EMP_IMP_FK" FOREIGN KEY ("EMPRESAIMPOSTO_ID") + REFERENCES "EMPRESA_IMPOSTO" ("EMPRESAIMPOSTO_ID") ENABLE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE ALIQUOTAESTADODESTINO_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200130_1029__mantis16537.sql b/src/db/migration/migration/V20200130_1029__mantis16537.sql new file mode 100644 index 000000000..c4b38a3c6 --- /dev/null +++ b/src/db/migration/migration/V20200130_1029__mantis16537.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES (CONSTANTE_seq.nextval,''TS05_PATH_PEDIDO_PAGAMENTO'',''TROCO SIMPLES. Pedido de pagamento com saldo'',1, ''v1/transaction/payment/{parametro}'',1,1,null,1)'; + exception when dup_val_on_index then NULL; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES (CONSTANTE_seq.nextval,''TS06_PATH_STATUS_AUTORIZACAO_CLIENTE'',''TROCO SIMPLES. Verificar status do pedido de pagamento'',1,''v1/transaction/{parametro}/authorization'',1,1,null,1)'; + exception when dup_val_on_index then NULL; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200130_1610__mantis18026.sql b/src/db/migration/migration/V20200130_1610__mantis18026.sql new file mode 100644 index 000000000..d3baf3578 --- /dev/null +++ b/src/db/migration/migration/V20200130_1610__mantis18026.sql @@ -0,0 +1,19 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (TEMPOLIBERACAODEPOISKM DATE, + TEMPOLIBERACAOATEKM DATE, + KMVENDAANTECIPADA NUMBER(5,0), + INDVENDAANTECIPADAPORKM NUMBER(1,0) +)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200131_1855__mantis18164.sql b/src/db/migration/migration/V20200131_1855__mantis18164.sql new file mode 100644 index 000000000..d4dea9afc --- /dev/null +++ b/src/db/migration/migration/V20200131_1855__mantis18164.sql @@ -0,0 +1,29 @@ +DECLARE + itemExists NUMBER; +BEGIN + itemExists := 0; + + SELECT COUNT(CONSTRAINT_NAME) INTO itemExists + FROM ALL_CONSTRAINTS + WHERE UPPER(CONSTRAINT_NAME) = UPPER('UNIQUE_CODANTT'); + + IF itemExists > 0 THEN + BEGIN + EXECUTE IMMEDIATE 'ALTER TABLE PARADA DROP CONSTRAINT UNIQUE_CODANTT'; + EXECUTE IMMEDIATE 'DROP INDEX UNIQUE_CODANTT;'; + exception when others THEN null; + END; + END IF; +END; +/ +DECLARE + object_exists exception; + except_01408 exception; + pragma exception_init (object_exists , -00955); + pragma exception_init (except_01408 , -01408); +BEGIN + execute IMMEDIATE 'CREATE UNIQUE INDEX UNIQUE_CODANTT ON PARADA (CASE WHEN ACTIVO = 1 THEN CODANTT ELSE NULL END)'; + exception + when object_exists THEN null; + when except_01408 THEN null; +END; \ No newline at end of file diff --git a/src/db/migration/migration/V20200202_1310__mantis17915.sql b/src/db/migration/migration/V20200202_1310__mantis17915.sql new file mode 100644 index 000000000..79a888d9b --- /dev/null +++ b/src/db/migration/migration/V20200202_1310__mantis17915.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''ADM > SEGURANCA > VALIDA SENHA INSTALACAO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.VALIDASENHAINSTALACAOVENDAEMBARCADA'',1,sysdate,1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200203_1412__mantis16537.sql b/src/db/migration/migration/V20200203_1412__mantis16537.sql new file mode 100644 index 000000000..ba0984163 --- /dev/null +++ b/src/db/migration/migration/V20200203_1412__mantis16537.sql @@ -0,0 +1,17 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); + + begin + execute immediate 'ALTER TABLE CAJA_DET_PAGO ADD PAGAMENTO_ID_TROCO_SIMPLES VARCHAR(100)'; + exception when object_exists then null; + end; + / + declare + object_exists exception; + pragma exception_init (object_exists , -01430); + + begin + execute immediate 'ALTER TABLE CAJA_DET_PAGO ADD CPF_TROCO_SIMPLES VARCHAR(15)'; + exception when object_exists then null; + end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200203_2017__mantis18049.sql b/src/db/migration/migration/V20200203_2017__mantis18049.sql new file mode 100644 index 000000000..7db6550e1 --- /dev/null +++ b/src/db/migration/migration/V20200203_2017__mantis18049.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD PORCCOMISSAOVENDA NUMBER(5,2)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200204_1008__mantis17900.sql b/src/db/migration/migration/V20200204_1008__mantis17900.sql new file mode 100644 index 000000000..6e5d9b312 --- /dev/null +++ b/src/db/migration/migration/V20200204_1008__mantis17900.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (URL_CONSULTA VARCHAR(200))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200206_1500__mantis16537.sql b/src/db/migration/migration/V20200206_1500__mantis16537.sql new file mode 100644 index 000000000..b4e76c7a4 --- /dev/null +++ b/src/db/migration/migration/V20200206_1500__mantis16537.sql @@ -0,0 +1,38 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE DADOS_ESTORNO_TROCOSIMPLES ( + DADOSESTORNOTROCOSIMPLES_ID NUMBER(7) NOT NULL, + CPF VARCHAR2(15), + ID_TRANSACAO VARCHAR2(100), + DATATRANSACAO DATE, + ACTIVO NUMBER(1), + NUMFOLIOSISTEMA VARCHAR2(36), + VALORTOTAL NUMBER(11,2), + VALORESTORNADO NUMBER(11,2), + NUMOPERACION VARCHAR2(36), + ORIGEN_ID NUMBER(7), + DESTINO_ID NUMBER(7), + CORRIDA_ID NUMBER(22,0), + FECCORRIDA DATE, + EMPRESA_ID NUMBER(22,0), + PUNTOVENTA_ID NUMBER(22,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7), + PRIMARY KEY (DADOSESTORNOTROCOSIMPLES_ID), + FOREIGN KEY (DESTINO_ID) REFERENCES PARADA (PARADA_ID) ENABLE, + FOREIGN KEY (ORIGEN_ID) REFERENCES PARADA (PARADA_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE DADOS_ESTORNO_TS_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20200211_1103__mantis18290.sql b/src/db/migration/migration/V20200211_1103__mantis18290.sql new file mode 100644 index 000000000..72de78acc --- /dev/null +++ b/src/db/migration/migration/V20200211_1103__mantis18290.sql @@ -0,0 +1,33 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDIMPRIMEVOUCHERPERSONALIZADO NUMBER(1,0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; + +/ + +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD CAMPO_CUSTOM_VOUCHER CLOB'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; diff --git a/src/db/migration/migration/V20200211_1124__mantis16537.sql b/src/db/migration/migration/V20200211_1124__mantis16537.sql new file mode 100644 index 000000000..1dddb9169 --- /dev/null +++ b/src/db/migration/migration/V20200211_1124__mantis16537.sql @@ -0,0 +1,14 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.nextVal ,''2'',''ADM > ESQUEMA_OPERACIONAL > RELATORIO_ESTORNO_TROCO_SIMPLES'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.RELATORIOESTORNOTROCOSIMPLES'',''1'',to_date(''11/02/20'',''DD/MM/RR''),null)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200212_1510__mantis18256.sql b/src/db/migration/migration/V20200212_1510__mantis18256.sql new file mode 100644 index 000000000..632469348 --- /dev/null +++ b/src/db/migration/migration/V20200212_1510__mantis18256.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > SEGURANCA > EXTRAIR BP-e XML'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.EXTRAIRBPEXML'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200213_1106__mantis18326.sql b/src/db/migration/migration/V20200213_1106__mantis18326.sql new file mode 100644 index 000000000..683c2a302 --- /dev/null +++ b/src/db/migration/migration/V20200213_1106__mantis18326.sql @@ -0,0 +1,33 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update custom set sistema = ''2'' where chave = ''ocupaValidacionExternaAutobus'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''clienteProducto'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''isValidarVigenciaAbierto'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''isValidarUsuarioEstacaoMesmoPontoVenda'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''isTarjetaViaje'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''envioAvituallamiento'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''copiaBloqueioSimilar'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''mostrarAutoBusMenorAsiento'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''trataReexpedicion'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''database.rds'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''ordenaCorridasPorHoraDestinoServico'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''ordenaCorridasPorHoraServico'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''reporteCorteAgenciaCentral'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''generaNumFolioSistemaVentaInternet'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''generaNumFolioSistemaAbertoPrePago'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''generaCajaOcupacion'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''tipoNumSistema'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''maxNumfoliosistema'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''isVentaGratuidadeNinoSimilarParado'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''isCodigoAgenciaMapaViagem'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''isTaxaEmbarqueSocicamAgenciaOrigem'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''isConsiderarSeguroOpcionalPreco'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''isConsiderarICMSIntermunicipalIMatricial'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''isConsiderarICMSInterestadualIMatricial'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''imprimeApenasNroPuntoVenta'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''exibeNumRutaMapa'''; + execute immediate 'update custom set sistema = ''2'' where chave = ''trataVoucher'''; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200215_1330__mantis18073.sql b/src/db/migration/migration/V20200215_1330__mantis18073.sql new file mode 100644 index 000000000..8734d59c4 --- /dev/null +++ b/src/db/migration/migration/V20200215_1330__mantis18073.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY CORPOLTRONA VARCHAR2(30)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200217_1730__mantis18336.sql b/src/db/migration/migration/V20200217_1730__mantis18336.sql new file mode 100644 index 000000000..fd748f520 --- /dev/null +++ b/src/db/migration/migration/V20200217_1730__mantis18336.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''SMTP_EMAIL_COPIA_OCULTA'', ''COPIA OCULTA DO E-MAIL ENVIADO NO TAREAS'', NULL, ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200217_2050__mantis18075.sql b/src/db/migration/migration/V20200217_2050__mantis18075.sql new file mode 100644 index 000000000..756fc913c --- /dev/null +++ b/src/db/migration/migration/V20200217_2050__mantis18075.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''MAPA_VIAGEM_INT_APENAS_ORI_DES_FORA_PAIS'', ''EXIBE SOMENTE PASSAGEIROS NO MAPA DE VIAGEM INTERNACIONAL QUE POSSUEM ORIGEM E DESTINO FORA DO PAIS'', ''TRUE'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200217_2128__mantis18029.sql b/src/db/migration/migration/V20200217_2128__mantis18029.sql new file mode 100644 index 000000000..b30db2e3b --- /dev/null +++ b/src/db/migration/migration/V20200217_2128__mantis18029.sql @@ -0,0 +1,14 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > PRICING > MODIFICACAO MASSIVA WS'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MODIFICACAOMASSIVAWS'', +''1'',sysdate,''-1'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200218_0930__mantis18330.sql b/src/db/migration/migration/V20200218_0930__mantis18330.sql new file mode 100644 index 000000000..71cd0e005 --- /dev/null +++ b/src/db/migration/migration/V20200218_0930__mantis18330.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > CALCULO DE PRECO > ESTOQUE TAXA DE EMBARQUE W2I'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.ESTOQUEW2I'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200220_1356__mantis18139.sql b/src/db/migration/migration/V20200220_1356__mantis18139.sql new file mode 100644 index 000000000..0143ecccd --- /dev/null +++ b/src/db/migration/migration/V20200220_1356__mantis18139.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, VALORCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) VALUES (CONSTANTE_SEQ.NEXTVAL, ''LIMITE_ID_FORMA_PAGTO'', ''LIMITE_ID_FORMA_PAGTO'', ''1'', ''99'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200221_1514__mantis18424.sql b/src/db/migration/migration/V20200221_1514__mantis18424.sql new file mode 100644 index 000000000..40651af72 --- /dev/null +++ b/src/db/migration/migration/V20200221_1514__mantis18424.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDIMPCOMPROVANTERESERVA NUMBER(1,0) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200227_0946__mantis18424.sql b/src/db/migration/migration/V20200227_0946__mantis18424.sql new file mode 100644 index 000000000..7dc1c9ac9 --- /dev/null +++ b/src/db/migration/migration/V20200227_0946__mantis18424.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE RESERVACION_CTRL ADD TEMPOCONFIRMACAO DATE'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200227_1821__mantis18444.sql b/src/db/migration/migration/V20200227_1821__mantis18444.sql new file mode 100644 index 000000000..6e2c9d1a8 --- /dev/null +++ b/src/db/migration/migration/V20200227_1821__mantis18444.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update custom set sistema = ''2'' where chave = ''clienteProducto'' and tipo = ''4'''; + execute immediate 'update custom set sistema = ''1'' where chave = ''clienteProducto'' and tipo = ''1'''; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200228_0952__mantis18447.sql b/src/db/migration/migration/V20200228_0952__mantis18447.sql new file mode 100644 index 000000000..5d2580d18 --- /dev/null +++ b/src/db/migration/migration/V20200228_0952__mantis18447.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''COPIAR_BLOQUEIOS_SERVICOS_EXTRAS'', ''HABILITA COPIA DOS BLOQUEIOS DO SERVICOS AO CRIAR UM EXTRA SIMILAR'', ''TRUE'', ''1'', ''1'', ''0'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200303_1724__mantis18527.sql b/src/db/migration/migration/V20200303_1724__mantis18527.sql new file mode 100644 index 000000000..623f47c89 --- /dev/null +++ b/src/db/migration/migration/V20200303_1724__mantis18527.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDENVIADADOSAGENCIABPE NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200305_1140__mantis18157.sql b/src/db/migration/migration/V20200305_1140__mantis18157.sql new file mode 100644 index 000000000..410a59498 --- /dev/null +++ b/src/db/migration/migration/V20200305_1140__mantis18157.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDPRECOPORDEMANDA NUMBER(1,0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200311_1131__mantis18357.sql b/src/db/migration/migration/V20200311_1131__mantis18357.sql new file mode 100644 index 000000000..0549b26ff --- /dev/null +++ b/src/db/migration/migration/V20200311_1131__mantis18357.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA_EMBRQ_DESEMBRQ ADD (PARADA_EMB_DES_ID NUMBER(7))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200311_1200__mantis18157.sql b/src/db/migration/migration/V20200311_1200__mantis18157.sql new file mode 100644 index 000000000..814d80439 --- /dev/null +++ b/src/db/migration/migration/V20200311_1200__mantis18157.sql @@ -0,0 +1,8 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''PERIODICIDADE_PORDEMANDA'',''PERIODICIDADE_PORDEMANDA'', + 1,''1'',null,''1'',sysdate,''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200312_1031__mantis18447.sql b/src/db/migration/migration/V20200312_1031__mantis18447.sql new file mode 100644 index 000000000..5f73db280 --- /dev/null +++ b/src/db/migration/migration/V20200312_1031__mantis18447.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'UPDATE CONSTANTE SET ACTIVO=1 WHERE NOMBCONSTANTE = ''COPIAR_BLOQUEIOS_SERVICOS_EXTRAS'''; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200312_1113__mantis18357.sql b/src/db/migration/migration/V20200312_1113__mantis18357.sql new file mode 100644 index 000000000..5feb6ffe6 --- /dev/null +++ b/src/db/migration/migration/V20200312_1113__mantis18357.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA_EMBRQ_DESEMBRQ ADD (PARADA_EMB_DES_ID NUMBER(7) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200313_1000__mantis18490.sql b/src/db/migration/migration/V20200313_1000__mantis18490.sql new file mode 100644 index 000000000..cbab5f9fa --- /dev/null +++ b/src/db/migration/migration/V20200313_1000__mantis18490.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA MODIFY (MOTIVONAOINTEGRADOAG VARCHAR2(1000 BYTE))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200313_1617__mantis18249.sql b/src/db/migration/migration/V20200313_1617__mantis18249.sql new file mode 100644 index 000000000..71fec4717 --- /dev/null +++ b/src/db/migration/migration/V20200313_1617__mantis18249.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE INSCRICAO_ESTADUAL ADD INDFORMAPAGOOUTROSSEMCARTAO NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200316_1522__mantis18200.sql b/src/db/migration/migration/V20200316_1522__mantis18200.sql new file mode 100644 index 000000000..6ce827d06 --- /dev/null +++ b/src/db/migration/migration/V20200316_1522__mantis18200.sql @@ -0,0 +1,31 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE CLIENTE ADD (ISESTRANGEIRO NUMBER(1,0))'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE CLIENTE_DIRECCION ADD (DESCPAIS VARCHAR2(60 BYTE)) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200318_1150__mantis18646.sql b/src/db/migration/migration/V20200318_1150__mantis18646.sql new file mode 100644 index 000000000..90d285b59 --- /dev/null +++ b/src/db/migration/migration/V20200318_1150__mantis18646.sql @@ -0,0 +1,25 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE RUTA_EMBRQ_DESEMBRQ SET PARADA_EMB_DES_ID = PARADA_ID WHERE PARADA_EMB_DES_ID IS NULL AND PARADA_ID IS NOT NULL'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE ESQUEMA_CORRIDA_EMBRQ_DESEMBRQ SET PARADA_EMB_DES_ID = PARADA_ID WHERE PARADA_EMB_DES_ID IS NULL AND PARADA_ID IS NOT NULL'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200324_0832__mantis18815.sql b/src/db/migration/migration/V20200324_0832__mantis18815.sql new file mode 100644 index 000000000..30e6915fa --- /dev/null +++ b/src/db/migration/migration/V20200324_0832__mantis18815.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''UF_AUTORIZA_CANCEL_APOS_DT_EMBARQUE'', ''INFORME AS SIGLAS DAS UFs QUE PERMITEM CANCELAMENTO APOS DATA DE EMBARQUE SEPARADO POR ;'', ''SP'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200402_1516__mantis18897.sql b/src/db/migration/migration/V20200402_1516__mantis18897.sql new file mode 100644 index 000000000..fcc851f74 --- /dev/null +++ b/src/db/migration/migration/V20200402_1516__mantis18897.sql @@ -0,0 +1,31 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE DISPOSITIVO_EMBARCADA ADD ( VERSAO VARCHAR2(60) )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE DISPOSITIVO_EMBARCADA ADD ( FECHORSINC DATE )'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200403_1435__mantis18864.sql b/src/db/migration/migration/V20200403_1435__mantis18864.sql new file mode 100644 index 000000000..fe1ede3b7 --- /dev/null +++ b/src/db/migration/migration/V20200403_1435__mantis18864.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE USUARIO ADD TIPOVENTAINTEGRACAO_ID NUMBER(7)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200403_1654__mantis18919.sql b/src/db/migration/migration/V20200403_1654__mantis18919.sql new file mode 100644 index 000000000..0f2b70305 --- /dev/null +++ b/src/db/migration/migration/V20200403_1654__mantis18919.sql @@ -0,0 +1,79 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 1 , ''RG'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 2 , ''CPF'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 13 , ''PASPT'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 14 , ''RUT'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 15 , ''CNPJ'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 22 , ''DOC X'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 23 , ''CN'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 24 , ''RNE'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 25 , ''DOC_IDOSO'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO TIPO_IDENTIFICACION values ( 26 , ''DNI'', 1 , CURRENT_DATE, 1) '; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20200406_1558__mantis18396.sql b/src/db/migration/migration/V20200406_1558__mantis18396.sql new file mode 100644 index 000000000..ebc1e815d --- /dev/null +++ b/src/db/migration/migration/V20200406_1558__mantis18396.sql @@ -0,0 +1,57 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDRATEIOCOMISSAOGRUPOLINHA NUMBER(1, 0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDCOMISSAOGRUPOLINHAORIGINAL NUMBER(1, 0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CONTA_CORRENTE_PTOVTA_GR_LIN ( + CONTACORRENTEPTOVTAGRLIN_ID NUMBER(7,0) NOT NULL, + CONTACORRENTEPTOVTA_ID NUMBER(7,0) NOT NULL, + GRUPORUTA_ID NUMBER(7,0), + IMPORTE NUMBER(12,2) NOT NULL, + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_CONTA_CORR_PTOVTA_GR_LIN PRIMARY KEY(CONTACORRENTEPTOVTAGRLIN_ID), + CONSTRAINT FK_CONTA_CORR_PTOVTA_GR_LIN_1 FOREIGN KEY (CONTACORRENTEPTOVTA_ID) REFERENCES CONTA_CORRENTE_PTOVTA (CONTACORRENTEPTOVTA_ID), + CONSTRAINT FK_CONTA_CORR_PTOVTA_GR_LIN_2 FOREIGN KEY (GRUPORUTA_ID) REFERENCES GRUPO_RUTA (GRUPORUTA_ID))'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE CONTA_CORR_PTOVTA_GR_LIN_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200415_1010__mantis18933.sql b/src/db/migration/migration/V20200415_1010__mantis18933.sql new file mode 100644 index 000000000..5173a3d65 --- /dev/null +++ b/src/db/migration/migration/V20200415_1010__mantis18933.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDEMITEDABPEVDAFIDELIDADE NUMBER(1,0) DEFAULT 0 NOT NULL)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200416_1724__mantis18979.sql b/src/db/migration/migration/V20200416_1724__mantis18979.sql new file mode 100644 index 000000000..b1ec8b87b --- /dev/null +++ b/src/db/migration/migration/V20200416_1724__mantis18979.sql @@ -0,0 +1,22 @@ +declare + indice_nao_existe exception; + pragma exception_init (indice_nao_existe , -01418); +begin + execute immediate 'DROP INDEX UNQ_TARIFA'; + exception when indice_nao_existe then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -00955); +begin + execute immediate 'CREATE UNIQUE INDEX UNQ_TARIFA ON TARIFA (CASE when activo = 1 then TRAMO_ID else null end,CASE when activo = 1 then MARCA_ID else null end, +CASE when activo = 1 then CLASESERVICIO_ID else null end, +CASE when activo = 1 then MONEDA_ID else null end, +CASE when activo = 1 then VIGENCIATARIFA_ID else null end, +CASE when activo = 1 then ORGAOCONCEDENTE_ID else null end, +CASE when activo = 1 then RUTA_ID else null end)'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20200423_1638__mantis18660.sql b/src/db/migration/migration/V20200423_1638__mantis18660.sql new file mode 100644 index 000000000..d8d384ee1 --- /dev/null +++ b/src/db/migration/migration/V20200423_1638__mantis18660.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION_SITEF ADD (CNPJ VARCHAR2(14), TIPO_INTEGRACAO VARCHAR2(20))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200424_1600__mantis19009.sql b/src/db/migration/migration/V20200424_1600__mantis19009.sql new file mode 100644 index 000000000..93b104f60 --- /dev/null +++ b/src/db/migration/migration/V20200424_1600__mantis19009.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''QRCODE_CATRACA_RODOVIARIA_EAN13'', ''EXIBE O QRCODE COM DIGITO VERIFICADOR EAN13 AO INVES DO CODIGO DE BARRAS'', ''FALSE'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200427_1430__mantis19058.sql b/src/db/migration/migration/V20200427_1430__mantis19058.sql new file mode 100644 index 000000000..a969df0e9 --- /dev/null +++ b/src/db/migration/migration/V20200427_1430__mantis19058.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD TIEMPOMAXBOLETOENVENTA NUMBER(10)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200429_1030__mantis18913.sql b/src/db/migration/migration/V20200429_1030__mantis18913.sql new file mode 100644 index 000000000..4b9d5e731 --- /dev/null +++ b/src/db/migration/migration/V20200429_1030__mantis18913.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (CST_GRATUIDADE VARCHAR2(5))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200507_1810__mantis19163.sql b/src/db/migration/migration/V20200507_1810__mantis19163.sql new file mode 100644 index 000000000..bec9be8de --- /dev/null +++ b/src/db/migration/migration/V20200507_1810__mantis19163.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD INDQRCODECATRACARODEAN13 NUMBER(1, 0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update constante set activo = 0 where NOMBCONSTANTE = ''QRCODE_CATRACA_RODOVIARIA_EAN13'''; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200508_0959__mantis18913.sql b/src/db/migration/migration/V20200508_0959__mantis18913.sql new file mode 100644 index 000000000..fb7ce190b --- /dev/null +++ b/src/db/migration/migration/V20200508_0959__mantis18913.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update empresa set cst_gratuidade = ''CST40'' where cst_gratuidade is null'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200511_1506__mantis19139.sql b/src/db/migration/migration/V20200511_1506__mantis19139.sql new file mode 100644 index 000000000..087e7f4a1 --- /dev/null +++ b/src/db/migration/migration/V20200511_1506__mantis19139.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE USUARIO ADD (INDRETORNATODASLOCALIDADES NUMBER(1) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200511_1725__mantis19140.sql b/src/db/migration/migration/V20200511_1725__mantis19140.sql new file mode 100644 index 000000000..7b176801c --- /dev/null +++ b/src/db/migration/migration/V20200511_1725__mantis19140.sql @@ -0,0 +1,15 @@ +declare +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES(FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM > SEGURANCA > API'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.RECARREGARCACHELOCALIDADESAPI'', 1, NULL, 1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) VALUES +(CONSTANTE_seq.nextval,''URL_API'',''URL DA API'',''1'',NULL,1,1,null,1)'; + exception when others then null; +end; +/ + diff --git a/src/db/migration/migration/V20200520_0934__mantis19260.sql b/src/db/migration/migration/V20200520_0934__mantis19260.sql new file mode 100644 index 000000000..4a2b3bdb5 --- /dev/null +++ b/src/db/migration/migration/V20200520_0934__mantis19260.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA ADD (INDVENDEAPI NUMBER(1) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'UPDATE CATEGORIA SET INDVENDEAPI = 1 WHERE CATEGORIA_ID = 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200520_1516__mantis19315.sql b/src/db/migration/migration/V20200520_1516__mantis19315.sql new file mode 100644 index 000000000..2a3b110c6 --- /dev/null +++ b/src/db/migration/migration/V20200520_1516__mantis19315.sql @@ -0,0 +1,51 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA > PAYGO >> CONFIRMAR TRANSACAO PENDENTE'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUPAYGOCONFIRMACAOPENDENTE'', 1, + SYSDATE)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + +/ + +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA > PAYGO >> CANCELAR TRANSACAO PENDENTE'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUPAYGOCANCELARTRANSACAOPENDENTE'', 1, + SYSDATE)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + +/ + +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA > PAYGO >> REIMPRESSAO COMPROVANTE ULTIMA VENDA'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUPAYGOREIMPRESSAOULTIMAVENDA'', 1, + SYSDATE)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200602_0924__mantis19444.sql b/src/db/migration/migration/V20200602_0924__mantis19444.sql new file mode 100644 index 000000000..fd1aa7e24 --- /dev/null +++ b/src/db/migration/migration/V20200602_0924__mantis19444.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (QTDE_LIMITE_NAO_EMBARQUE NUMBER(5,0), INDCLIENTEPCD NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLIENTE ADD (FECBLOQUEIOPCD DATE, INDCLIENTEPCD NUMBER(1,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200602_1118__mantis19391.sql b/src/db/migration/migration/V20200602_1118__mantis19391.sql new file mode 100644 index 000000000..5d7b420e0 --- /dev/null +++ b/src/db/migration/migration/V20200602_1118__mantis19391.sql @@ -0,0 +1,25 @@ +declare + dup_val_on_index exception; + except_02291 exception; + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE PERFIL_FUNCION SET ACTIVO = 0 where FUNCIONSISTEMA_ID in ( SELECT FUNCIONSISTEMA_ID FROM FUNCION_SISTEMA where DESCRUTA like ''%MOVIMENTACIONBILHETES%'' )'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +--LIMPA O COLUNA +declare + dup_val_on_index exception; + except_02291 exception; + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE FUNCION_SISTEMA SET ACTIVO = 0 where DESCRUTA like ''%MOVIMENTACIONBILHETES%'' '; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + diff --git a/src/db/migration/migration/V20200604_1030__mantis19444.sql b/src/db/migration/migration/V20200604_1030__mantis19444.sql new file mode 100644 index 000000000..06410e2d8 --- /dev/null +++ b/src/db/migration/migration/V20200604_1030__mantis19444.sql @@ -0,0 +1,29 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CLIENTE_BLOQUEIO ( + CLIENTEBLOQUEIO_ID NUMBER(15,0) NOT NULL, + BOLETO_ID NUMBER(15) NULL, + CLIENTE_ID NUMBER(7) NULL, + CATEGORIA_ID NUMBER(7) NULL, + INDNAOEMBARQUE NUMBER(1) NULL, + QTDE_BLOQUEIO_NE NUMBER(5) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (CLIENTEBLOQUEIO_ID), + FOREIGN KEY (CATEGORIA_ID) REFERENCES CATEGORIA, + FOREIGN KEY (CLIENTE_ID) REFERENCES CLIENTE, + FOREIGN KEY (BOLETO_ID) REFERENCES BOLETO +)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE CLIENTE_BLOQUEIO_SEQ MINVALUE 1 MAXVALUE 999999999999999 INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200604_1035__mantis19403.sql b/src/db/migration/migration/V20200604_1035__mantis19403.sql new file mode 100644 index 000000000..ee3c821d9 --- /dev/null +++ b/src/db/migration/migration/V20200604_1035__mantis19403.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD INDPERMITETROCATRANSFERENCIA NUMBER(1) DEFAULT 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200608_0930__mantis17888.sql b/src/db/migration/migration/V20200608_0930__mantis17888.sql new file mode 100644 index 000000000..76cb24133 --- /dev/null +++ b/src/db/migration/migration/V20200608_0930__mantis17888.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDSEGUNDAVIAFECHAMENTOCAIXA NUMBER(1))'; + + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200608_1522__mantis19272.sql b/src/db/migration/migration/V20200608_1522__mantis19272.sql new file mode 100644 index 000000000..50d7c6cd6 --- /dev/null +++ b/src/db/migration/migration/V20200608_1522__mantis19272.sql @@ -0,0 +1,18 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIO >> FINANCEIRO >>> APROVEITAMENTO FINANCEIRO'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOAPROVEITAMENTOFINANCEIRO'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + diff --git a/src/db/migration/migration/V20200609_1514__mantis19496.sql b/src/db/migration/migration/V20200609_1514__mantis19496.sql new file mode 100644 index 000000000..2f592f5c3 --- /dev/null +++ b/src/db/migration/migration/V20200609_1514__mantis19496.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD (QTDE_LIMITE_TRANSF_REAT NUMBER(5,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200611_0923__mantis20890.sql b/src/db/migration/migration/V20200611_0923__mantis20890.sql new file mode 100644 index 000000000..12a6d7ea4 --- /dev/null +++ b/src/db/migration/migration/V20200611_0923__mantis20890.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE FORMA_PAGO SET CVESISTEMA = ''FORMA_PAGO_DEBITO'' WHERE FORMAPAGO_ID = 3'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200618_1035__mantis19536.sql b/src/db/migration/migration/V20200618_1035__mantis19536.sql new file mode 100644 index 000000000..17d780281 --- /dev/null +++ b/src/db/migration/migration/V20200618_1035__mantis19536.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD INDBLOQDEVOLVEREATIVAOUTROPTO NUMBER(1)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200622_1009__mantis13581.sql b/src/db/migration/migration/V20200622_1009__mantis13581.sql new file mode 100644 index 000000000..97bf8fc3b --- /dev/null +++ b/src/db/migration/migration/V20200622_1009__mantis13581.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION_SITEF ADD (SENHA_CONFIG VARCHAR(30))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200623_1706__mantis19616.sql b/src/db/migration/migration/V20200623_1706__mantis19616.sql new file mode 100644 index 000000000..5134f8037 --- /dev/null +++ b/src/db/migration/migration/V20200623_1706__mantis19616.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIOS > INTEGRACAO > QDMP - DER-PR'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOINTEGRACAODERPR'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200626_1448__mantis19569.sql b/src/db/migration/migration/V20200626_1448__mantis19569.sql new file mode 100644 index 000000000..1f3a41d31 --- /dev/null +++ b/src/db/migration/migration/V20200626_1448__mantis19569.sql @@ -0,0 +1,12 @@ +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE MD_CONTA MODIFY ORIGEM VARCHAR(10)'; + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200626_1618__mantis19569.sql b/src/db/migration/migration/V20200626_1618__mantis19569.sql new file mode 100644 index 000000000..eb0bbfd89 --- /dev/null +++ b/src/db/migration/migration/V20200626_1618__mantis19569.sql @@ -0,0 +1,8 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''TEE_ESTORNO_ELETRONICO_CARTAO'', ''INFORME ID TIPO EVENTO EXTRA SOLICITACAO ESTORNO CARTAO'', ''150'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''TEE_ESTORNO_ELETRONICO_CARTAO_J3'', ''INFORME ID TIPO EVENTO EXTRA SOLICITACAO ESTORNO CARTAO J3'', ''73'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200629_1706__mantis19617.sql b/src/db/migration/migration/V20200629_1706__mantis19617.sql new file mode 100644 index 000000000..f9ec74824 --- /dev/null +++ b/src/db/migration/migration/V20200629_1706__mantis19617.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIOS > RELATORIOS ESTATISTICOS > MMPH-DER'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOMMPHDER'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200701_1606__mantis19616.sql b/src/db/migration/migration/V20200701_1606__mantis19616.sql new file mode 100644 index 000000000..79e8531c3 --- /dev/null +++ b/src/db/migration/migration/V20200701_1606__mantis19616.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE RUTA_COMBINACION ADD CODIGODERPR VARCHAR(4) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200704_1605__mantis18935.sql b/src/db/migration/migration/V20200704_1605__mantis18935.sql new file mode 100644 index 000000000..986b5dd0d --- /dev/null +++ b/src/db/migration/migration/V20200704_1605__mantis18935.sql @@ -0,0 +1,57 @@ +--CRIA NOVA COLUNA +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARJETA_FIDELIDAD ADD (NUMTARJETA_BACKUP VARCHAR(30))'; + exception when column_exists then null; +end; +/ +-- COPIA OS VALORES +declare + dup_val_on_index exception; + except_02291 exception; + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE TARJETA_FIDELIDAD SET NUMTARJETA_BACKUP = NUMTARJETA'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +--LIMPA O COLUNA +declare + dup_val_on_index exception; + except_02291 exception; + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE TARJETA_FIDELIDAD SET NUMTARJETA = NULL'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +--ALTERA A COLUNA +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE TARJETA_FIDELIDAD MODIFY (NUMTARJETA VARCHAR(30))'; + exception when column_exists then null; +end; +/ +--ATUALIZA A COLUNA ANTIGA COM OS VALORES DA NOVA +declare + dup_val_on_index exception; + except_02291 exception; + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE TARJETA_FIDELIDAD SET NUMTARJETA = NUMTARJETA_BACKUP'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20200706_0932__mantis19684.sql b/src/db/migration/migration/V20200706_0932__mantis19684.sql new file mode 100644 index 000000000..9567d6c1f --- /dev/null +++ b/src/db/migration/migration/V20200706_0932__mantis19684.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE PRECIO_VENTAJA ADD INDCLASSEAPROVEITAMENTO NUMBER(1,0) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200706_1412__mantis19617.sql b/src/db/migration/migration/V20200706_1412__mantis19617.sql new file mode 100644 index 000000000..630e8c2f3 --- /dev/null +++ b/src/db/migration/migration/V20200706_1412__mantis19617.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD CODDER NUMBER(4) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200708_0954__mantis20082.sql b/src/db/migration/migration/V20200708_0954__mantis20082.sql new file mode 100644 index 000000000..52e9510d2 --- /dev/null +++ b/src/db/migration/migration/V20200708_0954__mantis20082.sql @@ -0,0 +1,35 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD INDVOUCHERRODOVIARIA NUMBER(1,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE SECRETARIA ADD FORMAPAGO_ID NUMBER(7,0)'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE SECRETARIA ADD CONSTRAINT FORMAPAGO_ID_FK FOREIGN KEY(FORMAPAGO_ID)REFERENCES FORMA_PAGO(FORMAPAGO_ID)'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; + diff --git a/src/db/migration/migration/V20200710_1501__mantis19537.sql b/src/db/migration/migration/V20200710_1501__mantis19537.sql new file mode 100644 index 000000000..8f07357af --- /dev/null +++ b/src/db/migration/migration/V20200710_1501__mantis19537.sql @@ -0,0 +1,21 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TIEMPOLIMITE_MIN NUMBER(5,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TIEMPOLIMITECAMBIO_MIN NUMBER(5,0)'; + exception when column_exists then null; +end; + + + + + + diff --git a/src/db/migration/migration/V20200715_1038__mantis19537.sql b/src/db/migration/migration/V20200715_1038__mantis19537.sql new file mode 100644 index 000000000..75f7eae6d --- /dev/null +++ b/src/db/migration/migration/V20200715_1038__mantis19537.sql @@ -0,0 +1,48 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TEMPOLIMITE_APOS_SAIDA_H NUMBER(5,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TEMPOLIMITE_APOS_SAIDA_MIN NUMBER(5,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TROCA_MESMO_DIA_ANTES_H NUMBER(5,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TROCA_MESMO_DIA_ANTES_MIN NUMBER(5,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TROCA_MESMO_DIA_APOS_H NUMBER(5,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TROCA_MESMO_DIA_APOS_MIN NUMBER(5,0)'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20200722_0949__mantis19537.sql b/src/db/migration/migration/V20200722_0949__mantis19537.sql new file mode 100644 index 000000000..e0af45f4a --- /dev/null +++ b/src/db/migration/migration/V20200722_0949__mantis19537.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TEMPO_TROCA_POLTRONA_H NUMBER(5,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD TEMPO_TROCA_POLTRONA_MIN NUMBER(5,0)'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20200722_1553__mantis19698.sql b/src/db/migration/migration/V20200722_1553__mantis19698.sql new file mode 100644 index 000000000..335de7769 --- /dev/null +++ b/src/db/migration/migration/V20200722_1553__mantis19698.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 2, ''VDA > RECEITA/DESPESA > RECARGA CELULAR'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENURECARGACELULAR'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200723_1004__mantis19946.sql b/src/db/migration/migration/V20200723_1004__mantis19946.sql new file mode 100644 index 000000000..b9702b772 --- /dev/null +++ b/src/db/migration/migration/V20200723_1004__mantis19946.sql @@ -0,0 +1,5 @@ +declare +begin + RESET_SEQUENCE_TO_DATA('CONSTANTE','CONSTANTE_ID'); + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200724_1137__mantis13581.sql b/src/db/migration/migration/V20200724_1137__mantis13581.sql new file mode 100644 index 000000000..5363aae9f --- /dev/null +++ b/src/db/migration/migration/V20200724_1137__mantis13581.sql @@ -0,0 +1,33 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA > GRANITO >> CANCELAR TRANSACAO'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUGRANITOCANCELARTRANSACAO'', 1, + SYSDATE, 1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + +/ + +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA > GRANITO >> REIMPRESSAO COMPROVANTE'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUGRANITOREIMPRESSAO'', 1, + SYSDATE, 1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200727_0954__mantis19805.sql b/src/db/migration/migration/V20200727_0954__mantis19805.sql new file mode 100644 index 000000000..4dfa56a2f --- /dev/null +++ b/src/db/migration/migration/V20200727_0954__mantis19805.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD INDESTORNO NUMBER(1,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'update forma_pago set indestorno = 1 where formapago_id in (2, 3)'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20200728_1045__mantis19697.sql b/src/db/migration/migration/V20200728_1045__mantis19697.sql new file mode 100644 index 000000000..0773d5f7b --- /dev/null +++ b/src/db/migration/migration/V20200728_1045__mantis19697.sql @@ -0,0 +1,49 @@ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''RV_HUB_PRODUCAO'', ''INFORMA SE E PRODUCAO OU HOMOLOGACAO API RV RUB'', ''FALSE'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''RV_HUB_CLIENT_ID'', ''CLIENT ID DA API RV RUB'', ''5fst8o0ahst927shl8mjuscog9'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''RV_HUB_CLIENT_SECRET'', ''CLIENT SECRET DA API RV RUB'', ''9fja8uoe7s3l2o8ts5hk00qf61f093cv8rrvdkblk4du962cn1k'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''RV_HUB_URL_AUTENTICACAO_API_HOMOLOGACAO'', ''URL AUTENTICACAO API RV HUB HOMOLOGACAO'', ''https://auth.sbx.rvhub.com.br'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''RV_HUB_URL_API_HOMOLOGACAO'', ''URL API RV HUB HOMOLOGACAO'', ''https://api.sbx.rvhub.com.br'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''RV_HUB_URL_API_PRODUCAO'', ''URL API RV HUB PRODUCAO'', ''https://api.sbx.rvhub.com.br'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''RV_HUB_URL_AUTENTICACAO_API_PRODUCAO'', ''URL AUTENTICACAO API RV HUB PRODUCAO'', ''https://auth.sbx.rvhub.com.br'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20200730_1627__mantis19805.sql b/src/db/migration/migration/V20200730_1627__mantis19805.sql new file mode 100644 index 000000000..5fa5741a5 --- /dev/null +++ b/src/db/migration/migration/V20200730_1627__mantis19805.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE DADOS_ESTORNO_CARTAO ADD FORMAPAGO_ID NUMBER(7,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE DADOS_ESTORNO_CARTAO ADD PONTO_VENDA_BOLETO_ID NUMBER(7,0)'; + exception when column_exists then null; +end; + diff --git a/src/db/migration/migration/V20200806_1437__mantis19632.sql b/src/db/migration/migration/V20200806_1437__mantis19632.sql new file mode 100644 index 000000000..a8381999b --- /dev/null +++ b/src/db/migration/migration/V20200806_1437__mantis19632.sql @@ -0,0 +1,18 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIO >> FINANCEIRO >>> CAIXA ORGAO CONCEDENTE'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOCAIXAIRGACOCONCEDENTE'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + diff --git a/src/db/migration/migration/V20200807_1718__mantis19698.sql b/src/db/migration/migration/V20200807_1718__mantis19698.sql new file mode 100644 index 000000000..0c9aba05d --- /dev/null +++ b/src/db/migration/migration/V20200807_1718__mantis19698.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into TIPO_EVENTO_EXTRA (TIPOEVENTOEXTRA_ID,INDTIPO,IMPMAX,INDVALIDACORTE,INDVALIDADOCUMENTO,INDCONTRAPARTIDA,INDBOLETO,INDORDENSERVICIO,PORCIVA,FORMAPAGO_ID,USUARIO_ID,FECMODIF,ACTIVO,PARAMARTICULO2_ID,INDTIPO2,FORMAPAGO2_ID,INDOPERACION,DESCTIPOEVENTO,PROVEEDOR,IMPFISCALNUMOPERACAO,NATUREZA,CONTACONTABIL,INDCONFERENCIAFISICACOMISSAO,INDVALIDAESTOQUE,CVETIPOEVENTO,CVESISTEMA,INTEGRADOTOTVS,ERRO) + values (99997,''1'',99999.99,null,''0'',null,''0'',null,''0'',null,''1'',sysdate,''1'',null,null,null,''1'',''RECARGA CELULAR'',null,null,null,null,null,null,''RECARGA_CELULAR'',''RECARGA_CELULAR'',null,null)'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200810_1031__mantis19698.sql b/src/db/migration/migration/V20200810_1031__mantis19698.sql new file mode 100644 index 000000000..0a1a12fb3 --- /dev/null +++ b/src/db/migration/migration/V20200810_1031__mantis19698.sql @@ -0,0 +1,15 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.nextval,''URL_RECARGA_CELULAR'',''URL_RECARGA_CELULAR'',null,''http://54.198.166.145/API-GATEWAY/EXTERNORVHUB'',1,1,sysdate,1)'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.nextval,''CREDENCIAIS_RECARGA_CELULAR'',''CREDENCIAIS_RECARGA_CELULAR'',null,null,1,1,sysdate,1)'; + exception when others then null; +end; +/ + diff --git a/src/db/migration/migration/V20200811_0955__mantis19698.sql b/src/db/migration/migration/V20200811_0955__mantis19698.sql new file mode 100644 index 000000000..8f3392623 --- /dev/null +++ b/src/db/migration/migration/V20200811_0955__mantis19698.sql @@ -0,0 +1,38 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE RECARGA_CELULAR ( + RECARGACELULAR_ID NUMBER(15) NOT NULL, + EVENTOEXTRA_ID NUMBER(10) NOT NULL, + UUID VARCHAR2(50) NULL, + RVHUB_ID VARCHAR2(50) NOT NULL, + PRODUCT_ID NUMBER(15) NULL, + AREA_CODE NUMBER(3) NULL, + CELL_PHONE_NUMBER VARCHAR2(20) NOT NULL, + STATUS VARCHAR2(20) NOT NULL, + CREATED_AT DATE NULL, + UPDATED_AT DATE NULL, + NSU VARCHAR2(20) NOT NULL, + AUTHORIZATION_CODE VARCHAR2(20) NOT NULL, + FACE_AMOUNT NUMBER(7,2) NOT NULL, + DUE_DATE DATE NULL, + MESSAGE VARCHAR2(500) NULL, + AUTHORIZED_AT DATE NULL, + STATUSES VARCHAR2(500) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (RECARGACELULAR_ID), + FOREIGN KEY (EVENTOEXTRA_ID) REFERENCES EVENTO_EXTRA +)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE RECARGA_CELULAR_SEQ MINVALUE 1 MAXVALUE 999999999999999 INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200811_1108__mantis17367.sql b/src/db/migration/migration/V20200811_1108__mantis17367.sql new file mode 100644 index 000000000..37686f613 --- /dev/null +++ b/src/db/migration/migration/V20200811_1108__mantis17367.sql @@ -0,0 +1,26 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS ADD (NUMSERIE_BPE VARCHAR(3), NUM_BPE VARCHAR(9), BPE_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS ADD CONSTRAINT BPE_ID_FK FOREIGN KEY(BPE_ID) REFERENCES BPE(BPE_ID)'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200818_1118__mantis19904.sql b/src/db/migration/migration/V20200818_1118__mantis19904.sql new file mode 100644 index 000000000..b67cd476d --- /dev/null +++ b/src/db/migration/migration/V20200818_1118__mantis19904.sql @@ -0,0 +1,29 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE BPE_CONT_AUTOMATICA ( + BPECONTAUTOMATICA_ID NUMBER(7) NOT NULL, + EMPRESA_ID NUMBER(7) NULL, + ESTADO_ID NUMBER(7) NULL, + QTDE_TIMEOUT NUMBER(7) NULL, + DT_SAIDA DATE NULL, + TIPOAMB NUMBER(1) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (BPECONTAUTOMATICA_ID), + FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE BPE_CONT_AUTOMATICA_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20200826_1715__mantis20278.sql b/src/db/migration/migration/V20200826_1715__mantis20278.sql new file mode 100644 index 000000000..3a06fc049 --- /dev/null +++ b/src/db/migration/migration/V20200826_1715__mantis20278.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (ASIENTOSRESERVADOS VARCHAR2(100 BYTE))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200828_1115__ebus48.sql b/src/db/migration/migration/V20200828_1115__ebus48.sql new file mode 100644 index 000000000..b8064ac60 --- /dev/null +++ b/src/db/migration/migration/V20200828_1115__ebus48.sql @@ -0,0 +1,32 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLIENTE ADD LOGIN VARCHAR2(45)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLIENTE ADD OPT_IN NUMBER(1,0) DEFAULT 0' ; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLIENTE ADD IND_CADASTRO_API NUMBER (1,0) DEFAULT 0' ; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLIENTE ADD PAYMENTTOKEN VARCHAR2(45)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20200903_1342__mantis20145.sql b/src/db/migration/migration/V20200903_1342__mantis20145.sql new file mode 100644 index 000000000..bfbf65f14 --- /dev/null +++ b/src/db/migration/migration/V20200903_1342__mantis20145.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''URL_PAINEL_EMBARCADA'',''URL PAINEL EMBARCADA'',''1'',''2'',''1'',''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20200903_1745__mantis20145.sql b/src/db/migration/migration/V20200903_1745__mantis20145.sql new file mode 100644 index 000000000..b7f7bad32 --- /dev/null +++ b/src/db/migration/migration/V20200903_1745__mantis20145.sql @@ -0,0 +1,18 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 1, ''ADM > SEGURANCA >> PAINEL VENDA EMBARCADA'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.PAINELVENDAEMBARCADA'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + diff --git a/src/db/migration/migration/V20200910_1632__mantis20284.sql b/src/db/migration/migration/V20200910_1632__mantis20284.sql new file mode 100644 index 000000000..4dd7e4d50 --- /dev/null +++ b/src/db/migration/migration/V20200910_1632__mantis20284.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM > SEGURANCA > CUSTOMIZACAO SISTEMA >> UPLOAD ARQUIVO CONFIGURACAO'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.CUSTOMSISTEMA.UPLOADARQUIVOCONFIGURACAO'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200911_1437__mantis20115.sql b/src/db/migration/migration/V20200911_1437__mantis20115.sql new file mode 100644 index 000000000..b438f88b8 --- /dev/null +++ b/src/db/migration/migration/V20200911_1437__mantis20115.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD (TIPO_CARTEIRA_DIGITAL VARCHAR(20))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update FORMA_PAGO set TIPO_CARTEIRA_DIGITAL = ''TROCO_SIMPLES'' where TIPO_PAGO = 12 and TIPO_CARTEIRA_DIGITAL is null'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200912_1033__mantis19878.sql b/src/db/migration/migration/V20200912_1033__mantis19878.sql new file mode 100644 index 000000000..773f3da39 --- /dev/null +++ b/src/db/migration/migration/V20200912_1033__mantis19878.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE PRICING ADD INDOCUPACAOPORTRECHO NUMBER(1,0) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200914_1800__mantis20374.sql b/src/db/migration/migration/V20200914_1800__mantis20374.sql new file mode 100644 index 000000000..8978100ff --- /dev/null +++ b/src/db/migration/migration/V20200914_1800__mantis20374.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDEXIGEBPEEXCESSOBAGAGEM NUMBER(1,0) DEFAULT 0 NOT NULL)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200915_1448__mantis20346.sql b/src/db/migration/migration/V20200915_1448__mantis20346.sql new file mode 100644 index 000000000..bd64356b1 --- /dev/null +++ b/src/db/migration/migration/V20200915_1448__mantis20346.sql @@ -0,0 +1,86 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CONF_REST_ORGAOCONCEDENTE ( + CONFRESTORGAOCONCEDENTE_ID NUMBER(15, 0) NOT NULL, + ORGAOCONCEDENTE_ID NUMBER(7, 0) NOT NULL, + CONFRESTRICAOCANALVENTA_ID NUMBER(15, 0) NOT NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (CONFRESTORGAOCONCEDENTE_ID), + CONSTRAINT "FK_CONFRESTCANALVENTAID" FOREIGN KEY ("CONFRESTRICAOCANALVENTA_ID") + REFERENCES CONF_RESTRICAO_CANALVENTA ("CONFRESTRICAOCANALVENTA_ID") ENABLE, + CONSTRAINT "FK_CONFRESORGAOCONCEDENTE" FOREIGN KEY ("ORGAOCONCEDENTE_ID") + REFERENCES ORGAO_CONCEDENTE ("ORGAOCONCEDENTE_ID") ENABLE )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONF_REST_ORGAOCONCEDENTE_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CONF_REST_RUTAS ( + CONFRESTRUTAS_ID NUMBER(15, 0) NOT NULL, + RUTA_ID NUMBER(7, 0) NOT NULL, + CONFRESTRICAOCANALVENTA_ID NUMBER(15, 0) NOT NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (CONFRESTRUTAS_ID), + CONSTRAINT "FK_CONFRESTRUTASID" FOREIGN KEY ("CONFRESTRICAOCANALVENTA_ID") + REFERENCES CONF_RESTRICAO_CANALVENTA ("CONFRESTRICAOCANALVENTA_ID") ENABLE, + CONSTRAINT "FK_CONFRESRUTAS" FOREIGN KEY ("RUTA_ID") + REFERENCES RUTA ("RUTA_ID") ENABLE )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONF_REST_RUTAS_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CONF_REST_TRAMOOC ( + CONFRESTTRAMOOC_ID NUMBER(15, 0) NOT NULL, + ORIGEM_ID NUMBER(7, 0) NOT NULL, + DESTINO_ID NUMBER(7, 0) NOT NULL, + CONFRESTRICAOCANALVENTA_ID NUMBER(15, 0) NOT NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + USUARIO_ID NUMBER(7) NULL, + PRIMARY KEY (CONFRESTTRAMOOC_ID), + CONSTRAINT "FK_CONFRESTRAMOOCID" FOREIGN KEY ("CONFRESTRICAOCANALVENTA_ID") + REFERENCES CONF_RESTRICAO_CANALVENTA ("CONFRESTRICAOCANALVENTA_ID") ENABLE, + CONSTRAINT "FK_CONFRESTRAMOORIGEMOC" FOREIGN KEY ("ORIGEM_ID") + REFERENCES PARADA ("PARADA_ID") ENABLE, + CONSTRAINT "FK_CONFRESTRAMODESTINOOC" FOREIGN KEY ("DESTINO_ID") + REFERENCES PARADA ("PARADA_ID") ENABLE )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONF_REST_TRAMOOC_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200917_0919__mantis20115.sql b/src/db/migration/migration/V20200917_0919__mantis20115.sql new file mode 100644 index 000000000..3cd2659e9 --- /dev/null +++ b/src/db/migration/migration/V20200917_0919__mantis20115.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_TARJETA ADD (CARTEIRA_DIGITAL VARCHAR(50))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200918_0827__mantis20115.sql b/src/db/migration/migration/V20200918_0827__mantis20115.sql new file mode 100644 index 000000000..73e9c8aec --- /dev/null +++ b/src/db/migration/migration/V20200918_0827__mantis20115.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESTACION ADD (INDEXIBEQRCODEPINPAD NUMBER(1))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200922_1050__mantis20466.sql b/src/db/migration/migration/V20200922_1050__mantis20466.sql new file mode 100644 index 000000000..587719009 --- /dev/null +++ b/src/db/migration/migration/V20200922_1050__mantis20466.sql @@ -0,0 +1,12 @@ +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE CLASE_SERVICIO MODIFY TIPOSERVICOBPE NUMBER(2)'; + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200922_1226__mantis20116.sql b/src/db/migration/migration/V20200922_1226__mantis20116.sql new file mode 100644 index 000000000..8f5da8b3d --- /dev/null +++ b/src/db/migration/migration/V20200922_1226__mantis20116.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD INDTRANSFERENCIAREATIVACAO NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20200929_1500__mantis20523.sql b/src/db/migration/migration/V20200929_1500__mantis20523.sql new file mode 100644 index 000000000..d07cf1d03 --- /dev/null +++ b/src/db/migration/migration/V20200929_1500__mantis20523.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD TIPOEVENTOEXTRA_ID NUMBER(7,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'UPDATE CONSTANTE SET ACTIVO = 0 WHERE NOMBCONSTANTE LIKE ''TEE_ESTORNO_ELETRONICO_CARTAO'''; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20201002_1731__mantis20609.sql b/src/db/migration/migration/V20201002_1731__mantis20609.sql new file mode 100644 index 000000000..64a84ebf1 --- /dev/null +++ b/src/db/migration/migration/V20201002_1731__mantis20609.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE_CTRL_DISPONIBILIDADE MODIFY BPE_REJEITADO_ID NUMBER(12)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_DIVERSOS MODIFY BPE_ID NUMBER(12)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201020_0954__mantis20203.sql b/src/db/migration/migration/V20201020_0954__mantis20203.sql new file mode 100644 index 000000000..f9fc9e71b --- /dev/null +++ b/src/db/migration/migration/V20201020_0954__mantis20203.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_COMISSAO ADD COMISSAOIMPPOSTERIOR VARCHAR(20)'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update PTOVTA_COMISSAO set COMISSAOIMPPOSTERIOR = ''PADRAO'' where COMISSAOIMPPOSTERIOR is null'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201020_1138__mantis20203.sql b/src/db/migration/migration/V20201020_1138__mantis20203.sql new file mode 100644 index 000000000..ff2e1e2b3 --- /dev/null +++ b/src/db/migration/migration/V20201020_1138__mantis20203.sql @@ -0,0 +1,10 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_COMISSAO ADD (VALOR_IMP_GAP_COMP NUMBER(5,2), + VALOR_IMP_GAP_ALTA_COMP NUMBER(5,2), + VALOR_VENDA_GAP_COMP NUMBER(5,2), + VALOR_VENDA_GAP_ALTA_COMP NUMBER(5,2))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201020_1140__mantis20656.sql b/src/db/migration/migration/V20201020_1140__mantis20656.sql new file mode 100644 index 000000000..209b9ee1c --- /dev/null +++ b/src/db/migration/migration/V20201020_1140__mantis20656.sql @@ -0,0 +1,96 @@ +declare + object_exists exception; + except_00904 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00904 , -00904); +begin + execute immediate 'ALTER TABLE EMPRESA drop column INDPRECIOPORDEMANDA'; + exception + when object_exists then null; + when except_00904 then null; +end; +/ +declare +begin + execute immediate 'update constante set activo = 0 where NOMBCONSTANTE = ''PERIODICIDADE_PORDEMANDA'''; + exception when others then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE RUTA ADD INDPRECIOPORDEMANDA NUMBER(1,0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE TARIFA_DEMANDA_SEQ INCREMENT BY 1 START WITH 1 NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE TARIFA_DEMANDA ( + TARIFADEMANDA_ID NUMBER(15,0) NOT NULL, + PRECIO NUMBER(10,2), + TRAMO_ID NUMBER(7,0), + MARCA_ID NUMBER(3,0) NOT NULL, + CLASESERVICIO_ID NUMBER(2,0), + PRECIOORIGINAL NUMBER(10,2), + CATEGORIAS VARCHAR2(255 BYTE), + PUNTOVENTAS VARCHAR2(255 BYTE), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + FECINICIO DATE, + FECFIM DATE, + USUARIO_ID NUMBER(7,0), + IMPORTETAXAEMBARQUE NUMBER(7,2), + IMPORTEPEDAGIO NUMBER(7,2), + IMPORTEOUTROS NUMBER(7,2), + IMPORTESEGURO NUMBER(7,2), + ORGAOCONCEDENTE_ID NUMBER(7,2), + RUTA_ID NUMBER(7,0) NOT NULL, + ORIGEN_ID NUMBER(7,0) NOT NULL, + DESTINO_ID NUMBER(7,0) NOT NULL, + IMPORTETPP NUMBER(7,2), + PRIMARY KEY (TARIFADEMANDA_ID), + FOREIGN KEY (TRAMO_ID) REFERENCES TRAMO, + FOREIGN KEY (MARCA_ID) REFERENCES MARCA, + FOREIGN KEY (CLASESERVICIO_ID) REFERENCES CLASE_SERVICIO, + FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE, + FOREIGN KEY (RUTA_ID) REFERENCES RUTA, + FOREIGN KEY (ORIGEN_ID) REFERENCES PARADA, + FOREIGN KEY (DESTINO_ID) REFERENCES PARADA)'; + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA ADD FECINIPRECIODEMANDA DATE'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA ADD FECFIMPRECIODEMANDA DATE'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201020_1601__mantis20288.sql b/src/db/migration/migration/V20201020_1601__mantis20288.sql new file mode 100644 index 000000000..1675b47f0 --- /dev/null +++ b/src/db/migration/migration/V20201020_1601__mantis20288.sql @@ -0,0 +1,24 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE TAXPOLPUNTOVENTA_PK MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE TAXPOL_PUNTOVENTA + (TAXPOLPUNTOVENTA_ID NUMBER(7,0) NOT NULL ENABLE, + PUNTOVENTA_ID NUMBER(7,0), + INDREIMPRESSAO NUMBER(1,0), + FECMODIF DATE, + ACTIVO NUMBER(1,0), + CONSTRAINT TAXPOLPUNTOVENTA_PK PRIMARY KEY (TAXPOLPUNTOVENTA_ID) ENABLE, + FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) ON DELETE SET NULL ENABLE)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201023_1512__mantis20410.sql b/src/db/migration/migration/V20201023_1512__mantis20410.sql new file mode 100644 index 000000000..02bba0e82 --- /dev/null +++ b/src/db/migration/migration/V20201023_1512__mantis20410.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD URLBASESEGURO VARCHAR2(50)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201023_1615__mantis20410.sql b/src/db/migration/migration/V20201023_1615__mantis20410.sql new file mode 100644 index 000000000..cc904c8d7 --- /dev/null +++ b/src/db/migration/migration/V20201023_1615__mantis20410.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) values (CONSTANTE_SEQ.NEXTVAL,''CHAVE_CRIPTOGRAFIA_SEGURO_W2I'',''CHAVE CRIPTOGRAFIA SEGURO W2I 16 BYTES'',''1'',''2'',''1'',''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20201027_0906__mantis20776.sql b/src/db/migration/migration/V20201027_0906__mantis20776.sql new file mode 100644 index 000000000..831bd7520 --- /dev/null +++ b/src/db/migration/migration/V20201027_0906__mantis20776.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM > SEGURANCA > CONSULTA LOG'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.LOGAUDITORIA'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201027_1435__mantis20776.sql b/src/db/migration/migration/V20201027_1435__mantis20776.sql new file mode 100644 index 000000000..1aa4af913 --- /dev/null +++ b/src/db/migration/migration/V20201027_1435__mantis20776.sql @@ -0,0 +1,33 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE LOG_AUDITORIA ( + LOGAUDITORIA_ID NUMBER(15) NOT NULL, + EMPRESA_ID NUMBER(7) NULL, + VALOR_ANTERIOR VARCHAR2(100) NULL, + USUARIO_ID NUMBER(7) NULL, + VALOR_NOVO VARCHAR2(100) NULL, + CAMPO_ALTERADO VARCHAR2(100) NULL, + CLASSE_ALTERADA VARCHAR2(100) NULL, + CLASSE_PRINCIPAL VARCHAR2(100) NULL, + TELA VARCHAR2(100) NULL, + TIPO_ALTERACAO VARCHAR2(20) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + PRIMARY KEY (LOGAUDITORIA_ID), + FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO, + FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE LOG_AUDITORIA_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20201028_1525__mantis20288.sql b/src/db/migration/migration/V20201028_1525__mantis20288.sql new file mode 100644 index 000000000..efab29f41 --- /dev/null +++ b/src/db/migration/migration/V20201028_1525__mantis20288.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CUSTOM (CUSTOM_ID, SISTEMA, CHAVE, VALOR, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CUSTOM_SEQ.nextval, 2, ''isBloqueiaReimpressaoPontoVendaW2i'', ''false'', 1, sysdate, 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201102_1545__mantis20776.sql b/src/db/migration/migration/V20201102_1545__mantis20776.sql new file mode 100644 index 000000000..801efe110 --- /dev/null +++ b/src/db/migration/migration/V20201102_1545__mantis20776.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_AUDITORIA ADD (ID_AUDITADO NUMBER(15))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201105_2214__mantis20776.sql b/src/db/migration/migration/V20201105_2214__mantis20776.sql new file mode 100644 index 000000000..73b44e1b5 --- /dev/null +++ b/src/db/migration/migration/V20201105_2214__mantis20776.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_AUDITORIA MODIFY (VALOR_NOVO VARCHAR(300), VALOR_ANTERIOR VARCHAR(300))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201109_1834__mantis20931.sql b/src/db/migration/migration/V20201109_1834__mantis20931.sql new file mode 100644 index 000000000..faa4e62bc --- /dev/null +++ b/src/db/migration/migration/V20201109_1834__mantis20931.sql @@ -0,0 +1,8 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.nextval,''isTarifaMinimaHabilitado'',''isTarifaMinimaHabilitado'',null,''false'',1,1,sysdate,1)'; + exception when others then null; +end; +/ + diff --git a/src/db/migration/migration/V20201112_1521__mantis20961.sql b/src/db/migration/migration/V20201112_1521__mantis20961.sql new file mode 100644 index 000000000..cb7908f3c --- /dev/null +++ b/src/db/migration/migration/V20201112_1521__mantis20961.sql @@ -0,0 +1,18 @@ +DECLARE + VALOR VARCHAR2(500 BYTE); + ATIVO NUMBER(1,0); +BEGIN + SELECT VALORCONSTANTE, ACTIVO INTO VALOR, ATIVO + FROM CONSTANTE + WHERE NOMBCONSTANTE LIKE 'CONEXAO_FIXA' ; + + IF ATIVO = 0 THEN + EXECUTE IMMEDIATE 'UPDATE CONSTANTE SET ACTIVO = 1, VALORCONSTANTE = ''FALSE'' WHERE NOMBCONSTANTE LIKE ''CONEXAO_FIXA'' '; + ELSIF VALOR = 'TRUE' OR VALOR = 'true' THEN + EXECUTE IMMEDIATE 'UPDATE CONSTANTE SET ACTIVO = 0 WHERE NOMBCONSTANTE LIKE ''CONEXAO_FIXA'' '; + END IF; + + EXCEPTION WHEN NO_DATA_FOUND THEN + EXECUTE IMMEDIATE 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.nextval ,''CONEXAO_FIXA'',''HABILITA PESQUISA DE CONEXAO FIXA'',null,''FALSE'',''1'',''1'', SYSDATE, -1)'; +END; \ No newline at end of file diff --git a/src/db/migration/migration/V20201114_1836__mantis20778.sql b/src/db/migration/migration/V20201114_1836__mantis20778.sql new file mode 100644 index 000000000..5ad8a112f --- /dev/null +++ b/src/db/migration/migration/V20201114_1836__mantis20778.sql @@ -0,0 +1,37 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE LOG_AUDITORIA ADD ID_AUDITADO_AUX NUMBER(15)'; + exception when column_exists then null; +end; +/ +declare +begin + execute immediate 'UPDATE LOG_AUDITORIA SET ID_AUDITADO_AUX = ID_AUDITADO'; + exception when others then null; +end; +/ +declare +begin + execute immediate 'UPDATE LOG_AUDITORIA SET ID_AUDITADO = NULL'; + exception when others then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE LOG_AUDITORIA MODIFY ID_AUDITADO VARCHAR2(100)'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ +declare +begin + execute immediate 'UPDATE LOG_AUDITORIA SET ID_AUDITADO = ID_AUDITADO_AUX'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201125_0847__mantis20923.sql b/src/db/migration/migration/V20201125_0847__mantis20923.sql new file mode 100644 index 000000000..0a6faec09 --- /dev/null +++ b/src/db/migration/migration/V20201125_0847__mantis20923.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''EXIGE_EMAIL_OU_TEL_CAD_CLIENTE'', ''EXIGE EMAIL OU TELEFONE NO CADASTRO DO CLIENTE'', ''FALSE'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201125_1432__mantis21087.sql b/src/db/migration/migration/V20201125_1432__mantis21087.sql new file mode 100644 index 000000000..b44d7cb1b --- /dev/null +++ b/src/db/migration/migration/V20201125_1432__mantis21087.sql @@ -0,0 +1,11 @@ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE ESTACION_SITEF MODIFY NUMEMPRESA VARCHAR2(30)'; + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201128_1435__mantis20477.sql b/src/db/migration/migration/V20201128_1435__mantis20477.sql new file mode 100644 index 000000000..de929989e --- /dev/null +++ b/src/db/migration/migration/V20201128_1435__mantis20477.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE EMBARCADA_DISP_OPERADOR ( + EMBARCADADISPOPERADOR_ID NUMBER(15) NOT NULL, + DISPOSITIVOEMBARCADA_ID NUMBER(7) NOT NULL, + PUNTOVENTA_ID NUMBER(15) NOT NULL, + USUARIO_ID NUMBER(7) NULL, + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + PRIMARY KEY (EMBARCADADISPOPERADOR_ID), + FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO, + FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA, + FOREIGN KEY (DISPOSITIVOEMBARCADA_ID) REFERENCES DISPOSITIVO_EMBARCADA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE EMBARCADADISPOPERADOR_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20201130_1500__clientedetalhes.sql b/src/db/migration/migration/V20201130_1500__clientedetalhes.sql new file mode 100644 index 000000000..923f314fe --- /dev/null +++ b/src/db/migration/migration/V20201130_1500__clientedetalhes.sql @@ -0,0 +1,27 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CLIENTE_DETALHES ( + CLIENTEDETALHES_ID NUMBER(15) NOT NULL, + CLIENTE_ID NUMBER(15) NOT NULL, + APPLE_ID VARCHAR2(20), + FACEBOOK_ID VARCHAR2(20), + GOOGLE_ID VARCHAR2(20), + ACTIVO NUMBER(1) NULL, + FECMODIF DATE NULL, + PRIMARY KEY (CLIENTEDETALHES_ID), + FOREIGN KEY (CLIENTE_ID) REFERENCES CLIENTE + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CLIENTEDETALHES_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201130_1520__mantis20477.sql b/src/db/migration/migration/V20201130_1520__mantis20477.sql new file mode 100644 index 000000000..6ea6489bc --- /dev/null +++ b/src/db/migration/migration/V20201130_1520__mantis20477.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > ESQUEMA OPERACIONAL > CONFIGURACAO VENDA EMBARCADA > OPERADORES DISP'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.CONFVENDAEMBARCADA.OPERADORESDISP'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201203_1036__mantis21048.sql b/src/db/migration/migration/V20201203_1036__mantis21048.sql new file mode 100644 index 000000000..1168a56c6 --- /dev/null +++ b/src/db/migration/migration/V20201203_1036__mantis21048.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD CODCONTPREVIDENCIA VARCHAR(8)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201211_2015__jira166.sql b/src/db/migration/migration/V20201211_2015__jira166.sql new file mode 100644 index 000000000..02886e455 --- /dev/null +++ b/src/db/migration/migration/V20201211_2015__jira166.sql @@ -0,0 +1,95 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (STATUS VARCHAR2(2) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (INDCUPOMDESCONTO NUMBER(1) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (DESCUENTOPORCENTAJEVOLTA NUMBER(7,2) ) '; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING_IMPORTE ADD (DESCUENTOPORCENTAJEVOLTA NUMBER(7,2) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING_IMPORTE ADD (DESCUENTOPORCREDONDO NUMBER(7,2) )'; + exception when column_exists then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.NEXTVAL, ''1'', ''EBUS > PRICING ESPECIALISTA'', ''COM.RJCONSULTORES.EBUS.GUI.PRICING.ESPECIALISTA'', ''1'', ''1'')'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, USUARIO_ID) VALUES (FUNCION_SISTEMA_SEQ.NEXTVAL, ''1'', ''EBUS > PRICING GESTOR'', ''COM.RJCONSULTORES.EBUS.GUI.PRICING.GESTOR'', ''1'', ''1'')'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE gestao_operador ( + gestaooperador_id NUMBER(7) NOT NULL, + usuario_id NUMBER(7), + porcentaje NUMBER(7, 2), + valor NUMBER(7, 2), + activo NUMBER(1), + fecmodif DATE, + usuariomodif_id NUMBER(7), + CONSTRAINT gestao_operador_pk PRIMARY KEY ( gestaooperador_id ) ENABLE )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE GESTAO_OPERADOR_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201214_1108__mantis21228.sql b/src/db/migration/migration/V20201214_1108__mantis21228.sql new file mode 100644 index 000000000..ed2316c76 --- /dev/null +++ b/src/db/migration/migration/V20201214_1108__mantis21228.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE EMBARCADA_SINCRONISMO ADD CONSTRAINT USUARIO_ID_FK FOREIGN KEY(USUARIO_ID) REFERENCES USUARIO(USUARIO_ID)'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201215_1515__jira166.sql b/src/db/migration/migration/V20201215_1515__jira166.sql new file mode 100644 index 000000000..d8fd417f2 --- /dev/null +++ b/src/db/migration/migration/V20201215_1515__jira166.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -00957); +begin + execute immediate 'ALTER TABLE GP_PRICING_IMPORTE RENAME COLUMN DESCUENTOPORCENTAJEVOLTA TO DESCUENTOIMPORTEVOLTA'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -00957); +begin + execute immediate 'ALTER TABLE GP_PRICING_IMPORTE RENAME COLUMN DESCUENTOPORCREDONDO TO DESCUENTOIMPORTEREDONDO'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201215_1716__mantis20807.sql b/src/db/migration/migration/V20201215_1716__mantis20807.sql new file mode 100644 index 000000000..6e3aee57c --- /dev/null +++ b/src/db/migration/migration/V20201215_1716__mantis20807.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CUSTOM (CUSTOM_ID, SISTEMA, CHAVE, VALOR, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CUSTOM_SEQ.nextval, 2, ''MODCLI_ExibirEstoquePorPuloSequencia'', ''0'', 0, sysdate, 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201216_1645__mantis21251.sql b/src/db/migration/migration/V20201216_1645__mantis21251.sql new file mode 100644 index 000000000..35c61f9ce --- /dev/null +++ b/src/db/migration/migration/V20201216_1645__mantis21251.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''EXIBIR_TMRDABPE'', ''EXIBE TMR DABPE'', ''FALSE'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201217_1036__mantis21260.sql b/src/db/migration/migration/V20201217_1036__mantis21260.sql new file mode 100644 index 000000000..34e8b2b09 --- /dev/null +++ b/src/db/migration/migration/V20201217_1036__mantis21260.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDMANTEMVDACAJAVDAEMBARCADA NUMBER(1)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201222_1635__mantis21305.sql b/src/db/migration/migration/V20201222_1635__mantis21305.sql new file mode 100644 index 000000000..97f7dd3e8 --- /dev/null +++ b/src/db/migration/migration/V20201222_1635__mantis21305.sql @@ -0,0 +1,11 @@ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE EMPRESA MODIFY URLBASESEGURO VARCHAR2(100)'; + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201223_1356__mantis21303.sql b/src/db/migration/migration/V20201223_1356__mantis21303.sql new file mode 100644 index 000000000..260de2910 --- /dev/null +++ b/src/db/migration/migration/V20201223_1356__mantis21303.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, VALORCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) VALUES (CONSTANTE_SEQ.NEXTVAL, ''LIMITE_ID_TIPO_PARADA'', ''LIMITE_ID_TIPO_PARADA'', ''1'', ''127'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201223_1635__mantis20985.sql b/src/db/migration/migration/V20201223_1635__mantis20985.sql new file mode 100644 index 000000000..04effb180 --- /dev/null +++ b/src/db/migration/migration/V20201223_1635__mantis20985.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate + 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > RELATORIOS >> RELATORIO RESUMO VENDA ORGAO CONCEDENTE'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RESUMOVENDAORGAOCONCEDENTE'',1,sysdate,-1)'; + exception when others then null; +end; + diff --git a/src/db/migration/migration/V20201228_0858__mantis21073.sql b/src/db/migration/migration/V20201228_0858__mantis21073.sql new file mode 100644 index 000000000..e8d269e5c --- /dev/null +++ b/src/db/migration/migration/V20201228_0858__mantis21073.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''VDA > MANUTENCAO DE SERVICOS > AGRUPACAO DE SERVICOS >> HABILITA MARCAR/DESMARCAR MANTER SERVICO ORIGEM/DESTINO FECHADO'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.AGRUPACIONCORRIDAS.HABILITAMANTERCORRIDAFECHADA'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20201903_1517__mantis18200.sql b/src/db/migration/migration/V20201903_1517__mantis18200.sql new file mode 100644 index 000000000..0a2323b85 --- /dev/null +++ b/src/db/migration/migration/V20201903_1517__mantis18200.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > CATALOGO > PAIS'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.PAIS'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V2020200713_1517__mantis19729.sql b/src/db/migration/migration/V2020200713_1517__mantis19729.sql new file mode 100644 index 000000000..096897239 --- /dev/null +++ b/src/db/migration/migration/V2020200713_1517__mantis19729.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > CATALOGOS > CODIGO BARRAS CURITIBA'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.CONFCODBARRAS'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210104_1126__mantis21186.sql b/src/db/migration/migration/V20210104_1126__mantis21186.sql new file mode 100644 index 000000000..8ffee74f5 --- /dev/null +++ b/src/db/migration/migration/V20210104_1126__mantis21186.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD RECEITA_GAP NUMBER(12,2)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210111_1423__mantis21013.sql b/src/db/migration/migration/V20210111_1423__mantis21013.sql new file mode 100644 index 000000000..2cb8e91a7 --- /dev/null +++ b/src/db/migration/migration/V20210111_1423__mantis21013.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (CPFCNPJ_AUTDOWNLOAD VARCHAR2(14))'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20210115_1629__mantis21437.sql b/src/db/migration/migration/V20210115_1629__mantis21437.sql new file mode 100644 index 000000000..4c15fdfdd --- /dev/null +++ b/src/db/migration/migration/V20210115_1629__mantis21437.sql @@ -0,0 +1,11 @@ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE PRICING_OCUPA_ANTECIPA MODIFY PRICINGOCUPAANTECIPA_ID NUMBER(15)'; + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210116_1515__mantis20989.sql b/src/db/migration/migration/V20210116_1515__mantis20989.sql new file mode 100644 index 000000000..8f2d5a627 --- /dev/null +++ b/src/db/migration/migration/V20210116_1515__mantis20989.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values +(FUNCION_SISTEMA_SEQ.NEXTVAL,1,''USUARIO RELATORIO GRATUIDADE AGER > MENU RELATORIO > ESTATISTICO > RELATORIO GRATUIDADE AGER'', ''USUARIO.RELATORIO.AGER'',1,SYSDATE,-1)'; + exception when others then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210120_1520__mantis21318.sql b/src/db/migration/migration/V20210120_1520__mantis21318.sql new file mode 100644 index 000000000..4dbd9ce3b --- /dev/null +++ b/src/db/migration/migration/V20210120_1520__mantis21318.sql @@ -0,0 +1,70 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE AGRUPAMENTO_PARADA + ( + AGRUPAMENTOPARADA_ID NUMBER(7,0) NOT NULL ENABLE, + DESCAGRUPAMENTOPARADA VARCHAR2(180 BYTE) NOT NULL ENABLE, + CVEAGRUPAMENTOPARADA VARCHAR2(30 BYTE), + USUARIO_ID NUMBER(7,0) , + FECMODIF DATE, + ACTIVO NUMBER(1,0), + CONSTRAINT "PK_AGRUPAMENTOPARADA" PRIMARY KEY ("AGRUPAMENTOPARADA_ID"), + CONSTRAINT "FK_AGRUPAMENTOPARADA_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID") + )'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE AGRUPAMENTOPARADA_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate + 'ALTER TABLE PARADA ADD AGRUPAMENTOPARADA_ID NUMBER(7,0)'; + exception when column_exists then null; +end; +/ + +declare + dup_val_on_index exception; + except_02275 exception; + pragma exception_init (dup_val_on_index , -01430); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE PARADA ADD CONSTRAINT FK_PARADA_AGRUPAMENTOPARADA FOREIGN KEY (AGRUPAMENTOPARADA_ID) REFERENCES AGRUPAMENTO_PARADA (AGRUPAMENTOPARADA_ID)'; + exception + when dup_val_on_index then null; + when except_02275 then null; +end; +/ + + +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM > ESQUEMA OPERACIONAL > AGRUPAR LOCALIDADES>> CADASTRA OS AGRUPAMENTOS DE PARADA'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.AGRUPARPARADAS'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + diff --git a/src/db/migration/migration/V20210120_1544__mantis21459.sql b/src/db/migration/migration/V20210120_1544__mantis21459.sql new file mode 100644 index 000000000..a9e240e44 --- /dev/null +++ b/src/db/migration/migration/V20210120_1544__mantis21459.sql @@ -0,0 +1,4 @@ +begin + execute immediate 'Insert into ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID,DESCORGAO,INDSUBSEGURO,INDDEFAULTSEGURO,FECMODIF,ACTIVO,USUARIO_ID,CNPJ,INDNOMDOCOBLIGATORIO,IDADE_IDOSO,INDICEPEAJE,IDADE_MINIMA,CATEGORIA_ID,INTEGRADOTOTVS,INDUTILIZAICMS,INDMULTATODASREMARCACOES) values (''32'',''AGER/MT'',''0'',''0'',to_date(''08/01/2021 15:57:53'',''DD/MM/YYYY HH24:MI:SS''),''1'',''1'',null,''0'',''60'',''0,68'',null,null,''0'',''0'',null)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210121_1444__mantis21471.sql b/src/db/migration/migration/V20210121_1444__mantis21471.sql new file mode 100644 index 000000000..9c24b5814 --- /dev/null +++ b/src/db/migration/migration/V20210121_1444__mantis21471.sql @@ -0,0 +1,4 @@ +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, VALORCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) VALUES(CONSTANTE_SEQ.nextval, ''VALIDA_DUPLICIDADE_SO_MESMA_AGENCIA'', ''VALIDA_DUPLICIDADE_SO_MESMA_AGENCIA'', ''1'', ''false'', 0, 1,sysdate, -1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210201_1713__mantis21109.sql b/src/db/migration/migration/V20210201_1713__mantis21109.sql new file mode 100644 index 000000000..58f64522b --- /dev/null +++ b/src/db/migration/migration/V20210201_1713__mantis21109.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CUSTOM (CUSTOM_ID, SISTEMA, CHAVE, VALOR, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CUSTOM_SEQ.nextval, 3, ''isReceitasDespesasOuroPrata'', ''false'', 1, sysdate, 1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210201_1718__mantis21498.sql b/src/db/migration/migration/V20210201_1718__mantis21498.sql new file mode 100644 index 000000000..9c77ad688 --- /dev/null +++ b/src/db/migration/migration/V20210201_1718__mantis21498.sql @@ -0,0 +1,28 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE GP_PRICING_BEN_CL_TARI + ( + PRICINGBENCLTARI_ID NUMBER(7,0) NOT NULL ENABLE, + NOMEBENEFICIO VARCHAR2(100 BYTE) NOT NULL ENABLE, + DESCBENEFICIO VARCHAR2(300 BYTE), + USUARIO_ID NUMBER(7,0), + FECMODIF DATE, + ACTIVO NUMBER(1,0), + CONSTRAINT GP_PRICING_BEN_CL_TARI_PK PRIMARY KEY (PRICINGBENCLTARI_ID) + )'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE GP_PRICING_BEN_CLAS_TAR_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210201_1726__mantis21498.sql b/src/db/migration/migration/V20210201_1726__mantis21498.sql new file mode 100644 index 000000000..91990877b --- /dev/null +++ b/src/db/migration/migration/V20210201_1726__mantis21498.sql @@ -0,0 +1,27 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE GP_PRICING_BEN_CL_TARI_CTRL + ( + PRICINGCLASSETARIFARIA_ID NUMBER(7,0) NOT NULL ENABLE, + PRICINGBENCLTARI_ID NUMBER(7,0) NOT NULL ENABLE, + CONSTRAINT GP_PRICING_BEN_CL_TARI_CTRL_PK PRIMARY KEY (PRICINGCLASSETARIFARIA_ID, PRICINGBENCLTARI_ID), + CONSTRAINT FK_GP_PRICING_CLASSE_TARIFARIA FOREIGN KEY (PRICINGCLASSETARIFARIA_ID) + REFERENCES GP_PRICING_CLASSE_TARIFARIA (PRICINGCLASSETARIFARIA_ID) ENABLE, + CONSTRAINT FK_GP_PRICING_BEN_CL_TARI FOREIGN KEY (PRICINGBENCLTARI_ID) REFERENCES GP_PRICING_BEN_CL_TARI (PRICINGBENCLTARI_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE GP_PRICING_BEN_C_TAR_CTRL_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20210201_1729__mantis21498.sql b/src/db/migration/migration/V20210201_1729__mantis21498.sql new file mode 100644 index 000000000..3414cf328 --- /dev/null +++ b/src/db/migration/migration/V20210201_1729__mantis21498.sql @@ -0,0 +1,31 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE GP_PRECIO_ESPECIAL_TARI_GRUPO + (PRECIOESPECIALTARIFAGRUPO_ID NUMBER(7,0) NOT NULL ENABLE, + QTDRESERVAMIN NUMBER(7,0) NOT NULL ENABLE, + QTDRESERVAMAX NUMBER(7,0) NOT NULL ENABLE, + ACTIVO NUMBER(1,0) NOT NULL ENABLE, + VALOR NUMBER(10,2) NOT NULL ENABLE, + PORCENTAGEM NUMBER(10,2) NOT NULL ENABLE, + PRICING_ID NUMBER(7,0) NOT NULL ENABLE, + USUARIO_ID NUMBER(7,0), + FECMODIF DATE, + CONSTRAINT PRECIO_ESPECI_TARIFA_GRUPO_PK PRIMARY KEY (PRECIOESPECIALTARIFAGRUPO_ID), + CONSTRAINT FK_GP_PRICING FOREIGN KEY (PRICING_ID) REFERENCES GP_PRICING (PRICING_ID) ENABLE + )'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE PRECIO_ESPECI_TARIFA_GRUPO_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210202_1021__mantis21546.sql b/src/db/migration/migration/V20210202_1021__mantis21546.sql new file mode 100644 index 000000000..b7a831513 --- /dev/null +++ b/src/db/migration/migration/V20210202_1021__mantis21546.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''VDA > SOBRE >> SITEF'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUCONFIGURACAOSITEF'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210202_1120__mantis21465.sql b/src/db/migration/migration/V20210202_1120__mantis21465.sql new file mode 100644 index 000000000..3c4ffbecf --- /dev/null +++ b/src/db/migration/migration/V20210202_1120__mantis21465.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > PASAJERO FRECUENTE > IMPORTAR CLIENTES SRVP'', ''COM.RJCONSULTORES.ADMINISTRACION.GUI.PASAJEROFRECUENTE.MENU.IMPORTARCLIENTESSRVP'',1,SYSDATE,-1)'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210204_1730__mantis21169.sql b/src/db/migration/migration/V20210204_1730__mantis21169.sql new file mode 100644 index 000000000..c0d9e8b5d --- /dev/null +++ b/src/db/migration/migration/V20210204_1730__mantis21169.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PRICING ADD INDSOMENTEASSENTOSUGERIDO NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210208_1035__mantis21537.sql b/src/db/migration/migration/V20210208_1035__mantis21537.sql new file mode 100644 index 000000000..b079868c1 --- /dev/null +++ b/src/db/migration/migration/V20210208_1035__mantis21537.sql @@ -0,0 +1,47 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (ISFLEXBUS NUMBER(1,0), OCUPACAO_MINIMA NUMBER(7,0), HORAS_CONFIRMACAO NUMBER(7,0), MINUTOS_CONFIRMACAO NUMBER(7,0)) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE CORRIDA ADD (ISFLEXBUS NUMBER(1,0), STATUSFLEXBUS NUMBER(1,0), OCUPACAO_MINIMA NUMBER(7,0), HORAS_CONFIRMACAO NUMBER(7,0), MINUTOS_CONFIRMACAO NUMBER(7,0), USUARIOFLEXBUS_ID NUMBER(7,0)) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD (INDRESERVAFLEXBUS NUMBER(1,0)) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210211_0934__mantis21537.sql b/src/db/migration/migration/V20210211_0934__mantis21537.sql new file mode 100644 index 000000000..71af2b9bb --- /dev/null +++ b/src/db/migration/migration/V20210211_0934__mantis21537.sql @@ -0,0 +1,45 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE EMPRESA_EMAIL_FLEXBUS + ( + EMPRESAEMAILFLEXBUS_ID NUMBER(7, 0) NOT NULL + , EMPRESA_ID NUMBER(7, 0) + , SMTP VARCHAR2(100 BYTE) + , SENHA VARCHAR2(50 BYTE) + , SMTPPORTA VARCHAR2(20 BYTE) + , SMTPEMAIL VARCHAR2(50 BYTE) + , ACTIVO NUMBER(1,0) + , FECMODIF DATE + , USUARIO_ID NUMBER(7,0) + , TEXTOEMAIL CLOB + , ASSUNTO VARCHAR2(200 BYTE) + , EMAILDE VARCHAR2(50 BYTE) + , EMAILCOPIAOCULTA VARCHAR2(200) + , INDAUTENTICACAO NUMBER(1,0) + , CONSTRAINT EMPRESA_EMAIL_FLEXBUS_PK PRIMARY KEY ( EMPRESAEMAILFLEXBUS_ID ) ENABLE ) '; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE EMP_EMAIL_FLEXBUS_SEQ'; + exception when object_exists then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > ESQUEMA OPERACIONAL > FLEXBUS'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.FLEXBUS'', + ''1'',to_date(''12/02/21'',''DD/MM/RR''),''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20210218_1446__mantis21311.sql b/src/db/migration/migration/V20210218_1446__mantis21311.sql new file mode 100644 index 000000000..f27d29a9c --- /dev/null +++ b/src/db/migration/migration/V20210218_1446__mantis21311.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDALERTAVDAPOSHORARIOVIAGEM NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210224_1051__mantis21723.sql b/src/db/migration/migration/V20210224_1051__mantis21723.sql new file mode 100644 index 000000000..30d39e4ac --- /dev/null +++ b/src/db/migration/migration/V20210224_1051__mantis21723.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDCONFMOVFPTROCAVLRDEPOSITO NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210224_1412__mantis21541.sql b/src/db/migration/migration/V20210224_1412__mantis21541.sql new file mode 100644 index 000000000..f0123bd59 --- /dev/null +++ b/src/db/migration/migration/V20210224_1412__mantis21541.sql @@ -0,0 +1,33 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE RESERVA_FLEXBUS + ( + RESERVAFLEXBUS_ID NUMBER(15, 0) NOT NULL + , BOLETO_ID NUMBER(15, 0) + , NOME_PASSAGEIRO VARCHAR2(180 BYTE) + , DOC_PASSAGEIRO VARCHAR2(45 BYTE) + , EMAIL_COMPRADOR VARCHAR2(100 BYTE) + , NOME_COMPRADOR VARCHAR2(180 BYTE) + , LOGIN_COMPRADOR VARCHAR2(180 BYTE) + , CLIENTE_ID NUMBER(7,0) + , NUMOPERACION VARCHAR2(36 BYTE) + , URL_PAGAMENTO VARCHAR2(300 BYTE) + , EMAIL_RESERVA VARCHAR2(100 BYTE) + , INDEMAILENVIADO NUMBER(1,0) + , CONSTRAINT RESERVA_FLEXBUS_PK PRIMARY KEY ( RESERVAFLEXBUS_ID ) ENABLE ) '; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE RESERVAFLEXBUS_SEQ'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210225_1257__mantis21590.sql b/src/db/migration/migration/V20210225_1257__mantis21590.sql new file mode 100644 index 000000000..29f3f29d4 --- /dev/null +++ b/src/db/migration/migration/V20210225_1257__mantis21590.sql @@ -0,0 +1,13 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -00001); +begin + execute immediate 'update +(select PF.INDLECTURA,PF.FECMODIF +from PERFIL_FUNCION PF +inner join FUNCION_SISTEMA FS on FS.FUNCIONSISTEMA_ID = PF.FUNCIONSISTEMA_ID +where FS.SISTEMA_ID=2 and PF.INDLECTURA=1) TB +SET TB.INDLECTURA=0, +TB.FECMODIF=SYSDATE'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210301_1520__jira238.sql b/src/db/migration/migration/V20210301_1520__jira238.sql new file mode 100644 index 000000000..ad8d5b304 --- /dev/null +++ b/src/db/migration/migration/V20210301_1520__jira238.sql @@ -0,0 +1,547 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CONVENIO_CORRIDA +( + CONVENIOCORRIDA_ID NUMBER(7, 0) NOT NULL +, CONVENIO_ID NUMBER(7, 0) +, CORRIDA_ID NUMBER(7, 0) +, ACTIVO NUMBER(1, 0) +, FECMODIF DATE +, USUARIO_ID NUMBER(7, 0) +) '; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONVENIO_CORRIDA_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE UNIQUE INDEX PK_CONVENIO_CORRIDA_ID ON CONVENIO_CORRIDA (CONVENIOCORRIDA_ID ASC)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_CORRIDA +ADD CONSTRAINT PK_CONVENIO_CORRIDA_ID PRIMARY KEY +( + CONVENIOCORRIDA_ID +) +USING INDEX PK_CONVENIO_CORRIDA_ID +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ + +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_CORRIDA +ADD CONSTRAINT FK_CONVENIO_CORRIDA_CTRL_ID FOREIGN KEY +( + CORRIDA_ID +) +REFERENCES CORRIDA_CTRL +( + CORRIDA_ID +) +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ + +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_CORRIDA +ADD CONSTRAINT FK_CONVENIO_CORRIDA_ID FOREIGN KEY +( + CONVENIO_ID +) +REFERENCES CONVENIO +( + CONVENIO_ID +) +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CONVENIO_FORMAPAGO +( + CONVENIOFORMAPAGO_ID NUMBER(7, 0) NOT NULL +, CONVENIO_ID NUMBER(7, 0) +, FORMAPAGO_ID NUMBER(2, 0) +, INDEXCEPCION NUMBER(1, 0) +, ACTIVO NUMBER(1, 0) +, FECMODIF DATE +, USUARIO_ID NUMBER(7, 0) +) '; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONVENIO_FORMAPAGO_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE UNIQUE INDEX PK_CONVENIO_FORMAPAGO ON CONVENIO_FORMAPAGO (CONVENIOFORMAPAGO_ID ASC) '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_FORMAPAGO +ADD CONSTRAINT PK_CONVENIO_FORMAPAGO PRIMARY KEY +( + CONVENIOFORMAPAGO_ID +) +USING INDEX PK_CONVENIO_FORMAPAGO +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); + +begin + execute immediate 'ALTER TABLE CONVENIO_FORMAPAGO +ADD CONSTRAINT FK_CONVENIO_FORMAPAGO FOREIGN KEY +( + CONVENIO_ID +) +REFERENCES CONVENIO +( + CONVENIO_ID +) +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_FORMAPAGO +ADD CONSTRAINT FK_CONVENIO_FORMA_PAGO FOREIGN KEY +( + FORMAPAGO_ID +) +REFERENCES FORMA_PAGO +( + FORMAPAGO_ID +) +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CONVENIO_CATEGORIA +( + CONVENIOCATEGORIA_ID NUMBER(7, 0) NOT NULL +, CONVENIO_ID NUMBER(7, 0) +, CATEGORIA_ID NUMBER(7, 0) +, ACTIVO NUMBER(1, 0) +, FECMODIF DATE +, USUARIO_ID NUMBER(7, 0) +) '; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONVENIO_CATEGORIA_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE UNIQUE INDEX PK_CONVENIO_CATEGORIA ON CONVENIO_CATEGORIA (CONVENIOCATEGORIA_ID ASC) '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_CATEGORIA +ADD CONSTRAINT PK_CONVENIO_CATEGORIA PRIMARY KEY +( + CONVENIOCATEGORIA_ID +) +USING INDEX PK_CONVENIO_CATEGORIA +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_CATEGORIA +ADD CONSTRAINT FK_CONVENIO_CATEGORIA_ID FOREIGN KEY +( + CATEGORIA_ID +) +REFERENCES CATEGORIA +( + CATEGORIA_ID +) +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_CATEGORIA +ADD CONSTRAINT FK_CONVENIO_CAT_ID FOREIGN KEY +( + CONVENIO_ID +) +REFERENCES CONVENIO +( + CONVENIO_ID +) +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CONVENIO_CLASE +( + CONVENIOCLASE_ID NUMBER(7, 0) NOT NULL +, CONVENIO_ID NUMBER(7, 0) +, CLASESERVICIO_ID NUMBER(2, 0) +, ACTIVO NUMBER(1, 0) +, FECMODIF DATE +, USUARIO_ID NUMBER(7, 0) +) '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONVENIO_CLASE_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE UNIQUE INDEX PK_CONVENIO_CLASSE ON CONVENIO_CLASE (CONVENIOCLASE_ID ASC) '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_CLASE +ADD CONSTRAINT PK_CONVENIO_CLASSE PRIMARY KEY +( + CONVENIOCLASE_ID +) +USING INDEX PK_CONVENIO_CLASSE +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_CLASE +ADD CONSTRAINT FK_CONVENIO_SERVICIO_ID FOREIGN KEY +( + CLASESERVICIO_ID +) +REFERENCES CLASE_SERVICIO +( + CLASESERVICIO_ID +) +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_CLASE +ADD CONSTRAINT FK_CONVENIO_CLASE_ID FOREIGN KEY +( + CONVENIO_ID +) +REFERENCES CONVENIO +( + CONVENIO_ID +) +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE CONVENIO ADD (INDREDONDO NUMBER(1) )'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE CONVENIO ADD (VALORMAX NUMBER(5,2) )'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE CONVENIO ADD (VALORMIN NUMBER(5,2) )'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE CONVENIO ADD (TIPODESCONTO NUMBER(1) )'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210310_1743__mantis21861.sql b/src/db/migration/migration/V20210310_1743__mantis21861.sql new file mode 100644 index 000000000..32642bf3f --- /dev/null +++ b/src/db/migration/migration/V20210310_1743__mantis21861.sql @@ -0,0 +1,22 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA VALUES + ( + FUNCION_SISTEMA_SEQ.NEXTVAL, + 2, + ''VDA > AUTORIZACAO > PESQUISA DE SERVICOS > BOTAO > EDITARVENDAEMPE'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.BUSQUEDACORRIDAS.BTN.EDITARVENDAEMPE'', + 1 , + sysdate, + 1 + )'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210311_0851__mantis21480.sql b/src/db/migration/migration/V20210311_0851__mantis21480.sql new file mode 100644 index 000000000..a6c3628d4 --- /dev/null +++ b/src/db/migration/migration/V20210311_0851__mantis21480.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDCOMTRANSFGERACAJA NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210311_1544__mantis21515.sql b/src/db/migration/migration/V20210311_1544__mantis21515.sql new file mode 100644 index 000000000..71c6032fe --- /dev/null +++ b/src/db/migration/migration/V20210311_1544__mantis21515.sql @@ -0,0 +1,13 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PTOVTA_COMISSAO ADD (SEGUROOBRIGATORIOALTA NUMBER(5,2), SEGUROOBRIGATORIOBAIXA NUMBER(5,2))'; + exception when column_exists then null; +end; +/ +declare +begin + execute immediate 'UPDATE PTOVTA_COMISSAO SET SEGUROOBRIGATORIOALTA = PASSAGEMALTA, SEGUROOBRIGATORIOBAIXA = PASSAGEMBAIXA WHERE SEGURORECEITA = 1'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210315_1108__mantis21515.sql b/src/db/migration/migration/V20210315_1108__mantis21515.sql new file mode 100644 index 000000000..6266c8ef9 --- /dev/null +++ b/src/db/migration/migration/V20210315_1108__mantis21515.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO_RECEITA ADD COMISSAO_SEG_OBRIGATORIO NUMBER(13,2)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210315_1202__jira258.sql b/src/db/migration/migration/V20210315_1202__jira258.sql new file mode 100644 index 000000000..8645766e6 --- /dev/null +++ b/src/db/migration/migration/V20210315_1202__jira258.sql @@ -0,0 +1,40 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE ANTECEDENCIA_CORRIDA_WEB +( + ANTECEDENCIACORRIDAWEB_ID NUMBER(7) NOT NULL +, CORRIDA_ID NUMBER(7) NOT NULL +, ANTECEDENCIA_MIN NUMBER(5) +, ACTIVO NUMBER(1) +, FECMODIF DATE +, USUARIO_ID NUMBER(7) +, CONSTRAINT ANTECEDENCIA_CORRIDA_WEB_PK PRIMARY KEY + ( + ANTECEDENCIACORRIDAWEB_ID + ) + ENABLE +)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE UNIQUE INDEX PK_CORRIDA_ID ON ANTECEDENCIA_CORRIDA_WEB (CORRIDA_ID ASC)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE ANTECEDENCIA_CORRIDA_WEB_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20210321_1546__mantis21665.sql b/src/db/migration/migration/V20210321_1546__mantis21665.sql new file mode 100644 index 000000000..49c258c6d --- /dev/null +++ b/src/db/migration/migration/V20210321_1546__mantis21665.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE TAXPOLV MODIFY POLTRONA VARCHAR2(6 BYTE)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210324_0848__mantis21460.sql b/src/db/migration/migration/V20210324_0848__mantis21460.sql new file mode 100644 index 000000000..ad479c9eb --- /dev/null +++ b/src/db/migration/migration/V20210324_0848__mantis21460.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM > RELATORIOS > INTEGRACAO > BPE >> GRATUIDADE AGEPAN'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOGRATUIDADEAGEPAN'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210325_1845__jira237.sql b/src/db/migration/migration/V20210325_1845__jira237.sql new file mode 100644 index 000000000..c4734225a --- /dev/null +++ b/src/db/migration/migration/V20210325_1845__jira237.sql @@ -0,0 +1,109 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE CONVENIO_HIST +( + CONVENIOHIST_ID NUMBER(7) NOT NULL +, CONVENIODET_ID NUMBER(7) +, ACTIVO NUMBER(1) +, FECMODIF DATE +, USUARIO_ID NUMBER(7) +, CONSTRAINT CONVENIO_HIST_PK PRIMARY KEY + ( + CONVENIOHIST_ID + ) + ENABLE +)'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_02260 exception; + except_06512 exception; + except_02275 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_02260 , -02260); + pragma exception_init (except_06512 , -06512); + pragma exception_init (except_02275 , -02275); +begin + execute immediate 'ALTER TABLE CONVENIO_HIST +ADD CONSTRAINT CONVENIO_HIST_FK1 FOREIGN KEY +( + CONVENIODET_ID +) +REFERENCES CONVENIO_DET +( + CONVENIODET_ID +) +ENABLE'; + exception + when object_exists then null; + when except_00957 then null; + when except_02260 then null; + when except_06512 then null; + when except_02275 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONVENIO_HIST_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ + +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''EBUS > DESCONTO AUTOR'', + ''COM.RJCONSULTORES.EBUS.GUI.DESCONTO.AUTOR'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''EBUS > DESCONTO PUBLICADOR'', + ''COM.RJCONSULTORES.EBUS.GUI.DESCONTO.PUBLICADOR'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''EBUS > DESCONTO ADMINISTRADOR'', + ''COM.RJCONSULTORES.EBUS.GUI.DESCONTO.ADMINISTRADOR'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210331_0925__jira237.sql b/src/db/migration/migration/V20210331_0925__jira237.sql new file mode 100644 index 000000000..4a59ed058 --- /dev/null +++ b/src/db/migration/migration/V20210331_0925__jira237.sql @@ -0,0 +1,9 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE CONVENIO ADD (STATUS VARCHAR2(2))'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210405_0913__mantis21456.sql b/src/db/migration/migration/V20210405_0913__mantis21456.sql new file mode 100644 index 000000000..49fb2abfd --- /dev/null +++ b/src/db/migration/migration/V20210405_0913__mantis21456.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA > CANCELAMENTO >> PERMITE DESMARCAR SEG. OPCIONAL'', + ''COM.RJCONSULTORES.SCO.VENTABOLETOS.CANCELACION.PERMITEDESMARCARSEGOPCIONAL'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210405_1716__mantis21693.sql b/src/db/migration/migration/V20210405_1716__mantis21693.sql new file mode 100644 index 000000000..58b9dfeeb --- /dev/null +++ b/src/db/migration/migration/V20210405_1716__mantis21693.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CATEGORIA_RUTA_EXCECAO ( + CATEGORIARUTAEXCECAO_ID NUMBER(7) NOT NULL, + RUTA_ID NUMBER(7) NOT NULL, + CATEGORIACTRL_ID NUMBER(7) NOT NULL, + FECMODIF DATE, + ACTIVO NUMBER(1,0), + USUARIO_ID NUMBER(7,0) , + PRIMARY KEY (CATEGORIARUTAEXCECAO_ID), + CONSTRAINT FK_CATEGORIARUTAEXCECAO_CTRL FOREIGN KEY (CATEGORIACTRL_ID) REFERENCES CATEGORIA_CTRL (CATEGORIACTRL_ID), + CONSTRAINT FK_CATEGORIARUTAEXCECAO_RUTA FOREIGN KEY (RUTA_ID) REFERENCES RUTA (RUTA_ID))'; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE CATEGORIA_RUTA_EXCECAO_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210406_1416__mantis21635.sql b/src/db/migration/migration/V20210406_1416__mantis21635.sql new file mode 100644 index 000000000..d8fa65910 --- /dev/null +++ b/src/db/migration/migration/V20210406_1416__mantis21635.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PRICING ADD INDPRICINGDIVIDIRIDAEVOLTA NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210408_1507__mantis21827.sql b/src/db/migration/migration/V20210408_1507__mantis21827.sql new file mode 100644 index 000000000..f850ab5e2 --- /dev/null +++ b/src/db/migration/migration/V20210408_1507__mantis21827.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''VDA > MAPA DE VIAGEM >> RELATORIO TAXAS'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENURELATORIOTAXAS'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210409_1427__mantis22053.sql b/src/db/migration/migration/V20210409_1427__mantis22053.sql new file mode 100644 index 000000000..9811477ea --- /dev/null +++ b/src/db/migration/migration/V20210409_1427__mantis22053.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDPRICINGVENDAABERTO NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210411_2056__mantis21957.sql b/src/db/migration/migration/V20210411_2056__mantis21957.sql new file mode 100644 index 000000000..f253b6fcb --- /dev/null +++ b/src/db/migration/migration/V20210411_2056__mantis21957.sql @@ -0,0 +1,7 @@ +declare +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.nextval,''TENANT_RECARGA_CELULAR'',''TENANT_RECARGA_CELULAR'',null,null,1,1,sysdate,1)'; + exception when others then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210415_1525__mantis22052.sql b/src/db/migration/migration/V20210415_1525__mantis22052.sql new file mode 100644 index 000000000..9a663de1d --- /dev/null +++ b/src/db/migration/migration/V20210415_1525__mantis22052.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD INDCHECKINAUTOMATICO NUMBER(1)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210422_1008__mantis22159.sql b/src/db/migration/migration/V20210422_1008__mantis22159.sql new file mode 100644 index 000000000..7c5e0abee --- /dev/null +++ b/src/db/migration/migration/V20210422_1008__mantis22159.sql @@ -0,0 +1,17 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD + (INDCANCELAEMABERTO NUMBER(1,0), + INDDEVOLVEEMABERTO NUMBER(1,0), + INDCANCELAEMERGENCIALAEMABERTO NUMBER(1,0), + INDTROCATITULARIDADEEMABERTO NUMBER(1,0), + INDTROCAEMABERTO NUMBER(1,0), + INDPERMITECANCELAR NUMBER(1,0), + INDPERMITEDEVOLVER NUMBER(1,0), + INDPERMITECANCELAREMERGENCIAL NUMBER(1,0), + INDPERMITETROCATITULARIDADE NUMBER(1,0), + INDPERMITEREATIVAR NUMBER(1,0))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20210427_1546__mantis22053.sql b/src/db/migration/migration/V20210427_1546__mantis22053.sql new file mode 100644 index 000000000..fa4acc9f0 --- /dev/null +++ b/src/db/migration/migration/V20210427_1546__mantis22053.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDVENDAABERTOMOVIMENTOCAIXA NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210429_1120__mantis22049.sql b/src/db/migration/migration/V20210429_1120__mantis22049.sql new file mode 100644 index 000000000..7aa732349 --- /dev/null +++ b/src/db/migration/migration/V20210429_1120__mantis22049.sql @@ -0,0 +1,162 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM >> ESQUEMA OPERACIONAL >> GERAR CONEXO POR LINHA'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.CONEXIONPORRUTA'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONEXION_RUTA_CTRL_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE CONEXION_RUTA_CTRL + (CONEXIONRUTACTRL_ID NUMBER(7,0) NOT NULL ENABLE, + RUTA_ORIGEN_ID NUMBER(7,0), + RUTA_DESTINO_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + PRIMARY KEY (CONEXIONRUTACTRL_ID) ENABLE + + )'; + exception when object_exists then null; +end; + +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONEXION_RUTA_TRAMO_CTRL_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE CONEXION_RUTA_TRAMO_CTRL + (CONEXIONRUTATRAMOCTRL_ID NUMBER(7,0) NOT NULL ENABLE, + CONEXIONRUTACTRL_ID NUMBER(7,0), + ORIGEN_ID NUMBER(7,0), + DESTINO_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + PRIMARY KEY (CONEXIONRUTATRAMOCTRL_ID) ENABLE, + FOREIGN KEY (CONEXIONRUTACTRL_ID) REFERENCES CONEXION_RUTA_CTRL (CONEXIONRUTACTRL_ID) + )'; + exception when object_exists then null; +end; + +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION ADD (RUTA_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION ADD (CONEXIONRUTATRAMOCTRL_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION ADD CONSTRAINT FK_CONEXION_RUTA_TRAMO FOREIGN KEY (CONEXIONRUTATRAMOCTRL_ID) + REFERENCES CONEXION_RUTA_TRAMO_CTRL(CONEXIONRUTATRAMOCTRL_ID)'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONEXIORUTAEXCEPCIOTIPOPTA_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE CONEXION_RUTAEXCEPCIONTIPOPTA + (CONEXIONRUTATIPOPTOVTA_ID NUMBER(7,0) NOT NULL ENABLE, + CONEXIONRUTACTRL_ID NUMBER(7,0), + TIPOPTOVTA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + PRIMARY KEY (CONEXIONRUTATIPOPTOVTA_ID) ENABLE, + FOREIGN KEY (TIPOPTOVTA_ID) REFERENCES TIPO_PTOVTA (TIPOPTOVTA_ID) + )'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONEXIORUTAEXCEPCIONPTOVTA_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; + +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE CONEXION_RUTA_EXCEPCION_PTOVTA + (CONEXIONRUTAPTOVTA_ID NUMBER(7,0) NOT NULL ENABLE, + CONEXIONRUTACTRL_ID NUMBER(7,0), + PUNTOVENTA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + PRIMARY KEY (CONEXIONRUTAPTOVTA_ID) ENABLE, + FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) + )'; + exception when object_exists then null; +end; + + diff --git a/src/db/migration/migration/V20210503_1033__mantis22051.sql b/src/db/migration/migration/V20210503_1033__mantis22051.sql new file mode 100644 index 000000000..e279012db --- /dev/null +++ b/src/db/migration/migration/V20210503_1033__mantis22051.sql @@ -0,0 +1,23 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_RUTA ADD QTD_POLTRONA_AUTORIZADA NUMBER(5,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_RUTA ADD VALOR_DESCONTO NUMBER(5,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_RUTA ADD PORCENTAGEM_DESCONTO NUMBER(5,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210504_1839__mantis22155.sql b/src/db/migration/migration/V20210504_1839__mantis22155.sql new file mode 100644 index 000000000..20b654c1c --- /dev/null +++ b/src/db/migration/migration/V20210504_1839__mantis22155.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_PARAMGERAL ADD (BOLETO_JUROS NUMBER(5,2), BOLETO_MULTA NUMBER(5,2) )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210505_1028__mantis22054.sql b/src/db/migration/migration/V20210505_1028__mantis22054.sql new file mode 100644 index 000000000..8354d0080 --- /dev/null +++ b/src/db/migration/migration/V20210505_1028__mantis22054.sql @@ -0,0 +1,6 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''CONEXAO_RUTA_FIXA'', ''HABILITA CONEXAO FIXA POR LINHA'', ''FALSE'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210506_1052__mantis22052.sql b/src/db/migration/migration/V20210506_1052__mantis22052.sql new file mode 100644 index 000000000..1527a01bf --- /dev/null +++ b/src/db/migration/migration/V20210506_1052__mantis22052.sql @@ -0,0 +1,54 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, + INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''USUARIO_CHECKIN_AUTOMATICO_TAREAS'', ''USUARIO_CHECKIN_AUTOMATICO_TAREAS'', + ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''PUNTOVENTA_CHECKIN_AUTOMATICO_TAREAS'', ''PUNTOVENTA_CHECKIN_AUTOMATICO_TAREAS'', ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''ESTACION_CHECKIN_AUTOMATICO_TAREAS'', ''ESTACION_CHECKIN_AUTOMATICO_TAREAS'', ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_CHECKIN_AUTOMATICO'',''CRON_ROTINA_CHECKIN_AUTOMATICO'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''CATEGORIA_ID_POLTRONA_MAIS_CONFORTO'', ''CATEGORIA_ID_POLTRONA_MAIS_CONFORTO'', '' '', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; +/ +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''ULTIMA_EXECUCAO_JOB_CHECKIN'', ''ULTIMA_EXECUCAO_JOB_CHECKIN'', '' '', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20210510_1321__mantis22156.sql b/src/db/migration/migration/V20210510_1321__mantis22156.sql new file mode 100644 index 000000000..badb9297b --- /dev/null +++ b/src/db/migration/migration/V20210510_1321__mantis22156.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_BOLETO ADD (PORC_MORA NUMBER(5,2), PORC_MULTA NUMBER(5,2) )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210510_1520__mantis21994.sql b/src/db/migration/migration/V20210510_1520__mantis21994.sql new file mode 100644 index 000000000..9f46c725d --- /dev/null +++ b/src/db/migration/migration/V20210510_1520__mantis21994.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO ADD (RECEITA_SEGURO NUMBER(13,2), RECEITA_BRUTA_SEGURO NUMBER(13,2) )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210510_1521__mantis21994.sql b/src/db/migration/migration/V20210510_1521__mantis21994.sql new file mode 100644 index 000000000..8c36d9a86 --- /dev/null +++ b/src/db/migration/migration/V20210510_1521__mantis21994.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE COMISSAO_RECEITA ADD SEG_OBRIGATORIO NUMBER(13,2)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210513_1120__mantis22050.sql b/src/db/migration/migration/V20210513_1120__mantis22050.sql new file mode 100644 index 000000000..4598ee39e --- /dev/null +++ b/src/db/migration/migration/V20210513_1120__mantis22050.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM >> RELATORIOS >> RELATORIO VENDAS CONEXAO POR LINHA'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASCONEXAORUTA'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210513_1512__mantis21705.sql b/src/db/migration/migration/V20210513_1512__mantis21705.sql new file mode 100644 index 000000000..afa763de6 --- /dev/null +++ b/src/db/migration/migration/V20210513_1512__mantis21705.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDNAOPERMITETROCAENTREEMPRESA NUMBER(1,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210515_1847__mantis21768.sql b/src/db/migration/migration/V20210515_1847__mantis21768.sql new file mode 100644 index 000000000..dc59e3445 --- /dev/null +++ b/src/db/migration/migration/V20210515_1847__mantis21768.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate + 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_seq.nextval,''2'',''VDA > VENDA >> MAPA DE VIAGEM'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITEN.MAPAVIAGEM'',''1'',SYSDATE,''1'')'; + exception when others then null; +end; diff --git a/src/db/migration/migration/V20210519_0905__mantis21857.sql b/src/db/migration/migration/V20210519_0905__mantis21857.sql new file mode 100644 index 000000000..04b513312 --- /dev/null +++ b/src/db/migration/migration/V20210519_0905__mantis21857.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CLASE_SERVICIO ADD INDNAOVENDESEGUROOPCIONAL NUMBER(1)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210519_1530__mantis22144.sql b/src/db/migration/migration/V20210519_1530__mantis22144.sql new file mode 100644 index 000000000..522a9d74b --- /dev/null +++ b/src/db/migration/migration/V20210519_1530__mantis22144.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM > RELATORIOS > RELATORIOS > RELATORIOS FINANCEIRO > W2I'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOW2I'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210521_1034__mantis22367.sql b/src/db/migration/migration/V20210521_1034__mantis22367.sql new file mode 100644 index 000000000..36702c8dd --- /dev/null +++ b/src/db/migration/migration/V20210521_1034__mantis22367.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD (INDPERMITETROCA NUMBER(1,0), INDPERMITETRANSFERENCIA NUMBER(1,0) ) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update CATEGORIA_DESCUENTO set INDPERMITETROCA = INDPERMITETROCATRANSFERENCIA , INDPERMITETRANSFERENCIA = INDPERMITETROCATRANSFERENCIA'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210521_1506__mantis22377.sql b/src/db/migration/migration/V20210521_1506__mantis22377.sql new file mode 100644 index 000000000..f58f64075 --- /dev/null +++ b/src/db/migration/migration/V20210521_1506__mantis22377.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD (INDNAOIMPRIMECUPOMVENDABERTO NUMBER(1,0), INDNAOIMPRIMECUPOMCONFABERTO NUMBER(1,0) ) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210521_1729__mantis21768.sql b/src/db/migration/migration/V20210521_1729__mantis21768.sql new file mode 100644 index 000000000..5e0d354b8 --- /dev/null +++ b/src/db/migration/migration/V20210521_1729__mantis21768.sql @@ -0,0 +1,17 @@ +declare +begin + execute immediate + 'INSERT INTO PERFIL_FUNCION (PERFILFUNCION_ID, PERFIL_ID, FUNCIONSISTEMA_ID, ACTIVO, FECMODIF, USUARIO_ID, INDLECTURA) + SELECT + PERFIL_FUNCION_SEQ.NEXTVAL as PERFILFUNCION_ID, + p.PERFIL_ID, + (SELECT FUNCIONSISTEMA_ID FROM FUNCION_SISTEMA fs WHERE fs.DESCRUTA = ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITEN.MAPAVIAGEM'') AS FUNCIONSISTEMA_ID, + 1 as ACTIVO, + SYSDATE AS FECMODIF, + -2 AS USUARIO_ID, + 0 AS INDLECTURA + FROM PERFIL p + WHERE p.ACTIVO = 1 + AND NOT EXISTS(SELECT * FROM PERFIL_FUNCION WHERE FUNCIONSISTEMA_ID = (SELECT FUNCIONSISTEMA_ID FROM FUNCION_SISTEMA fs WHERE fs.DESCRUTA = ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITEN.MAPAVIAGEM''))'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210524_1120__mantis22352.sql b/src/db/migration/migration/V20210524_1120__mantis22352.sql new file mode 100644 index 000000000..a11e3b684 --- /dev/null +++ b/src/db/migration/migration/V20210524_1120__mantis22352.sql @@ -0,0 +1,122 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE CONEXION_RUTA_CONF + (CONEXIONRUTACONF_ID NUMBER(7,0) NOT NULL ENABLE, + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + DESCRICAO VARCHAR2(100), + PRIMARY KEY (CONEXIONRUTACONF_ID) ENABLE + )'; + exception when object_exists then null; +end; + + +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONEXION_RUTA_CONF_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; + +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD CONSTRAINT FK_CONEXION_RUTA_CONF FOREIGN KEY (CONEXIONRUTACONF_ID) + REFERENCES CONEXION_RUTA_CONF(CONEXIONRUTACONF_ID)'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (TIEMPOMIN NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (TIEMPOMAX NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; + +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTAEXCEPCIONTIPOPTA ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_EXCEPCION_PTOVTA ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION_RUTAEXCEPCIONTIPOPTA ADD CONSTRAINT FK_CONEXION_RUTACONF_TPPTA FOREIGN KEY (CONEXIONRUTACONF_ID) + REFERENCES CONEXION_RUTA_CONF(CONEXIONRUTACONF_ID)'; + exception when column_exists then null; +end; +/ + + +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_EXCEPCION_PTOVTA ADD CONSTRAINT FK_CONEXION_RUTACONF_PTOVTA FOREIGN KEY (CONEXIONRUTACONF_ID) + REFERENCES CONEXION_RUTA_CONF(CONEXIONRUTACONF_ID)'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210526_1200__mantis22413.sql b/src/db/migration/migration/V20210526_1200__mantis22413.sql new file mode 100644 index 000000000..f40331d6f --- /dev/null +++ b/src/db/migration/migration/V20210526_1200__mantis22413.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_TRAMO_CTRL ADD RUTA_ID NUMBER(7)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210526_1915__mantis22386.sql b/src/db/migration/migration/V20210526_1915__mantis22386.sql new file mode 100644 index 000000000..06b1a7921 --- /dev/null +++ b/src/db/migration/migration/V20210526_1915__mantis22386.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD CONEXIONCTRL_ID NUMBER(15)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD CONEXIONCTRL_ID NUMBER(15)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210526_1933__mantis22413.sql b/src/db/migration/migration/V20210526_1933__mantis22413.sql new file mode 100644 index 000000000..7bd77199c --- /dev/null +++ b/src/db/migration/migration/V20210526_1933__mantis22413.sql @@ -0,0 +1,31 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION MODIFY CONEXIONRUTATRAMOCTRL_ID NUMBER(15,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_TRAMO_CTRL MODIFY CONEXIONRUTATRAMOCTRL_ID NUMBER(15,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL MODIFY CONEXIONRUTACTRL_ID NUMBER(15,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_TRAMO_CTRL MODIFY CONEXIONRUTACTRL_ID NUMBER(15,0)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210526_1944__mantis22413.sql b/src/db/migration/migration/V20210526_1944__mantis22413.sql new file mode 100644 index 000000000..4ff757e19 --- /dev/null +++ b/src/db/migration/migration/V20210526_1944__mantis22413.sql @@ -0,0 +1,17 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'ALTER SEQUENCE CONEXION_RUTA_CTRL_SEQ MAXVALUE 999999999999999'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'ALTER SEQUENCE CONEXION_RUTA_TRAMO_CTRL_SEQ MAXVALUE 999999999999999'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210531_0720__mantis21998.sql b/src/db/migration/migration/V20210531_0720__mantis21998.sql new file mode 100644 index 000000000..4dd33d44b --- /dev/null +++ b/src/db/migration/migration/V20210531_0720__mantis21998.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''VDA > CAIXA > DETALHE DE CAIXA > PERMITE VISUALIZAR VALOR EM CAIXA'', + ''COM.RJCONSULTORES.VENTABOLETOS.WEB.UTILERIAS.MENU.ITEM.CORTETURNO.PERMITEVISUALIZARVALOREMCAIXA'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210604_1142__Mantis22332.sql b/src/db/migration/migration/V20210604_1142__Mantis22332.sql new file mode 100644 index 000000000..fd7076f01 --- /dev/null +++ b/src/db/migration/migration/V20210604_1142__Mantis22332.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA MODIFY (DESCPROCON VARCHAR2(120))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210607_1425__mantis22391.sql b/src/db/migration/migration/V20210607_1425__mantis22391.sql new file mode 100644 index 000000000..b091db9da --- /dev/null +++ b/src/db/migration/migration/V20210607_1425__mantis22391.sql @@ -0,0 +1,27 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''HOST_SMARTCARD'', ''HOST_SMARTCARD'', ''localhost'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''PASSWORD_SMARTCARD'', ''SENHA DO CERTIFICADO DIGITAL'', ''czar2021'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''ALIAS_SMARTCARD'', ''NOME DO CERTIFICADO DIGITAL'', ''F5RHNET.gab.local'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''PORT_SMARTCARD'', ''PORT_SMARTCARD'', ''5252'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210607_1430__mantis22406.sql b/src/db/migration/migration/V20210607_1430__mantis22406.sql new file mode 100644 index 000000000..fa6b2aeeb --- /dev/null +++ b/src/db/migration/migration/V20210607_1430__mantis22406.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''VDA > CENTRAL DE EMISSAO > CENTRAL DE EMISSAO VENDA EMBARCADA'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUCENTRALEMISSAOVENDAEMBARCADA'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210611_1741__Mantis22459.sql b/src/db/migration/migration/V20210611_1741__Mantis22459.sql new file mode 100644 index 000000000..3d748a709 --- /dev/null +++ b/src/db/migration/migration/V20210611_1741__Mantis22459.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE MODIFY (PREDBC VARCHAR2(6))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210617_1759__mantis19598.sql b/src/db/migration/migration/V20210617_1759__mantis19598.sql new file mode 100644 index 000000000..4d7e922b2 --- /dev/null +++ b/src/db/migration/migration/V20210617_1759__mantis19598.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CHECKIN_AUTOMATICO ADD IMEI_EMBARCADA VARCHAR(20)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CHECKIN_CERRADO ADD IMEI_EMBARCADA VARCHAR(20)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210621_1606__mantis22268.sql b/src/db/migration/migration/V20210621_1606__mantis22268.sql new file mode 100644 index 000000000..98737492f --- /dev/null +++ b/src/db/migration/migration/V20210621_1606__mantis22268.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD (RUTA_DESTINOC_ID NUMBER(7,0))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20210621_1639__api19.sql b/src/db/migration/migration/V20210621_1639__api19.sql new file mode 100644 index 000000000..c350fa629 --- /dev/null +++ b/src/db/migration/migration/V20210621_1639__api19.sql @@ -0,0 +1,34 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE EMPRESA_EMAIL_ECOMERCE ( + EMPRESAEMAILECOMERCE_ID INTEGER NOT NULL PRIMARY KEY, + EMPRESA_ID INTEGER NOT NULL, + SMTP VARCHAR2(100) NOT NULL, + SENHA VARCHAR2(100) NOT NULL, + SMTPPORTA VARCHAR2(100) NOT NULL, + SMTPEMAIL VARCHAR2(100) NOT NULL, + ACTIVO INTEGER NOT NULL, + FECMODIF DATE NOT NULL, + USUARIO_ID INTEGER NOT NULL, + TEXTOEMAIL VARCHAR2(4000) , + TEXTOCUPOMEMBARQUE VARCHAR2(4000), + ASSUNTO VARCHAR2(100), + EMAILDE VARCHAR2(100) NOT NULL, + EMAILCOPIAOCULTA VARCHAR2(100), + TIPOOPERACAO INTEGER NOT NULL + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE EMPRESA_EMAIL_ECOMERCE_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210623_0929__api23.sql b/src/db/migration/migration/V20210623_0929__api23.sql new file mode 100644 index 000000000..b78a58c8f --- /dev/null +++ b/src/db/migration/migration/V20210623_0929__api23.sql @@ -0,0 +1,24 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE TIPO_TERMO ( + TIPOTERMO_ID INTEGER NOT NULL PRIMARY KEY, + DESCTIPOTERMO VARCHAR2(200), + FECMODIF DATE NOT NULL, + ACTIVO INTEGER NOT NULL, + USUARIO_ID INTEGER NOT NULL + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE TIPO_TERMO_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210623_0930__api23.sql b/src/db/migration/migration/V20210623_0930__api23.sql new file mode 100644 index 000000000..76c6e0793 --- /dev/null +++ b/src/db/migration/migration/V20210623_0930__api23.sql @@ -0,0 +1,27 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE TERMOS_ECOMERCE ( + TERMOSECOMERCE_ID INTEGER NOT NULL PRIMARY KEY, + EMPRESA_ID INTEGER NOT NULL, + TEXTOTERMO VARCHAR2(4000), + TIPOTERMO_ID INTEGER NOT NULL, + ACTIVO INTEGER NOT NULL, + FECMODIF DATE NOT NULL, + USUARIO_ID INTEGER NOT NULL, + CONSTRAINT FK_TIPO_TERMO FOREIGN KEY (TIPOTERMO_ID) REFERENCES TIPO_TERMO(TIPOTERMO_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE TERMOS_ECOMERCE_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210627_1753__mantis22408.sql b/src/db/migration/migration/V20210627_1753__mantis22408.sql new file mode 100644 index 000000000..3a123e429 --- /dev/null +++ b/src/db/migration/migration/V20210627_1753__mantis22408.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 2, ''VDA > RECEITA/DESPESA > CANCELAR RECARGA CELULAR'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUCANCELARECARGACELULAR'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210630_1150__api27.sql b/src/db/migration/migration/V20210630_1150__api27.sql new file mode 100644 index 000000000..705efdf02 --- /dev/null +++ b/src/db/migration/migration/V20210630_1150__api27.sql @@ -0,0 +1,24 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE PARAMETROS_ECOMERCE ( + PARAMETROSECOMERCE_ID INTEGER NOT NULL PRIMARY KEY, + CHAVE VARCHAR2(100) NOT NULL, + VALOR VARCHAR2(100) NOT NULL, + ACTIVO INTEGER NOT NULL, + FECMODIF DATE NOT NULL + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE PARAMETROS_ECOMERCE_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210704_1531__mantis22225.sql b/src/db/migration/migration/V20210704_1531__mantis22225.sql new file mode 100644 index 000000000..d90ae9a0b --- /dev/null +++ b/src/db/migration/migration/V20210704_1531__mantis22225.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FECHAMENTO_CNTCORRENTE ADD (INDINTEGRADOSAP NUMBER(1) )'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210705_1412__mantis22115.sql b/src/db/migration/migration/V20210705_1412__mantis22115.sql new file mode 100644 index 000000000..d0d249d47 --- /dev/null +++ b/src/db/migration/migration/V20210705_1412__mantis22115.sql @@ -0,0 +1,31 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDICEIRK NUMBER(8,2) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM > RELATORIOS > OPERACIONAIS >> RELATORIO IRK'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOIRK'', 1, + SYSDATE, -1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210706_2021__mantis22225.sql b/src/db/migration/migration/V20210706_2021__mantis22225.sql new file mode 100644 index 000000000..94fd304b7 --- /dev/null +++ b/src/db/migration/migration/V20210706_2021__mantis22225.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIOS > INTEGRACAO > SAP'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOSAP'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210707_1722__Mantis22407.sql b/src/db/migration/migration/V20210707_1722__Mantis22407.sql new file mode 100644 index 000000000..d3ac59a1c --- /dev/null +++ b/src/db/migration/migration/V20210707_1722__Mantis22407.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR DROP (PRODUCT_ID)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR ADD (PRODUCT_ID VARCHAR2(20))'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210712_1729__mantis22353.sql b/src/db/migration/migration/V20210712_1729__mantis22353.sql new file mode 100644 index 000000000..d3c048e71 --- /dev/null +++ b/src/db/migration/migration/V20210712_1729__mantis22353.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD INDRESTRICAODINAMICA NUMBER(1,0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20210714_1639__mantis22299.sql b/src/db/migration/migration/V20210714_1639__mantis22299.sql new file mode 100644 index 000000000..9b75b9f24 --- /dev/null +++ b/src/db/migration/migration/V20210714_1639__mantis22299.sql @@ -0,0 +1,14 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); + +begin + execute immediate 'INSERT INTO funcion_sistema VALUES (funcion_sistema_seq.NEXTVAL, 1, ''ADM > RELATORIOS > RELATORIOS ESTATISTICOS > RELATORIO MENSAL DAER'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOMENSALDAER'', 1, SYSDATE, 1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210720_1536__mantis22205.sql b/src/db/migration/migration/V20210720_1536__mantis22205.sql new file mode 100644 index 000000000..a003c5448 --- /dev/null +++ b/src/db/migration/migration/V20210720_1536__mantis22205.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDSEGUROOPCIONALW2DIGITAL NUMBER(1,0) DEFAULT 0 NOT NULL'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210726_1718__mantis23356.sql b/src/db/migration/migration/V20210726_1718__mantis23356.sql new file mode 100644 index 000000000..38f2303e8 --- /dev/null +++ b/src/db/migration/migration/V20210726_1718__mantis23356.sql @@ -0,0 +1,8 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE PRICING_ESPECIFICO ADD (DATAINICIOVIAGEM DATE, DATAFIMVIAGEM DATE, DATAINICIOVENDA DATE, DATAFIMVENDA DATE, + DOMINGO NUMBER(1,0), SEGUNDA NUMBER(1,0), TERCA NUMBER(1,0), QUARTA NUMBER(1,0), QUINTA NUMBER(1,0), SEXTA NUMBER(1,0), SABADO NUMBER(1,0))'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210727_1555__api34.sql b/src/db/migration/migration/V20210727_1555__api34.sql new file mode 100644 index 000000000..232c9f56c --- /dev/null +++ b/src/db/migration/migration/V20210727_1555__api34.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE ESQUECEU_SENHA_ECOMERCE ( + ESQUECEUSENHAECOMERCE_ID INTEGER NOT NULL, + EMAIL_CLIENTE VARCHAR2(100) NOT NULL, + CODIGO VARCHAR2(10) NOT NULL, + VALIDADE DATE NOT NULL, + ACTIVO INTEGER NOT NULL, + CONSTRAINT ESQUECEU_SENHA_ECOMERCE_PK PRIMARY KEY (ESQUECEUSENHAECOMERCE_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE ESQUECEU_SENHA_ECOMERCE_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210727_1611__api34.sql b/src/db/migration/migration/V20210727_1611__api34.sql new file mode 100644 index 000000000..626c8fc73 --- /dev/null +++ b/src/db/migration/migration/V20210727_1611__api34.sql @@ -0,0 +1,34 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE OPERACAO_ECOMERCE_EMAIL ( + OPERACAOECOMERCEEMAIL_ID INTEGER NOT NULL, + DESCOPERACAO VARCHAR2(1000) NOT NULL, + FECMODIF DATE NOT NULL, + ACTIVO INTEGER NOT NULL, + USUARIOID INTEGER NOT NULL, + CONSTRAINT OPERACAO_ECOMERCE_EMAIL_PK PRIMARY KEY (OPERACAOECOMERCEEMAIL_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE OPERACAO_ECOMERCE_EMAIL_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -02275); +begin + execute immediate + 'ALTER TABLE EMPRESA_EMAIL_ECOMERCE ADD CONSTRAINT FK_OPERACAO_ECOMERCE_EMAIL FOREIGN KEY (TIPOOPERACAO) REFERENCES OPERACAO_ECOMERCE_EMAIL(OPERACAOECOMERCEEMAIL_ID)'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210728_1448__mantis22355.sql b/src/db/migration/migration/V20210728_1448__mantis22355.sql new file mode 100644 index 000000000..6b1abe192 --- /dev/null +++ b/src/db/migration/migration/V20210728_1448__mantis22355.sql @@ -0,0 +1,14 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) +values (FUNCION_SISTEMA_SEQ.nextval,''1'',''ADM > PRICING > RELATORIO PRICING ESPECIFICO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MENU.RELATORIOPRICINGESPECIFICO'', +''1'',sysdate,''-1'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210729_0930__mantis22258.sql b/src/db/migration/migration/V20210729_0930__mantis22258.sql new file mode 100644 index 000000000..5a1f96c34 --- /dev/null +++ b/src/db/migration/migration/V20210729_0930__mantis22258.sql @@ -0,0 +1,14 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); + +begin + execute immediate 'INSERT INTO funcion_sistema VALUES (funcion_sistema_seq.NEXTVAL, 1, ''ADM > ADM DE PRECO > MODIFICACAO MASSIVA - EMBARCADA'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.MODIFICACIONMASIVAEMBARCADA'', 1, SYSDATE, 1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210803_1553__mantis21498.sql b/src/db/migration/migration/V20210803_1553__mantis21498.sql new file mode 100644 index 000000000..6665d5b34 --- /dev/null +++ b/src/db/migration/migration/V20210803_1553__mantis21498.sql @@ -0,0 +1,14 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO GP_PRICING_BEN_CL_TARI(PRICINGBENCLTARI_ID,NOMEBENEFICIO,DESCBENEFICIO,USUARIO_ID,FECMODIF,ACTIVO) + VALUES (GP_PRICING_BEN_C_TAR_CTRL_SEQ.NEXTVAL, ''ISENCAO_POLTRONA'',''No pagamento da marcao de poltrona'',-1,SYSDATE,1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; diff --git a/src/db/migration/migration/V20210803_1720__mantis22864.sql b/src/db/migration/migration/V20210803_1720__mantis22864.sql new file mode 100644 index 000000000..0c6254913 --- /dev/null +++ b/src/db/migration/migration/V20210803_1720__mantis22864.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (TIEMPOACTIVAR NUMBER(7, 0) )'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO MODIFY (TIEMPODESACTIVAR NUMBER(7, 0) )'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20210805_1046__mantis22815.sql b/src/db/migration/migration/V20210805_1046__mantis22815.sql new file mode 100644 index 000000000..797d2db0e --- /dev/null +++ b/src/db/migration/migration/V20210805_1046__mantis22815.sql @@ -0,0 +1,49 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE RUTA ADD STATUS_AUTORIZADORA NUMBER(2,0) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE RUTA_EMPRESA ADD EMPRESA_AUTORIZADORA_ID NUMBER(7,0) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values + (FUNCION_SISTEMA_SEQ.NEXTVAL,''2'',''ADM > ESQUEMA OPERACIONAL > MANUTENCAO OPERACAO DE LINHAS'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.AUTORIZACAORUTA'',''1'',SYSDATE,''1'')'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + + diff --git a/src/db/migration/migration/V20210812_1522__mantis22989.sql b/src/db/migration/migration/V20210812_1522__mantis22989.sql new file mode 100644 index 000000000..294dd94d4 --- /dev/null +++ b/src/db/migration/migration/V20210812_1522__mantis22989.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD INDBLOQUEIOREMARCADO NUMBER(1)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210818_1153__mantis22762.sql b/src/db/migration/migration/V20210818_1153__mantis22762.sql new file mode 100644 index 000000000..67df55c1a --- /dev/null +++ b/src/db/migration/migration/V20210818_1153__mantis22762.sql @@ -0,0 +1,69 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''BUSINESS_UNIT_TPI'', ''ID DA UNIDADE DE NEGOCIO CADASTRADA NO RAAS'', ''rj'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''TENANT_TPI'', ''tenant do cliente'', ''rjconsultores'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''USER_TPI'', ''usuario cadastrado no raas'', '''', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''PASS_TPI'', ''senha do usuario cadastrado no raas'', '''', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''CLIENT_ID_TPI'', ''Id do cliente de acesso ao TPI'', ''totvs_pagamento_digital_totalbus'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''SECRET_TPI'', ''Secret do cliente de acesso ao TPI'', ''404c1e92-310c-47d4-9698-250a99bfa8fc'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''CARTEIRA_TPI'', ''Carteira do cliente de acesso ao TPI'', ''shipaypagador'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ + declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''CAIXA_ID_TPI'', ''Id do caixa cadastrado no TPI'', ''CAIXA001'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''URL_AUTENTICACAO_TPI'', ''Url de autenticao dos servios TPI'', ''rac.staging.totvs.app'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''URL_SERVICO_TPI'', ''Url dos servios TPI'', ''staging.raas.varejo.totvs.com.br'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210818_1431__mantis22762.sql b/src/db/migration/migration/V20210818_1431__mantis22762.sql new file mode 100644 index 000000000..342f4a90e --- /dev/null +++ b/src/db/migration/migration/V20210818_1431__mantis22762.sql @@ -0,0 +1,33 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA > TPI >> CANCELAR TRANSACAO'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUTPICANCELARTRANSACAO'', 1, + SYSDATE, 1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + +/ + +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA > TPI >> REIMPRESSAO COMPROVANTE'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUTPIREIMPRESSAO'', 1, + SYSDATE, 1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210820_1427__mantis22870.sql b/src/db/migration/migration/V20210820_1427__mantis22870.sql new file mode 100644 index 000000000..25f8380b4 --- /dev/null +++ b/src/db/migration/migration/V20210820_1427__mantis22870.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 2, ''VDA > PAYGO >> ESTORNAR TRANSAO'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUESTORNOTRANSACAO'', 1, + SYSDATE)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; diff --git a/src/db/migration/migration/V20210823_1813__jira283.sql b/src/db/migration/migration/V20210823_1813__jira283.sql new file mode 100644 index 000000000..cc914d647 --- /dev/null +++ b/src/db/migration/migration/V20210823_1813__jira283.sql @@ -0,0 +1,26 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE GP_PRICING_PRIORIDADE + (PRICINGPRIORIDADE_ID NUMBER(7,0) NOT NULL ENABLE, + RUTA_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT PK_GP_PRICING_PRIORIDADE PRIMARY KEY (PRICINGPRIORIDADE_ID) + )'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE GP_PRICING_PRIORIDADE_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20210825_1156__jira283.sql b/src/db/migration/migration/V20210825_1156__jira283.sql new file mode 100644 index 000000000..a41ea0dce --- /dev/null +++ b/src/db/migration/migration/V20210825_1156__jira283.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (PORCENTAJEEXTRA NUMBER(7,2))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (TIPOEVENTOEXTRA_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210827_1053__mantis22773.sql b/src/db/migration/migration/V20210827_1053__mantis22773.sql new file mode 100644 index 000000000..bf11ea0f4 --- /dev/null +++ b/src/db/migration/migration/V20210827_1053__mantis22773.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD TAXA_CONVENIENCIA_SVI NUMBER(7,2)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD TAXA_CONVENIENCIA_SVI NUMBER(7,2)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210828_1256__mantis23104.sql b/src/db/migration/migration/V20210828_1256__mantis23104.sql new file mode 100644 index 000000000..f6e644a2c --- /dev/null +++ b/src/db/migration/migration/V20210828_1256__mantis23104.sql @@ -0,0 +1,45 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE NUMERO_DA_SORTE_CTRL + ( + NUMERODASORTECTRL_ID NUMBER(7, 0) NOT NULL + , NOME_PROMOCAO VARCHAR2(50 BYTE) + , DATA_INICIO_VIGENCIA DATE + , DATA_FINAL_VIGENCIA DATE + , ACTIVO NUMBER(1,0) + , FECMODIF DATE + , USUARIO_ID NUMBER(7,0) + , NUMERO_MAXIMO NUMBER(7, 0) + , CONSTRAINT NUMERODASORTECTRL_PK PRIMARY KEY ( NUMERODASORTECTRL_ID ) ENABLE ) '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE NUMERO_DA_SORTE_CTRL_SEQ'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE NUMERO_DA_SORTE_1_SEQ NOCACHE'; + exception when object_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (NUMERO_DA_SORTE NUMBER(7,0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20210908_1520__mantis22635.sql b/src/db/migration/migration/V20210908_1520__mantis22635.sql new file mode 100644 index 000000000..e164ea0e2 --- /dev/null +++ b/src/db/migration/migration/V20210908_1520__mantis22635.sql @@ -0,0 +1,16 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values + (FUNCION_SISTEMA_SEQ.NEXTVAL,''2'',''VDA > VENDA >> CONFIMRACAO RESERVA >> EXIBE IMP. POSTERIOR'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.CONFIRMACAORESERVA.PERMITEIMPPOSTERIOR'',''1'',SYSDATE,''1'')'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; diff --git a/src/db/migration/migration/V20210909_1038__mantis22773.sql b/src/db/migration/migration/V20210909_1038__mantis22773.sql new file mode 100644 index 000000000..79946d945 --- /dev/null +++ b/src/db/migration/migration/V20210909_1038__mantis22773.sql @@ -0,0 +1,23 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (TAXA_CONVENIENCIA_SVI NUMBER(7,2))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (PUNTO_VENTA_ID_SVI NUMBER(7,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (PUNTO_VENTA_ID_SVI NUMBER(7,0))'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20210910_1052__mantis23227.sql b/src/db/migration/migration/V20210910_1052__mantis23227.sql new file mode 100644 index 000000000..dd166c081 --- /dev/null +++ b/src/db/migration/migration/V20210910_1052__mantis23227.sql @@ -0,0 +1,45 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE COMISSAO_LOG ( + COMISSAOLOG_ID NUMBER(15) NOT NULL, + EMPRESA_ID NUMBER(7) NULL, + PUNTOVENTA_ID NUMBER(7) NULL, + USUARIO_ID NUMBER(7) NULL, + FECCORTE DATE NULL, + TURNO_ID NUMBER(2) NULL, + CAJA_ID NUMBER(15) NULL, + CAJADIVERSOS_ID NUMBER(15) NULL, + PORC_COMISSAO NUMBER(5,2) NULL, + VALOR_BASE NUMBER(10,2) NULL, + VALOR_COMISSAO NUMBER(10,2) NULL, + ACTIVO NUMBER(1) NULL, + ORIGEM VARCHAR2(20) NULL, + TEXTO VARCHAR2(500) NULL, + FECMODIF DATE NULL, + PRIMARY KEY (COMISSAOLOG_ID), + FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA, + FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE COMISSAO_LOG_SEQ MINVALUE 1 MAXVALUE 999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE INDEX IDX_COMISSAO_LOG ON COMISSAO_LOG (EMPRESA_ID, PUNTOVENTA_ID, USUARIO_ID, FECCORTE, TURNO_ID)'; + exception when object_exists then null; +end; diff --git a/src/db/migration/migration/V20210910_1120__mantis22704.sql b/src/db/migration/migration/V20210910_1120__mantis22704.sql new file mode 100644 index 000000000..e80bca586 --- /dev/null +++ b/src/db/migration/migration/V20210910_1120__mantis22704.sql @@ -0,0 +1,56 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values + (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > CONFIGURAO COMERCIAL >> GERADOR DE CONTRATOS'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.GERADORCONTRATOS'',''1'',SYSDATE,''1'')'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; + +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE CONF_CONTRATO_PUNTOVENTA ( + CONF_CONTRATO_PUNTOVENTA_ID NUMBER(7) NOT NULL, + TEXTOCONTRATOPRAZO CLOB, + TEXTOCONTRATOAVISTA CLOB, + ACTIVO NUMBER(1) NULL, + USUARIO_ID NUMBER(7) NULL, + FECMODIF DATE NULL, + PRIMARY KEY (CONF_CONTRATO_PUNTOVENTA_ID) + )'; + exception when object_exists then null; +end; + + +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONFCONTRATOPUNTOVENTA_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; + +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA ADD (TIPO_SOCIO VARCHAR(20))'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210914_1522__Mantis23073.sql b/src/db/migration/migration/V20210914_1522__Mantis23073.sql new file mode 100644 index 000000000..a07cb2c15 --- /dev/null +++ b/src/db/migration/migration/V20210914_1522__Mantis23073.sql @@ -0,0 +1,21 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MONEDA ADD (SIMBOLO VARCHAR2(3))'; + exception when column_exists then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE MONEDA SET SIMBOLO = ''R$'' WHERE MONEDA_ID = 1 '; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210921_1020__mantis23184.sql b/src/db/migration/migration/V20210921_1020__mantis23184.sql new file mode 100644 index 000000000..10f9a45a4 --- /dev/null +++ b/src/db/migration/migration/V20210921_1020__mantis23184.sql @@ -0,0 +1,42 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE TABLE EMPRESA_SAFER_CONFIG +( + EMPRESASAFERCONFIG_ID NUMBER(7, 0) NOT NULL +, EMPRESA_ID NUMBER(7, 0) +, PARTNERID VARCHAR2(100 BYTE) +, CONTRACTID VARCHAR2(100 BYTE) +, SENHA VARCHAR2(50 BYTE) +, CERTIFICADO BLOB +, ACTIVO NUMBER(1,0) +, FECMODIF DATE +, USUARIO_ID NUMBER(7,0) +, CONSTRAINT EMPRESA_SAFER_CONFIG_PK PRIMARY KEY + ( + EMPRESASAFERCONFIG_ID + ) + ENABLE +) '; + + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE EMPRESA_SAFER_CONFIG_SEQ'; + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PRICING ADD INDSAFER NUMBER(1,0)'; + exception when column_exists then null; +end; diff --git a/src/db/migration/migration/V20210930_1652__mantis23332.sql b/src/db/migration/migration/V20210930_1652__mantis23332.sql new file mode 100644 index 000000000..1e364cb4b --- /dev/null +++ b/src/db/migration/migration/V20210930_1652__mantis23332.sql @@ -0,0 +1,7 @@ +declare + begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''ORGAO_CONCEDENTE_BPE_AGEPAN_MS'', ''ID DO ORGAO CONCEDENTE BPE AGEPAN - MS'', '''', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when others then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20210930_1858__mantis23156.sql b/src/db/migration/migration/V20210930_1858__mantis23156.sql new file mode 100644 index 000000000..689cb7180 --- /dev/null +++ b/src/db/migration/migration/V20210930_1858__mantis23156.sql @@ -0,0 +1,16 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE PUNTO_VENTA add INDQRCODETAXAEMBARQUERODTTL number(1)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20211004_0928__mantis23282.sql b/src/db/migration/migration/V20211004_0928__mantis23282.sql new file mode 100644 index 000000000..44d50ba84 --- /dev/null +++ b/src/db/migration/migration/V20211004_0928__mantis23282.sql @@ -0,0 +1,13 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'insert into funcion_sistema (funcionsistema_id,sistema_id,nombfuncion,descruta,activo,fecmodif,usuario_id) values + (funcion_sistema_seq.nextval,2,''VDA > CAIXA > CONSULTA DE BILHETES > VENDA ACOPLADA DE SEGURO OPCIOANAL W2DIGITAL'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.CONSULTABOLETO.VENDAACOPLADASEGUROOPCIONALW2DIGITAL'',1,sysdate,1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20211005_1425__mantis23333.sql b/src/db/migration/migration/V20211005_1425__mantis23333.sql new file mode 100644 index 000000000..b1b228c49 --- /dev/null +++ b/src/db/migration/migration/V20211005_1425__mantis23333.sql @@ -0,0 +1,24 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA_COD_ORGAOCONCEDENTE ADD (ACTIVO NUMBER(1,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA_COD_ORGAOCONCEDENTE ADD (FECMODIF DATE)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE PARADA_COD_ORGAOCONCEDENTE ADD (USUARIO_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20211006_1045__mantis23034.sql b/src/db/migration/migration/V20211006_1045__mantis23034.sql new file mode 100644 index 000000000..48cba165b --- /dev/null +++ b/src/db/migration/migration/V20211006_1045__mantis23034.sql @@ -0,0 +1,109 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_SERVICO_EXTRA_AUTOMATICO'',''CRON_ROTINA_SERVICO_EXTRA_AUTOMATICO'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (ISAUTOMACAOHORARIOEXTRA NUMBER(1,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (TAXA_OCUPACAO NUMBER(7,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (HORAS_AUTOMACAO_HE_DE NUMBER(7,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD ( MINUTOS_AUTOMACAO_HE_DE NUMBER(7,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (HORAS_AUTOMACAO_HE_ATE NUMBER(7,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (MINUTOS_AUTOMACAO_HE_ATE NUMBER(7,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (MINUTOS_AUTOMACAO_HE_ATE NUMBER(7,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (BLOQUEIAINTERNET_HE NUMBER(1,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (NUMCORRIDA_SERVICOEXTRA NUMBER(7,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (ROLOPERATIVO_SERVICOEXTRA_ID NUMBER(7,0))'; + exception + when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA ADD (PLATAFORMASERVICOEXTRA VARCHAR2(40 BYTE))'; + exception + when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20211015_1113__mantis23444.sql b/src/db/migration/migration/V20211015_1113__mantis23444.sql new file mode 100644 index 000000000..e46bef6ab --- /dev/null +++ b/src/db/migration/migration/V20211015_1113__mantis23444.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (ASIENTOS_LIBRES NUMBER(5), ASIENTOS_OCUP NUMBER(5))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (ASIENTOS_LIBRES NUMBER(5), ASIENTOS_OCUP NUMBER(5))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20211021_1020__mantis23106.sql b/src/db/migration/migration/V20211021_1020__mantis23106.sql new file mode 100644 index 000000000..d2e1a92d2 --- /dev/null +++ b/src/db/migration/migration/V20211021_1020__mantis23106.sql @@ -0,0 +1,74 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE RESERVA_ESPECIAL_CLIENTE + (RESERVAESPECIALCLIENTE_ID NUMBER(7,0) NOT NULL ENABLE, + CLIENTE_ID NUMBER(7,0), + CORRIDA_ID NUMBER(7,0), + ORIGEM_ID NUMBER(7,0), + DESTINO_ID NUMBER(7,0), + FECINICIO DATE, + FECFINAL DATE, + TEMPOCONFIRMACAO DATE, + NUMASENTOCORRIDA NUMBER(3,0), + INDSEGUNDA NUMBER(1,0), + INDTERCA NUMBER(1,0), + INDQUARTA NUMBER(1,0), + INDQUINTA NUMBER(1,0), + INDSEXTA NUMBER(1,0), + INDSABADO NUMBER(1,0), + INDDOMINGO NUMBER(1,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + PRIMARY KEY (RESERVAESPECIALCLIENTE_ID) ENABLE, + CONSTRAINT FK_USUARIO_ID_RESERVA_ESPECIAL FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO (USUARIO_ID), + CONSTRAINT FK_CLIENTE_ID_RESERVA_ESPECIAL FOREIGN KEY (CLIENTE_ID) REFERENCES CLIENTE (CLIENTE_ID), + CONSTRAINT FK_ORIGEM_ID_RESERVA_ESPECIAL FOREIGN KEY (ORIGEM_ID) REFERENCES PARADA (PARADA_ID), + CONSTRAINT FK_DESTINO_ID_RESERVA_ESPECIAL FOREIGN KEY (DESTINO_ID) REFERENCES PARADA (PARADA_ID) + )'; + exception when object_exists then null; +end; + + +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE RESERVA_ESPECIAL_CLIENTE_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; + +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''ESTACION_RESERVA_CLIENTES'', ''ESTACION_RESERVA_CLIENTES'', ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''PUNTOVENTA_RESERVA_CLIENTES'', ''PUNTOVENTA_RESERVA_CLIENTES'', ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, + INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''USUARIO_RESERVA_CLIENTES'', ''USUARIO_RESERVA_CLIENTES'', + ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20211021_1816__mantis23486.sql b/src/db/migration/migration/V20211021_1816__mantis23486.sql new file mode 100644 index 000000000..014bd2344 --- /dev/null +++ b/src/db/migration/migration/V20211021_1816__mantis23486.sql @@ -0,0 +1,8 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table CONVENIO_HIST modify CONVENIOHIST_ID number(15,0)'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/migration/V20211025_1020__mantis23350.sql b/src/db/migration/migration/V20211025_1020__mantis23350.sql new file mode 100644 index 000000000..10ee993db --- /dev/null +++ b/src/db/migration/migration/V20211025_1020__mantis23350.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''VALIDASOMENTE_NUMAUTORIZACAO_CRED_MANUAL'', ''VALIDASOMENTE_NUMAUTORIZACAO_CRED_MANUAL'', ''-1'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; diff --git a/src/db/migration/migration/V20211025_1553__mantis23090.sql b/src/db/migration/migration/V20211025_1553__mantis23090.sql new file mode 100644 index 000000000..e0f035c95 --- /dev/null +++ b/src/db/migration/migration/V20211025_1553__mantis23090.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 2, ''VDA > RECEITA/DESPESA > RECARGA PIN'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENURECARGAPIN'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20211025_1556__mantis23092.sql b/src/db/migration/migration/V20211025_1556__mantis23092.sql new file mode 100644 index 000000000..1a481b890 --- /dev/null +++ b/src/db/migration/migration/V20211025_1556__mantis23092.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'INSERT INTO funcion_sistema (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES + (funcion_sistema_seq.NEXTVAL, 2, ''VDA > RECEITA/DESPESA > RECARGA TV'', + ''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENURECARGATV'', 1, SYSDATE, 1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20211027_0925__mantis23129.sql b/src/db/migration/migration/V20211027_0925__mantis23129.sql new file mode 100644 index 000000000..b6fac4b78 --- /dev/null +++ b/src/db/migration/migration/V20211027_0925__mantis23129.sql @@ -0,0 +1,19 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD CATEGORIAINTERAGE_ID NUMBER(7)'; + exception when object_exists then null; +end; +/ +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD CONSTRAINT FK_CATEGORIAINTERAGE_ID FOREIGN KEY (CATEGORIAINTERAGE_ID) + REFERENCES CATEGORIA(CATEGORIA_ID)'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20211027_1820__mantis23534.sql b/src/db/migration/migration/V20211027_1820__mantis23534.sql new file mode 100644 index 000000000..1ee3d0a42 --- /dev/null +++ b/src/db/migration/migration/V20211027_1820__mantis23534.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_EMAIL_CONFIG ADD TIPOAUTORIZACAO VARCHAR(50)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA_EMAIL_FLEXBUS ADD TIPOAUTORIZACAO VARCHAR(50)'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20211029_1548__mantis23090.sql b/src/db/migration/migration/V20211029_1548__mantis23090.sql new file mode 100644 index 000000000..193d66e6c --- /dev/null +++ b/src/db/migration/migration/V20211029_1548__mantis23090.sql @@ -0,0 +1,88 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR ADD (TIPO_RECARGA NUMBER(2,0))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update RECARGA_CELULAR set TIPO_RECARGA = 0 where activo = 1'; + exception when object_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR ADD (AFFILIATION_KEY VARCHAR(20),SIGNER_CODE VARCHAR(20), SERIAL_NUMBER VARCHAR(20))'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_01451 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_01451 , -01451); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (CELL_PHONE_NUMBER NULL)'; + exception + when object_exists then null; + when except_00957 then null; + when except_01451 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_01451 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_01451 , -01451); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (NSU NULL)'; + exception + when object_exists then null; + when except_00957 then null; + when except_01451 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_01451 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_01451 , -01451); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (AUTHORIZATION_CODE NULL)'; + exception + when object_exists then null; + when except_00957 then null; + when except_01451 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + except_01451 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); + pragma exception_init (except_01451 , -01451); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (FACE_AMOUNT NULL)'; + exception + when object_exists then null; + when except_00957 then null; + when except_01451 then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/V20211103_1618__mantis23090.sql b/src/db/migration/migration/V20211103_1618__mantis23090.sql new file mode 100644 index 000000000..60049f65d --- /dev/null +++ b/src/db/migration/migration/V20211103_1618__mantis23090.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into TIPO_EVENTO_EXTRA (TIPOEVENTOEXTRA_ID,INDTIPO,IMPMAX,INDVALIDACORTE,INDVALIDADOCUMENTO,INDCONTRAPARTIDA,INDBOLETO,INDORDENSERVICIO,PORCIVA,FORMAPAGO_ID,USUARIO_ID,FECMODIF,ACTIVO,PARAMARTICULO2_ID,INDTIPO2,FORMAPAGO2_ID,INDOPERACION,DESCTIPOEVENTO,PROVEEDOR,IMPFISCALNUMOPERACAO,NATUREZA,CONTACONTABIL,INDCONFERENCIAFISICACOMISSAO,INDVALIDAESTOQUE,CVETIPOEVENTO,CVESISTEMA,INTEGRADOTOTVS,ERRO) + values (99996,''1'',99999.99,null,''0'',null,''0'',null,''0'',null,''1'',sysdate,''1'',null,null,null,''1'',''RECARGA PIN'',null,null,null,null,null,null,''RECARGA_PIN'',''RECARGA_PIN'',null,null)'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into TIPO_EVENTO_EXTRA (TIPOEVENTOEXTRA_ID,INDTIPO,IMPMAX,INDVALIDACORTE,INDVALIDADOCUMENTO,INDCONTRAPARTIDA,INDBOLETO,INDORDENSERVICIO,PORCIVA,FORMAPAGO_ID,USUARIO_ID,FECMODIF,ACTIVO,PARAMARTICULO2_ID,INDTIPO2,FORMAPAGO2_ID,INDOPERACION,DESCTIPOEVENTO,PROVEEDOR,IMPFISCALNUMOPERACAO,NATUREZA,CONTACONTABIL,INDCONFERENCIAFISICACOMISSAO,INDVALIDAESTOQUE,CVETIPOEVENTO,CVESISTEMA,INTEGRADOTOTVS,ERRO) + values (99995,''1'',99999.99,null,''0'',null,''0'',null,''0'',null,''1'',sysdate,''1'',null,null,null,''1'',''RECARGA TV'',null,null,null,null,null,null,''RECARGA_TV'',''RECARGA_TV'',null,null)'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20211108_0921__mantis23201.sql b/src/db/migration/migration/V20211108_0921__mantis23201.sql new file mode 100644 index 000000000..f5c188b1c --- /dev/null +++ b/src/db/migration/migration/V20211108_0921__mantis23201.sql @@ -0,0 +1,15 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values (FUNCION_SISTEMA_seq.nextval,1,''ADM > RELATORIOS > RELATORIOS ESTATISTICO > GRATUIDADE AGR'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOGRATUIDADEAGR'',1,sysdate,1)'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20211122_1622__mantis22719.sql b/src/db/migration/migration/V20211122_1622__mantis22719.sql new file mode 100644 index 000000000..ad8cc1f61 --- /dev/null +++ b/src/db/migration/migration/V20211122_1622__mantis22719.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE INSCRICAO_ESTADUAL ADD NUMINSCRICAOMUNICIPAL VARCHAR(15) DEFAULT ''ISENTO'' NOT NULL' ; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20220122_1412__mantis17692.sql b/src/db/migration/migration/V20220122_1412__mantis17692.sql new file mode 100644 index 000000000..51fc286a6 --- /dev/null +++ b/src/db/migration/migration/V20220122_1412__mantis17692.sql @@ -0,0 +1,15 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDALTPOSICAOCAMPOSCUPOM NUMBER(1,0) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20220624_1120__mantis19601.sql b/src/db/migration/migration/V20220624_1120__mantis19601.sql new file mode 100644 index 000000000..90839f8e2 --- /dev/null +++ b/src/db/migration/migration/V20220624_1120__mantis19601.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update custom set tipo = ''1'' where chave = ''MODCLI_ImprimeComprovanteCartaoImpressoraTermica'''; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/migration/V20221111_1120__mantis20505.sql b/src/db/migration/migration/V20221111_1120__mantis20505.sql new file mode 100644 index 000000000..77bcb96d5 --- /dev/null +++ b/src/db/migration/migration/V20221111_1120__mantis20505.sql @@ -0,0 +1,16 @@ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate + 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) + values + (FUNCION_SISTEMA_SEQ.NEXTVAL,''2'',''VDA > VENDA >> PASSAGEIRO >> ALTERAR LOCAL DE EMBARQUE'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.PASSAGEIROS.BTN.PERMITEALTERARLOCALEMBARQUE'',''1'',SYSDATE,''1'')'; + + exception + when dup_val_on_index then null; + when except_02291 then null; +end; diff --git a/src/db/migration/migration/V20221121_1120__mantis22352.sql b/src/db/migration/migration/V20221121_1120__mantis22352.sql new file mode 100644 index 000000000..a11e3b684 --- /dev/null +++ b/src/db/migration/migration/V20221121_1120__mantis22352.sql @@ -0,0 +1,122 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE CONEXION_RUTA_CONF + (CONEXIONRUTACONF_ID NUMBER(7,0) NOT NULL ENABLE, + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + DESCRICAO VARCHAR2(100), + PRIMARY KEY (CONEXIONRUTACONF_ID) ENABLE + )'; + exception when object_exists then null; +end; + + +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONEXION_RUTA_CONF_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; + +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD CONSTRAINT FK_CONEXION_RUTA_CONF FOREIGN KEY (CONEXIONRUTACONF_ID) + REFERENCES CONEXION_RUTA_CONF(CONEXIONRUTACONF_ID)'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (TIEMPOMIN NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (TIEMPOMAX NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; + +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTAEXCEPCIONTIPOPTA ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_EXCEPCION_PTOVTA ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION_RUTAEXCEPCIONTIPOPTA ADD CONSTRAINT FK_CONEXION_RUTACONF_TPPTA FOREIGN KEY (CONEXIONRUTACONF_ID) + REFERENCES CONEXION_RUTA_CONF(CONEXIONRUTACONF_ID)'; + exception when column_exists then null; +end; +/ + + +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_EXCEPCION_PTOVTA ADD CONSTRAINT FK_CONEXION_RUTACONF_PTOVTA FOREIGN KEY (CONEXIONRUTACONF_ID) + REFERENCES CONEXION_RUTA_CONF(CONEXIONRUTACONF_ID)'; + exception when column_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/migration/v20190914_1432__mantis15646.sql b/src/db/migration/migration/v20190914_1432__mantis15646.sql new file mode 100644 index 000000000..efe9dc466 --- /dev/null +++ b/src/db/migration/migration/v20190914_1432__mantis15646.sql @@ -0,0 +1,7 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.nextval,''1'',''VDA > AUTORIZACAO > ALTERAR QTD VENDA EM PE'',''COM.RJCONSULTORES.VENTABOLETOS.ALTERARQTDVENDAEMPE'',''1'',SYSDATE,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/svn.ico b/src/db/migration/svn.ico new file mode 100644 index 000000000..ba63376b6 Binary files /dev/null and b/src/db/migration/svn.ico differ