diff --git a/spring-boot-demo-flyway/README.md b/spring-boot-demo-flyway/README.md index 2186aaec0..016ad45a7 100644 --- a/spring-boot-demo-flyway/README.md +++ b/spring-boot-demo-flyway/README.md @@ -57,6 +57,10 @@ spring: clean-disabled: true # 校验路径下是否存在 SQL 文件 check-location: false + # 最开始已经存在表结构,且不存在 flyway_schema_history 表时,需要设置为 true + baseline-on-migrate: true + # 基础版本 0 + baseline-version: 0 datasource: url: jdbc:mysql://127.0.0.1:3306/flyway-test?useSSL=false username: root diff --git a/spring-boot-demo-flyway/src/main/resources/application.yml b/spring-boot-demo-flyway/src/main/resources/application.yml index 7c32fe96b..e95f0fcbe 100644 --- a/spring-boot-demo-flyway/src/main/resources/application.yml +++ b/spring-boot-demo-flyway/src/main/resources/application.yml @@ -7,6 +7,10 @@ spring: clean-disabled: true # 校验路径下是否存在 SQL 文件 check-location: false + # 最开始已经存在表结构,且不存在 flyway_schema_history 表时,需要设置为 true + baseline-on-migrate: true + # 基础版本 0 + baseline-version: 0 datasource: url: jdbc:mysql://127.0.0.1:3306/flyway-test?useSSL=false username: root