AdmMono/src/db/migration/V20170428_1430__mantis8900.sql

26 lines
712 B
SQL

declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate 'ALTER TABLE COMISSAO RENAME COLUMN RECEITA_OUTROS TO RECEITA_OUTROS_OLD';
exception when object_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -01430);
begin
execute immediate 'ALTER TABLE COMISSAO ADD RECEITA_OUTROS NUMBER(7,2)';
exception when object_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate 'UPDATE COMISSAO SET RECEITA_OUTROS = RECEITA_OUTROS_OLD';
exception when object_exists then null;
end;