From efbf2b0af74468d1380b20ad6c4c7ced8bea92a2 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sat, 20 Jul 2024 11:23:16 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20DB=E8=87=AA=E5=8B=95=E4=BF=AE=E5=BE=A9?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hideout-core/build.gradle.kts | 1 - .../usbharu/hideout/core/config/FlywayConfig.kt | 16 ++++++++++++++++ hideout-core/src/main/resources/application.yml | 2 -- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FlywayConfig.kt diff --git a/hideout-core/build.gradle.kts b/hideout-core/build.gradle.kts index fe0e1d5e..4fc41c8b 100644 --- a/hideout-core/build.gradle.kts +++ b/hideout-core/build.gradle.kts @@ -86,7 +86,6 @@ dependencies { implementation(libs.bundles.owl.broker) implementation(libs.bundles.spring.boot.oauth2) implementation(libs.bundles.spring.boot.data.mongodb) - implementation(libs.bundles.spring.boot.data.mongodb) implementation("org.springframework.boot:spring-boot-starter-actuator") implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-security") diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FlywayConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FlywayConfig.kt new file mode 100644 index 00000000..ac4469c5 --- /dev/null +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/FlywayConfig.kt @@ -0,0 +1,16 @@ +package dev.usbharu.hideout.core.config + +import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +@Configuration +class FlywayConfig { + @Bean + fun cleanMigrateStrategy(): FlywayMigrationStrategy { + return FlywayMigrationStrategy { migrate -> + migrate.repair() + migrate.migrate() + } + } +} \ No newline at end of file diff --git a/hideout-core/src/main/resources/application.yml b/hideout-core/src/main/resources/application.yml index d2726451..0fe5b6e0 100644 --- a/hideout-core/src/main/resources/application.yml +++ b/hideout-core/src/main/resources/application.yml @@ -33,8 +33,6 @@ spring: host: localhost port: 27017 database: hideout - # username: hideoutuser - # password: hideoutpass servlet: multipart: max-file-size: 40MB