diff --git a/src/db/migration/V20200727_0954__mantis19805.sql b/src/db/migration/V20200727_0954__mantis19805.sql new file mode 100644 index 000000000..4dfa56a2f --- /dev/null +++ b/src/db/migration/V20200727_0954__mantis19805.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD INDESTORNO NUMBER(1,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'update forma_pago set indestorno = 1 where formapago_id in (2, 3)'; + exception when column_exists then null; +end; +/ diff --git a/src/db/migration/V20200730_1627__mantis19805.sql b/src/db/migration/V20200730_1627__mantis19805.sql new file mode 100644 index 000000000..5fa5741a5 --- /dev/null +++ b/src/db/migration/V20200730_1627__mantis19805.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE DADOS_ESTORNO_CARTAO ADD FORMAPAGO_ID NUMBER(7,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE DADOS_ESTORNO_CARTAO ADD PONTO_VENDA_BOLETO_ID NUMBER(7,0)'; + exception when column_exists then null; +end; + diff --git a/src/db/postgresql/migration/V20200727_0954__mantis19805.sql b/src/db/postgresql/migration/V20200727_0954__mantis19805.sql new file mode 100644 index 000000000..7a840ab62 --- /dev/null +++ b/src/db/postgresql/migration/V20200727_0954__mantis19805.sql @@ -0,0 +1,13 @@ +DO $$ +BEGIN + ALTER TABLE FORMA_PAGO ADD INDESTORNO NUMBER(1,0); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; +/ +DO $$ +BEGIN + update forma_pago set indestorno = 1 where formapago_id in (2, 3); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20200730_1627__mantis19805.sql b/src/db/postgresql/migration/V20200730_1627__mantis19805.sql new file mode 100644 index 000000000..1516e3a77 --- /dev/null +++ b/src/db/postgresql/migration/V20200730_1627__mantis19805.sql @@ -0,0 +1,14 @@ +DO $$ +BEGIN + ALTER TABLE DADOS_ESTORNO_CARTAO ADD FORMAPAGO_ID NUMBER(7,0); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; +/ +DO $$ +BEGIN + ALTER TABLE DADOS_ESTORNO_CARTAO ADD PONTO_VENDA_BOLETO_ID NUMBER(7,0); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; +