Merge pull request 'fixes bug#AL-3308' (!87) from AL-3308 into master
Reviewed-on: utilidades/Flyway#87 Reviewed-by: Valdir Cordeiro <valdir.cordeiro@totvs.com.br>master
commit
9066b793f5
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>Flyway</artifactId>
|
<artifactId>Flyway</artifactId>
|
||||||
<version>1.23.1</version>
|
<version>1.23.2</version>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
DECLARE
|
DECLARE
|
||||||
|
tabelaExists NUMBER;
|
||||||
itemExists NUMBER;
|
itemExists NUMBER;
|
||||||
column_exists exception;
|
column_exists exception;
|
||||||
pragma exception_init (column_exists , -01430);
|
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';
|
EXECUTE IMMEDIATE 'ALTER TABLE TIPO_EVENTO_EXTRA_FORMAPAGO DROP CONSTRAINT TIPO_EVENTO_EXTRA_FORMAPAGO_FK';
|
||||||
END IF;
|
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)';
|
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;
|
exception when column_exists then null;
|
||||||
END;
|
END;
|
Loading…
Reference in New Issue