diff --git a/src/db/migration/V20180813_1709__mantis11854.sql b/src/db/migration/V20180813_1709__mantis11854.sql new file mode 100644 index 000000000..6aa0d17e4 --- /dev/null +++ b/src/db/migration/V20180813_1709__mantis11854.sql @@ -0,0 +1,21 @@ +declare + begin + execute immediate 'ALTER TABLE ESTADO RENAME COLUMN CENTRORESULTADOSAG TO CENTRORESULTADOSAG1'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'ALTER TABLE ESTADO ADD (CENTRORESULTADOSAG VARCHAR2(20))'; + exception when others then null; +end; + +/ + +declare + begin + execute immediate 'update estado set centroresultadosag = centroresultadosag1'; + exception when others then null; +end; diff --git a/src/db/migration/V20180814_1106__mantis11854.sql b/src/db/migration/V20180814_1106__mantis11854.sql new file mode 100644 index 000000000..03f0eb86c --- /dev/null +++ b/src/db/migration/V20180814_1106__mantis11854.sql @@ -0,0 +1,11 @@ +declare + begin + execute immediate 'ALTER TABLE AG_CONTAS_PAGAR MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE))'; + exception when others then null; +end; +/ +declare + begin + execute immediate 'ALTER TABLE AG_CONTAS_RECEBER MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE))'; + exception when others then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20180813_1709__mantis11854.sql b/src/db/postgresql/migration/V20180813_1709__mantis11854.sql new file mode 100644 index 000000000..a4f0ed66c --- /dev/null +++ b/src/db/postgresql/migration/V20180813_1709__mantis11854.sql @@ -0,0 +1,24 @@ +DO $$ +BEGIN + ALTER TABLE ESTADO RENAME COLUMN CENTRORESULTADOSAG TO CENTRORESULTADOSAG1; + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + +DO $$ +BEGIN + ALTER TABLE ESTADO ADD (CENTRORESULTADOSAG VARCHAR2(20)); + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + +DO $$ +BEGIN + update estado set centroresultadosag = centroresultadosag1; + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + diff --git a/src/db/postgresql/migration/V20180814_1106__mantis11854.sql b/src/db/postgresql/migration/V20180814_1106__mantis11854.sql new file mode 100644 index 000000000..f8e6b6287 --- /dev/null +++ b/src/db/postgresql/migration/V20180814_1106__mantis11854.sql @@ -0,0 +1,15 @@ +DO $$ +BEGIN + ALTER TABLE AG_CONTAS_PAGAR MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE)); + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + +DO $$ +BEGIN + ALTER TABLE AG_CONTAS_RECEBER MODIFY (CENTRORESULTADOS VARCHAR2(20 BYTE)); + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$;