fixes bug#00000

qua:
dev:Valdevir
Autorizar executar flyway apenas pelo ReloadFlyway qaundo argumeto "ambiente=dev" existir.

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@113936 d1611594-4594-4d17-8e1d-87c2c4800839
master
valdevir 2022-08-23 13:53:19 +00:00
parent 9f336cd699
commit f589596cfc
2 changed files with 9 additions and 5 deletions

View File

@ -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 {

View File

@ -20,7 +20,7 @@ public class ReloadFlyway extends HttpServlet {
out = resp.getWriter();
out.println("<h2>Reload Flyway</h2>");
boolean retorno = FlyWay.getInstance().start();
boolean retorno = FlyWay.getInstance().start(true);
if (retorno) {
out.print("Processo realizado com sucesso.");