Flyway 通配符在 Spring 引导中不起作用
Flyway wildcard is not working in Spring Boot
我收到以下错误:
Flyway failed to initialize: none of the following migration scripts locations could be found:
- classpath:db/*/migrations/
目录结构如下所示:
这就是我尝试过的:
# examples, obviously I tried these independently from each other
spring:
flyway:
# these work:
locations: "classpath:db"
locations: "classpath:db/release_1.0/migrations/"
# these don't work: (I am getting the same error as shown above)
locations: "classpath:db/**/migrations/"
locations: "classpath:db/release*/migrations/"
locations: "classpath:db/*/migrations/"
但它们应该根据 6.4 版的 this blogpost 工作。 (我没有看到他们已将其删除的记录)
我用的是spring-boot-starter-parent
2.4.1
,所以是Flyway 7.1.1
。
谁能向我解释如何在 Flyway 中使用通配符指定迁移文件夹,为什么它不起作用?
随着 Flyway 的位置支持已经发展到支持通配符、云存储等,SpringBoot 准确检查位置的能力已经下降为 described in this issue. As a result, support for location checking was deprecated in Spring Boot 2.5 and, after the deprecation period, it will be removed entirely. In the meantime, you can switch it off by setting spring.flyway.check-location
到 false
。
我收到以下错误:
Flyway failed to initialize: none of the following migration scripts locations could be found:
- classpath:db/*/migrations/
目录结构如下所示:
这就是我尝试过的:
# examples, obviously I tried these independently from each other
spring:
flyway:
# these work:
locations: "classpath:db"
locations: "classpath:db/release_1.0/migrations/"
# these don't work: (I am getting the same error as shown above)
locations: "classpath:db/**/migrations/"
locations: "classpath:db/release*/migrations/"
locations: "classpath:db/*/migrations/"
但它们应该根据 6.4 版的 this blogpost 工作。 (我没有看到他们已将其删除的记录)
我用的是spring-boot-starter-parent
2.4.1
,所以是Flyway 7.1.1
。
谁能向我解释如何在 Flyway 中使用通配符指定迁移文件夹,为什么它不起作用?
随着 Flyway 的位置支持已经发展到支持通配符、云存储等,SpringBoot 准确检查位置的能力已经下降为 described in this issue. As a result, support for location checking was deprecated in Spring Boot 2.5 and, after the deprecation period, it will be removed entirely. In the meantime, you can switch it off by setting spring.flyway.check-location
到 false
。