Fix Flyway migration
This commit is contained in:
@@ -35,13 +35,14 @@ public class FlywayContextInitializer implements ApplicationContextInitializer<C
|
||||
RuntimeException lastFailure = null;
|
||||
for (int attempt = 1; attempt <= MAX_RETRIES; attempt++) {
|
||||
try {
|
||||
Flyway.configure()
|
||||
Flyway flyway = Flyway.configure()
|
||||
.dataSource(url, username, password)
|
||||
.locations(locations)
|
||||
.baselineOnMigrate(environment.getProperty("spring.flyway.baseline-on-migrate", Boolean.class, false))
|
||||
.baselineVersion(MigrationVersion.fromVersion(environment.getProperty("spring.flyway.baseline-version", "1")))
|
||||
.load()
|
||||
.migrate();
|
||||
.load();
|
||||
flyway.repair();
|
||||
flyway.migrate();
|
||||
return;
|
||||
} catch (RuntimeException ex) {
|
||||
lastFailure = ex;
|
||||
|
||||
Reference in New Issue
Block a user