From 9f3ff80433f4310b3ec942bde261e60354fa79c0 Mon Sep 17 00:00:00 2001 From: wilian Date: Thu, 6 Dec 2018 18:32:52 +0000 Subject: [PATCH] fixes bug#12935 dev:wilian qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@87726 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20181206_1620__mantis12935.sql | 22 +++++++++++ .../migration/V20181206_1620__mantis12935.sql | 39 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 src/db/migration/V20181206_1620__mantis12935.sql create mode 100644 src/db/postgresql/migration/V20181206_1620__mantis12935.sql diff --git a/src/db/migration/V20181206_1620__mantis12935.sql b/src/db/migration/V20181206_1620__mantis12935.sql new file mode 100644 index 000000000..fc8ac6a48 --- /dev/null +++ b/src/db/migration/V20181206_1620__mantis12935.sql @@ -0,0 +1,22 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table fiscal_j1 add (NUMSERIE20 VARCHAR(20), + DATAMOV VARCHAR2(9), + FISCALIMPRESSORA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table fiscal_j2 add (CNPJEMISSOR VARCHAR(14), + NUMSERIE20 VARCHAR(20), + DATAMOV VARCHAR(9), + FISCALIMPRESSORA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20181206_1620__mantis12935.sql b/src/db/postgresql/migration/V20181206_1620__mantis12935.sql new file mode 100644 index 000000000..7ed2d0c76 --- /dev/null +++ b/src/db/postgresql/migration/V20181206_1620__mantis12935.sql @@ -0,0 +1,39 @@ +DO $$ +BEGIN + alter table fiscal_j1 add (NUMSERIE20 VARCHAR(20), + DATAMOV VARCHAR2(9), + FISCALIMPRESSORA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7)); + + + alter table fiscal_j2 add (CNPJEMISSOR VARCHAR(14), + NUMSERIE20 VARCHAR(20), + DATAMOV VARCHAR(9), + FISCALIMPRESSORA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7)); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table fiscal_j1 add (NUMSERIE20 VARCHAR(20), + DATAMOV VARCHAR2(9), + FISCALIMPRESSORA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'alter table fiscal_j2 add (CNPJEMISSOR VARCHAR(14), + NUMSERIE20 VARCHAR(20), + DATAMOV VARCHAR(9), + FISCALIMPRESSORA_ID NUMBER(7), + PUNTOVENTA_ID NUMBER(7))'; + exception when column_exists then null; +end; \ No newline at end of file