feat: DB自動修復を追加

This commit is contained in:
usbharu 2024-07-20 11:23:16 +09:00
parent 841289700b
commit efbf2b0af7
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
3 changed files with 16 additions and 3 deletions

View File

@ -86,7 +86,6 @@ dependencies {
implementation(libs.bundles.owl.broker) implementation(libs.bundles.owl.broker)
implementation(libs.bundles.spring.boot.oauth2) implementation(libs.bundles.spring.boot.oauth2)
implementation(libs.bundles.spring.boot.data.mongodb) 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-actuator")
implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-security") implementation("org.springframework.boot:spring-boot-starter-security")

View File

@ -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()
}
}
}

View File

@ -33,8 +33,6 @@ spring:
host: localhost host: localhost
port: 27017 port: 27017
database: hideout database: hideout
# username: hideoutuser
# password: hideoutpass
servlet: servlet:
multipart: multipart:
max-file-size: 40MB max-file-size: 40MB