From 43435f61716326a1c74e31451faad1c0ffe8f9a3 Mon Sep 17 00:00:00 2001 From: wilian Date: Wed, 21 Oct 2020 20:49:36 +0000 Subject: [PATCH] bug#20203 dev:valdir qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@103887 d1611594-4594-4d17-8e1d-87c2c4800839 --- src/db/migration/V20201020_0954__mantis20203.sql | 15 +++++++++++++++ src/db/migration/V20201020_1138__mantis20203.sql | 10 ++++++++++ .../migration/V20201020_0954__mantis20203.sql | 13 +++++++++++++ .../migration/V20201020_1138__mantis20203.sql | 9 +++++++++ 4 files changed, 47 insertions(+) create mode 100644 src/db/migration/V20201020_0954__mantis20203.sql create mode 100644 src/db/migration/V20201020_1138__mantis20203.sql create mode 100644 src/db/postgresql/migration/V20201020_0954__mantis20203.sql create mode 100644 src/db/postgresql/migration/V20201020_1138__mantis20203.sql diff --git a/src/db/migration/V20201020_0954__mantis20203.sql b/src/db/migration/V20201020_0954__mantis20203.sql new file mode 100644 index 000000000..f9fc9e71b --- /dev/null +++ b/src/db/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/V20201020_1138__mantis20203.sql b/src/db/migration/V20201020_1138__mantis20203.sql new file mode 100644 index 000000000..ff2e1e2b3 --- /dev/null +++ b/src/db/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/postgresql/migration/V20201020_0954__mantis20203.sql b/src/db/postgresql/migration/V20201020_0954__mantis20203.sql new file mode 100644 index 000000000..92a532144 --- /dev/null +++ b/src/db/postgresql/migration/V20201020_0954__mantis20203.sql @@ -0,0 +1,13 @@ +DO $$ +BEGIN + ALTER TABLE PTOVTA_COMISSAO ADD COMISSAOIMPPOSTERIOR VARCHAR(20); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; +/ +DO $$ +BEGIN + update PTOVTA_COMISSAO set COMISSAOIMPPOSTERIOR = 'PADRAO' where COMISSAOIMPPOSTERIOR is null; + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20201020_1138__mantis20203.sql b/src/db/postgresql/migration/V20201020_1138__mantis20203.sql new file mode 100644 index 000000000..351bea41e --- /dev/null +++ b/src/db/postgresql/migration/V20201020_1138__mantis20203.sql @@ -0,0 +1,9 @@ +DO $$ +BEGIN + 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 duplicate_column THEN NULL; +END +$$; \ No newline at end of file