diff --git a/src/db/migration/V20200220_1055__mantis18139.sql b/src/db/migration/V20200220_1055__mantis18139.sql new file mode 100644 index 000000000..288c514d3 --- /dev/null +++ b/src/db/migration/V20200220_1055__mantis18139.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO_DET MODIFY (FORMAPAGO_ID NUMBER(2, 0))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20200220_1356__mantis18139.sql b/src/db/migration/V20200220_1356__mantis18139.sql new file mode 100644 index 000000000..0143ecccd --- /dev/null +++ b/src/db/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/postgresql/migration/V20200220_1055__mantis18139.sql b/src/db/postgresql/migration/V20200220_1055__mantis18139.sql new file mode 100644 index 000000000..76dab6e40 --- /dev/null +++ b/src/db/postgresql/migration/V20200220_1055__mantis18139.sql @@ -0,0 +1,7 @@ +DO $$ +BEGIN + ALTER TABLE FORMA_PAGO_DET ALTER COLUMN FORMAPAGO_ID TYPE NUMERIC(2,0); + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; diff --git a/src/db/postgresql/migration/V20200220_1356__mantis18139.sql b/src/db/postgresql/migration/V20200220_1356__mantis18139.sql new file mode 100644 index 000000000..cab9c2c2f --- /dev/null +++ b/src/db/postgresql/migration/V20200220_1356__mantis18139.sql @@ -0,0 +1,8 @@ +DO $$ +BEGIN + INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, INDTIPOCONSTANTE, VALORCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (NEXTVAL('constante_seq'), 'LIMITE_ID_FORMA_PAGTO', 'LIMITE_ID_FORMA_PAGTO', '1', '99', '1', '1', now(), '1'); + + EXCEPTION WHEN unique_violation THEN NULL; +END +$$;