diff --git a/src/com/rjconsultores/ventaboletos/FlyWay.java b/src/com/rjconsultores/ventaboletos/FlyWay.java index fbc7f7cb6..6b31f7c5b 100644 --- a/src/com/rjconsultores/ventaboletos/FlyWay.java +++ b/src/com/rjconsultores/ventaboletos/FlyWay.java @@ -148,7 +148,7 @@ public class FlyWay { try{ String ambiente = System.getProperty("ambiente") ==null || System.getProperty("ambiente").isEmpty() ? "" : System.getProperty("ambiente"); - if( AMBIENTE_DEV.equalsIgnoreCase(ambiente) || AMBIENTE_CONSULTA.equalsIgnoreCase(ambiente) ) { + if( (AMBIENTE_DEV.equalsIgnoreCase(ambiente) && AMBIENTE_CONSULTA.equalsIgnoreCase(ambiente)) && Boolean.FALSE.equals(isReloadFlyway) ) { log.warn("Flyway não executado. Ambiente = dev ou consulta"); return true; } @@ -172,11 +172,10 @@ public class FlyWay { dataSource = flyway.getDataSource(); } - - if(Boolean.TRUE.equals(isReloadFlyway)) { - execute(flyway); - log.info("Flyway executado."); - } + + execute(flyway); + log.info("Flyway executado."); + }catch(Throwable t){ log.error("Erro ao executar o Flyway",t); return false;