diff --git a/src/com/rjconsultores/ventaboletos/FlyWay.java b/src/com/rjconsultores/ventaboletos/FlyWay.java index 68b6a8abd..2d8213527 100644 --- a/src/com/rjconsultores/ventaboletos/FlyWay.java +++ b/src/com/rjconsultores/ventaboletos/FlyWay.java @@ -114,7 +114,11 @@ public class FlyWay { } public boolean start() { - return start(null, null); + return start(null, null, false); + } + + public boolean start(Boolean isReloadFyway) { + return start(null, null, isReloadFyway); } public boolean startCustom() { @@ -134,10 +138,10 @@ public class FlyWay { location = "filesystem:" + data.getPath(); } - return start(location, TABELA_FLYWAY); + return start(location, TABELA_FLYWAY, false); } - public boolean start(final String customLocation, final String customTable) { + public boolean start(final String customLocation, final String customTable, Boolean isReloadFlyway) { log.info("Executando Flyway..."); try{ @@ -161,7 +165,7 @@ public class FlyWay { dataSource = flyway.getDataSource(); } String ambiente = System.getProperty("ambiente"); - if(!AMBIENTE_DEV.equals(ambiente)) { + if(!AMBIENTE_DEV.equals(ambiente) || Boolean.TRUE.equals(isReloadFlyway)) { execute(flyway); log.info("Flyway executado."); }else { diff --git a/src/com/rjconsultores/ventaboletos/servlet/ReloadFlyway.java b/src/com/rjconsultores/ventaboletos/servlet/ReloadFlyway.java index 25c94ece7..ea5064a96 100644 --- a/src/com/rjconsultores/ventaboletos/servlet/ReloadFlyway.java +++ b/src/com/rjconsultores/ventaboletos/servlet/ReloadFlyway.java @@ -20,7 +20,7 @@ public class ReloadFlyway extends HttpServlet { out = resp.getWriter(); out.println("