diff --git a/src/db/migration/V20190606_1033__Mantis14242.sql b/src/db/migration/V20190606_1033__Mantis14242.sql new file mode 100644 index 000000000..703097498 --- /dev/null +++ b/src/db/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/V20190708_1408__mantis14242.sql b/src/db/migration/V20190708_1408__mantis14242.sql new file mode 100644 index 000000000..e372f0f67 --- /dev/null +++ b/src/db/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/postgresql/migration/V20190606_1033__mantis14242.sql b/src/db/postgresql/migration/V20190606_1033__mantis14242.sql new file mode 100644 index 000000000..cc8a15c4c --- /dev/null +++ b/src/db/postgresql/migration/V20190606_1033__mantis14242.sql @@ -0,0 +1,6 @@ +DO $$ +BEGIN + ALTER TABLE BPE ADD (ESTACION_ID NUMBER(7)); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190708_1408__mantis14242.sql b/src/db/postgresql/migration/V20190708_1408__mantis14242.sql new file mode 100644 index 000000000..a12538aaf --- /dev/null +++ b/src/db/postgresql/migration/V20190708_1408__mantis14242.sql @@ -0,0 +1,7 @@ +DO $$ +BEGIN + insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE,VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (nextval('CONSTANTE_SEQ'),'VALIDAR_DADOS_BPE','VALIDAR_DADOS_BPE',1,'false',null,'1',now(),1); + EXCEPTION WHEN unique_violation THEN NULL; +END +$$; \ No newline at end of file