diff --git a/src/db/migration/V20191002_1010__mantis16198.sql b/src/db/migration/V20191002_1010__mantis16198.sql new file mode 100644 index 000000000..162fa5a89 --- /dev/null +++ b/src/db/migration/V20191002_1010__mantis16198.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'UPDATE EMPRESA_IMPOSTO SET INDREDBASEICMSBPE=0 WHERE INDREDBASEICMSBPE IS NULL'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20191002_1010__mantis16198.sql b/src/db/postgresql/migration/V20191002_1010__mantis16198.sql new file mode 100644 index 000000000..4944774b5 --- /dev/null +++ b/src/db/postgresql/migration/V20191002_1010__mantis16198.sql @@ -0,0 +1,6 @@ +DO $$ +BEGIN + UPDATE EMPRESA_IMPOSTO SET INDREDBASEICMSBPE=0 WHERE INDREDBASEICMSBPE IS NULL; + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; \ No newline at end of file