AdmMono/src/db/migration/V20170913_1116__mantis9796.sql

26 lines
767 B
SQL

declare
column_exists exception;
pragma exception_init (column_exists , -01430);
begin
execute immediate 'ALTER TABLE AIDF ADD (PUNTOVENTA_ID NUMBER(7))';
exception when column_exists then null;
end;
/
declare
object_exists exception;
except_02275 exception;
except_02270 exception;
pragma exception_init (object_exists , -01430);
pragma exception_init (except_02275 , -02275);
pragma exception_init (except_02270 , -02270);
begin
execute immediate 'ALTER TABLE AIDF ADD CONSTRAINT PUNTOVENTA_AIDF FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) ENABLE';
exception
when object_exists then null;
when except_02275 then null;
when except_02270 then null;
end;