diff --git a/src/db/migration/V20211029_1548__mantis23090.sql b/src/db/migration/V20211029_1548__mantis23090.sql index ed0eb03d1..4c28ae8b9 100644 --- a/src/db/migration/V20211029_1548__mantis23090.sql +++ b/src/db/migration/V20211029_1548__mantis23090.sql @@ -22,35 +22,55 @@ begin exception when column_exists then null; end; / -declare - column_exists exception; - pragma exception_init (column_exists , -01430); -begin - execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (CELL_PHONE_NUMBER NULL)'; - exception when column_exists then null; +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (CELL_PHONE_NUMBER NULL)'; + exception + when object_exists then null; + when except_00957 then null; end; / -declare - column_exists exception; - pragma exception_init (column_exists , -01430); -begin - execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (NSU NULL)'; - exception when column_exists then null; +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (NSU NULL)'; + exception + when object_exists then null; + when except_00957 then null; end; / -declare - column_exists exception; - pragma exception_init (column_exists , -01430); -begin - execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (AUTHORIZATION_CODE NULL)'; - exception when column_exists then null; +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (AUTHORIZATION_CODE NULL)'; + exception + when object_exists then null; + when except_00957 then null; end; / -declare - column_exists exception; - pragma exception_init (column_exists , -01430); -begin - execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (FACE_AMOUNT NULL)'; - exception when column_exists then null; +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (FACE_AMOUNT NULL)'; + exception + when object_exists then null; + when except_00957 then null; end; / \ No newline at end of file diff --git a/src/db/postgresql/migration/V20211029_1548__mantis23090.sql b/src/db/postgresql/migration/V20211029_1548__mantis23090.sql index ed0eb03d1..4c28ae8b9 100644 --- a/src/db/postgresql/migration/V20211029_1548__mantis23090.sql +++ b/src/db/postgresql/migration/V20211029_1548__mantis23090.sql @@ -22,35 +22,55 @@ begin exception when column_exists then null; end; / -declare - column_exists exception; - pragma exception_init (column_exists , -01430); -begin - execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (CELL_PHONE_NUMBER NULL)'; - exception when column_exists then null; +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (CELL_PHONE_NUMBER NULL)'; + exception + when object_exists then null; + when except_00957 then null; end; / -declare - column_exists exception; - pragma exception_init (column_exists , -01430); -begin - execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (NSU NULL)'; - exception when column_exists then null; +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (NSU NULL)'; + exception + when object_exists then null; + when except_00957 then null; end; / -declare - column_exists exception; - pragma exception_init (column_exists , -01430); -begin - execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (AUTHORIZATION_CODE NULL)'; - exception when column_exists then null; +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (AUTHORIZATION_CODE NULL)'; + exception + when object_exists then null; + when except_00957 then null; end; / -declare - column_exists exception; - pragma exception_init (column_exists , -01430); -begin - execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (FACE_AMOUNT NULL)'; - exception when column_exists then null; +declare + object_exists exception; + except_00957 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE RECARGA_CELULAR MODIFY (FACE_AMOUNT NULL)'; + exception + when object_exists then null; + when except_00957 then null; end; / \ No newline at end of file diff --git a/src/db/postgresql/migration/V20211103_1618__mantis23090.sql b/src/db/postgresql/migration/V20211103_1618__mantis23090.sql new file mode 100644 index 000000000..60049f65d --- /dev/null +++ b/src/db/postgresql/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