fixes bug#00000
qua: dev:Valdevir Validacao ambiente Dev para execucao do flyway. git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@113869 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
b469bd1445
commit
d701693d45
|
@ -30,6 +30,7 @@ public class FlyWay {
|
|||
private static final FlyWay INSTANCE = new FlyWay();
|
||||
|
||||
final private static String TABELA_FLYWAY = "schema_version_cst";
|
||||
final private static String AMBIENTE_DEV = "dev";
|
||||
final File JBOSS_DATA = getJBossDataDirectory();
|
||||
|
||||
private DataSource dataSource = null;
|
||||
|
@ -159,8 +160,14 @@ public class FlyWay {
|
|||
|
||||
dataSource = flyway.getDataSource();
|
||||
}
|
||||
String ambiente = System.getProperty("ambiente");
|
||||
if(!AMBIENTE_DEV.equals(ambiente)) {
|
||||
execute(flyway);
|
||||
log.info("Flyway executado.");
|
||||
}else {
|
||||
log.warn("Flyway não executado. Ambiente = dev");
|
||||
}
|
||||
|
||||
execute(flyway);
|
||||
|
||||
}catch(Throwable t){
|
||||
log.error("Erro ao executar o Flyway",t);
|
||||
|
@ -168,7 +175,6 @@ public class FlyWay {
|
|||
return false;
|
||||
}
|
||||
|
||||
log.info("Flyway executado.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue