From cdb2acc4e13a66e752ba67b6955532a76a429ced Mon Sep 17 00:00:00 2001 From: aristides Date: Thu, 14 Feb 2019 18:30:22 +0000 Subject: [PATCH] fixes bug#13369 dev:fabio qua:Renato git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@89859 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20190213_1833__mantis13369.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/db/migration/V20190213_1833__mantis13369.sql 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; + +