fixes bug#AL-3308

master
Gleison da Cruz 2023-12-15 10:50:43 -03:00
parent 601b41575e
commit a32bd45fba
2 changed files with 9 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>Flyway</artifactId>
<version>1.23.1</version>
<version>1.23.2</version>
<distributionManagement>
<repository>

View File

@ -1,4 +1,5 @@
DECLARE
tabelaExists NUMBER;
itemExists NUMBER;
column_exists exception;
pragma exception_init (column_exists , -01430);
@ -12,6 +13,11 @@ BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE TIPO_EVENTO_EXTRA_FORMAPAGO DROP CONSTRAINT TIPO_EVENTO_EXTRA_FORMAPAGO_FK';
END IF;
SELECT COUNT(TABLE_NAME) INTO tabelaExists
FROM ALL_TABLES
WHERE UPPER(TABLE_NAME) = UPPER('TIPO_EVENTO_EXTRA_FORMAPAGO');
IF itemExists > 0 THEN
EXECUTE IMMEDIATE 'ALTER TABLE TIPO_EVENTO_EXTRA_FORMAPAGO ADD CONSTRAINT TIPO_EVENTO_EXTRA_FORMAPAGO_FK FOREIGN KEY (FORMAPAGO_ID) REFERENCES FORMA_PAGO (FORMAPAGO_ID)';
END IF;
exception when column_exists then null;
END;