AdmMono/src/db/migration/V20160729_1502__excepcionpe...

22 lines
685 B
SQL

declare
column_exists exception;
pragma exception_init (column_exists , -01430);
begin
execute immediate 'ALTER TABLE EXCEPCION_PEAJE_VIGENCIA ADD (CASETAPEAJE_ID NUMBER(7))';
exception when column_exists then null;
end;
/
declare
column_exists exception;
except_02275 exception;
pragma exception_init (column_exists , -01430);
pragma exception_init (column_exists , -02275);
begin
execute immediate 'ALTER TABLE EXCEPCION_PEAJE_VIGENCIA ADD CONSTRAINT EXCPEAJEVIGENCIA_CASETA_FK FOREIGN KEY (CASETAPEAJE_ID) REFERENCES CASETA_PEAJE (CASETAPEAJE_ID)';
exception
when column_exists then null;
when except_02275 then null;
end;