diff --git a/spring-boot-demo-flyway/README.md b/spring-boot-demo-flyway/README.md index 2186aaec0bc2662884b9b2271c8015c2fa6015fa..016ad45a77984d3a911606bb998c46fc02a431f1 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 7c32fe96b87a1b66ff44c953c3c92d9a0d71090e..e95f0fcbeac7004e1f01afd1b84f9516670c7559 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