From b48e4b51a030adc3f0ad3e912458c26fc58d6acb Mon Sep 17 00:00:00 2001 From: weitang Date: Wed, 2 Jul 2025 11:06:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Eflyway=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84=E5=8A=A8=E6=80=81=E7=BB=B4=E6=8A=A4=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9Eflyway=E8=B7=9F=E8=B8=AA=E5=92=8C=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E7=89=88=E6=9C=AC=E5=8C=96=E7=9A=84=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/pom.xml | 10 ++++++++++ backend/src/main/resources/application.yml | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/backend/pom.xml b/backend/pom.xml index 79aeffd..628ac39 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -160,6 +160,16 @@ jcommander 1.82 + + + org.flywaydb + flyway-core + + + + org.flywaydb + flyway-mysql + diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index 168beca..ffcd210 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -33,7 +33,13 @@ spring: max-lifetime: 1800000 connection-timeout: 30000 connection-test-query: SELECT 1 - + flyway: + enabled: true + table: flyway_schema_history + validate-on-migrate: true + locations: classpath:db/migration + baseline-on-migrate: true + out-of-order: true cache: jcache: config: classpath:ehcache.xml # 指定Ehcache配置文件路径 @@ -80,6 +86,7 @@ logging: org.springframework.security: ${LOG_LEVEL_SECURITY:WARN} org.hibernate.SQL: ${LOG_LEVEL_SQL:WARN} org.hibernate.type.descriptor.sql.BasicBinder: ${LOG_LEVEL_SQL_PARAMS:WARN} + org.flywaydb: DEBUG pattern: console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" @@ -160,6 +167,7 @@ spring: security: jwt: enabled: true + logging: level: root: WARN