From 0fd9818c8075dcad707e3b058cd5b33db317e8e5 Mon Sep 17 00:00:00 2001 From: wilian Date: Mon, 15 Mar 2021 21:18:51 +0000 Subject: [PATCH] bug#21515 dev:wallace qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@105778 d1611594-4594-4d17-8e1d-87c2c4800839 --- src/db/migration/V20210311_1544__mantis21515.sql | 13 +++++++++++++ src/db/migration/V20210315_1108__mantis21515.sql | 7 +++++++ .../migration/V20210311_1544__mantis21515.sql | 13 +++++++++++++ .../migration/V20210315_1108__mantis21515.sql | 6 ++++++ 4 files changed, 39 insertions(+) create mode 100644 src/db/migration/V20210311_1544__mantis21515.sql create mode 100644 src/db/migration/V20210315_1108__mantis21515.sql create mode 100644 src/db/postgresql/migration/V20210311_1544__mantis21515.sql create mode 100644 src/db/postgresql/migration/V20210315_1108__mantis21515.sql diff --git a/src/db/migration/V20210311_1544__mantis21515.sql b/src/db/migration/V20210311_1544__mantis21515.sql new file mode 100644 index 000000000..71c6032fe --- /dev/null +++ b/src/db/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/V20210315_1108__mantis21515.sql b/src/db/migration/V20210315_1108__mantis21515.sql new file mode 100644 index 000000000..6266c8ef9 --- /dev/null +++ b/src/db/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/postgresql/migration/V20210311_1544__mantis21515.sql b/src/db/postgresql/migration/V20210311_1544__mantis21515.sql new file mode 100644 index 000000000..83e7710cf --- /dev/null +++ b/src/db/postgresql/migration/V20210311_1544__mantis21515.sql @@ -0,0 +1,13 @@ +DO $$ +BEGIN + ALTER TABLE PTOVTA_COMISSAO ADD (SEGUROOBRIGATORIOALTA NUMBER(5,2), SEGUROOBRIGATORIOBAIXA NUMBER(5,2)); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; +/ +DO $$ +BEGIN + UPDATE PTOVTA_COMISSAO SET SEGUROOBRIGATORIOALTA = PASSAGEMALTA, SEGUROOBRIGATORIOBAIXA = PASSAGEMBAIXA WHERE SEGURORECEITA = 1; + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20210315_1108__mantis21515.sql b/src/db/postgresql/migration/V20210315_1108__mantis21515.sql new file mode 100644 index 000000000..f7d875720 --- /dev/null +++ b/src/db/postgresql/migration/V20210315_1108__mantis21515.sql @@ -0,0 +1,6 @@ +DO $$ +BEGIN + ALTER TABLE COMISSAO_RECEITA ADD COMISSAO_SEG_OBRIGATORIO NUMBER(13,2); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; \ No newline at end of file