Change anonymous inner class to lambda
@@ -2,7 +2,6 @@ package com.baeldung.flywaycallbacks;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.flywaydb.core.Flyway;
import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -14,11 +13,8 @@ public class EmptyMigrationStrategyConfig {
@Bean
public FlywayMigrationStrategy flywayMigrationStrategy() {
- return new FlywayMigrationStrategy() {
- @Override
- public void migrate(Flyway flyway) {
+ return flyway -> {
log.info("Skipping Flyway migration!");
- }
};
}
}
