From 0366f841c21513c86e4d14f0dce69e2350f74f8b Mon Sep 17 00:00:00 2001 From: emerson Date: Tue, 22 Jan 2019 19:52:21 +0000 Subject: [PATCH] fixes bug#0013252 dev: frederico qua: marcelo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implementação efetuada. git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@89151 d1611594-4594-4d17-8e1d-87c2c4800839 --- src/db/migration/V20190122_1400__mantis13252.sql | 15 +++++++++++++++ .../migration/V20190122_1400__mantis13252.sql | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/db/migration/V20190122_1400__mantis13252.sql create mode 100644 src/db/postgresql/migration/V20190122_1400__mantis13252.sql diff --git a/src/db/migration/V20190122_1400__mantis13252.sql b/src/db/migration/V20190122_1400__mantis13252.sql new file mode 100644 index 000000000..57f33fbf2 --- /dev/null +++ b/src/db/migration/V20190122_1400__mantis13252.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE EMPRESA ADD INDEMITECANCBPETROCAORIGDEST NUMBER(1,0) DEFAULT 1'; + exception when column_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'UPDATE EMPRESA SET FECMODIF = SYSDATE'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190122_1400__mantis13252.sql b/src/db/postgresql/migration/V20190122_1400__mantis13252.sql new file mode 100644 index 000000000..19ef41f2d --- /dev/null +++ b/src/db/postgresql/migration/V20190122_1400__mantis13252.sql @@ -0,0 +1,8 @@ +DO $$ +BEGIN + ALTER TABLE EMPRESA ADD COLUMN INDEMITECANCBPETROCAORIGDEST NUMERIC(1,0) DEFAULT 1; + + EXCEPTION WHEN duplicate_column THEN NULL; + + UPDATE PARADA SET FECMODIF = CURRENT_DATE; +$$;