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