openbaton / NFVO

Repository containing the source code of the NFVO
Apache License 2.0
61 stars 52 forks source link

Flyway configuration #181

Open gc4rella opened 7 years ago

gc4rella commented 7 years ago

https://github.com/openbaton/NFVO/blob/develop/main/src/main/java/org/openbaton/nfvo/system/FlywayConfig.java#L43 initialize the Flyway object, however it calls immediately the migrate method, probably without considering the configuration settings which are applied immediately after.

A possible change is to call the migrate method as following:

flyway.setBaselineOnMigrate(true);
try {
  //flyway.baseline();
  flyway.migrate();
} catch (FlywayException e) {
  log.warn("Database is already baselined with flyway");
}
lorenzotomasini commented 7 years ago

The problem i am facing is that the migration is anyway executed even if using hsql... this could in some cases lead to some false error of database migration

gc4rella commented 7 years ago

because migrate is in the init method, thus executed every time.

lorenzotomasini commented 7 years ago

but the flyway should always be baselined