From 48844f6b1470e19f9074333ef9dcc279f8c7915f Mon Sep 17 00:00:00 2001 From: chaerim Date: Tue, 26 Sep 2023 19:54:11 +0900 Subject: [PATCH] fix(flyway): add FlywayBeanConfig to fix migration error --- .../e2i/wemeet/config/flyway/FlywayConfig.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/java/com/e2i/wemeet/config/flyway/FlywayConfig.java diff --git a/src/main/java/com/e2i/wemeet/config/flyway/FlywayConfig.java b/src/main/java/com/e2i/wemeet/config/flyway/FlywayConfig.java new file mode 100644 index 00000000..ad756566 --- /dev/null +++ b/src/main/java/com/e2i/wemeet/config/flyway/FlywayConfig.java @@ -0,0 +1,18 @@ +package com.e2i.wemeet.config.flyway; + +import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FlywayConfig { + + @Bean + public FlywayMigrationStrategy cleanMigrateStrategy() { + return flyway -> { + flyway.repair(); + flyway.migrate(); + }; + } +} +