From 2ec43ee69f8bd936559120cdc27be5aa59cc586f Mon Sep 17 00:00:00 2001 From: leonardo Date: Tue, 21 Aug 2018 18:14:03 +0000 Subject: [PATCH] 11854: alterar campo centroresultadoag no cadastro de estados para string bug#11854 dev:lucas qua:leo git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@84440 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20180813_1709__mantis11854.sql | 21 ++++++++++++++++ .../migration/V20180814_1106__mantis11854.sql | 11 +++++++++ .../migration/V20180813_1709__mantis11854.sql | 24 +++++++++++++++++++ .../migration/V20180814_1106__mantis11854.sql | 15 ++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 src/db/migration/V20180813_1709__mantis11854.sql create mode 100644 src/db/migration/V20180814_1106__mantis11854.sql create mode 100644 src/db/postgresql/migration/V20180813_1709__mantis11854.sql create mode 100644 src/db/postgresql/migration/V20180814_1106__mantis11854.sql diff --git a/src/db/migration/V20180813_1709__mantis11854.sql b/src/db/migration/V20180813_1709__mantis11854.sql new file mode 100644 index 000000000..6aa0d17e4 --- /dev/null +++ b/src/db/migration/V20180813_1709__mantis11854.sql @@ -0,0 +1,21 @@ +declare + begin + execute immediate 'ALTER TABLE ESTADO RENAME COLUMN CENTRORESULTADOSAG TO CENTRORESULTADOSAG1'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'ALTER TABLE ESTADO ADD (CENTRORESULTADOSAG VARCHAR2(20))'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'update estado set centroresultadosag = centroresultadosag1'; + exception when others then null; +end; diff --git a/src/db/migration/V20180814_1106__mantis11854.sql b/src/db/migration/V20180814_1106__mantis11854.sql new file mode 100644 index 000000000..03f0eb86c --- /dev/null +++ b/src/db/migration/V20180814_1106__mantis11854.sql @@ -0,0 +1,11 @@ +declare + begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE))'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE))'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20180813_1709__mantis11854.sql b/src/db/postgresql/migration/V20180813_1709__mantis11854.sql new file mode 100644 index 000000000..a4f0ed66c --- /dev/null +++ b/src/db/postgresql/migration/V20180813_1709__mantis11854.sql @@ -0,0 +1,24 @@ +DO $$ +BEGIN + ALTER TABLE ESTADO RENAME COLUMN CENTRORESULTADOSAG TO CENTRORESULTADOSAG1; + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + +DO $$ +BEGIN + ALTER TABLE ESTADO ADD (CENTRORESULTADOSAG VARCHAR2(20)); + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + +DO $$ +BEGIN + update estado set centroresultadosag = centroresultadosag1; + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + diff --git a/src/db/postgresql/migration/V20180814_1106__mantis11854.sql b/src/db/postgresql/migration/V20180814_1106__mantis11854.sql new file mode 100644 index 000000000..f8e6b6287 --- /dev/null +++ b/src/db/postgresql/migration/V20180814_1106__mantis11854.sql @@ -0,0 +1,15 @@ +DO $$ +BEGIN + ALTER TABLE AG_CONTAS_PAGAR MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE)); + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + +DO $$ +BEGIN + ALTER TABLE AG_CONTAS_RECEBER MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE)); + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$;