diff --git a/src/db/migration/V20190213_1833__mantis13369.sql b/src/db/migration/V20190213_1833__mantis13369.sql new file mode 100644 index 000000000..d6b0637bf --- /dev/null +++ b/src/db/migration/V20190213_1833__mantis13369.sql @@ -0,0 +1,22 @@ +--drop index se existe +DECLARE +itemExists NUMBER; +BEGIN + itemExists := 0; + +SELECT COUNT(INDEX_NAME) INTO itemExists +FROM ALL_INDEXES +WHERE UPPER(INDEX_NAME) LIKE UPPER('PRECIO_VENTAJA__UN'); + + +IF itemExists > 0 THEN +begin + EXECUTE IMMEDIATE 'drop index PRECIO_VENTAJA__UN'; + EXECUTE IMMEDIATE 'ALTER TABLE PRECIO_VENTAJA ADD CONSTRAINT PRECIO_VENTAJA_PK PRIMARY KEY (PRECIOVENTAJA_ID )'; + exception when others then null; +end; +END IF; + +END; + +