【问题标题】:Flyway wildcard is not working in Spring BootFlyway 通配符在 Spring Boot 中不起作用
【发布时间】:2021-12-06 13:48:57
【问题描述】:

我收到以下错误:


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-parent2.4.1,所以是Flyway 7.1.1

谁能向我解释如何在 Flyway 中使用通配符指定迁移文件夹,为什么它不起作用?

【问题讨论】:

    标签: spring-boot flyway


    【解决方案1】:

    随着 Flyway 的位置支持已经发展到支持通配符、云存储等,Spring Boot 准确检查位置的能力下降为described in this issue。因此,对位置检查的支持在 Spring Boot 2.5 中被弃用,并且在弃用期之后,它将被完全删除。同时,您可以通过将spring.flyway.check-location 设置为false 来关闭它。

    【讨论】:

      猜你喜欢
      • 2017-10-11
      • 1970-01-01
      • 1970-01-01
      • 2018-09-09
      • 1970-01-01
      • 1970-01-01
      • 2015-04-13
      • 2021-08-30
      • 2017-10-08
      相关资源
      最近更新 更多