我收到以下錯誤:
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 版的這篇博文作業。(我沒有看到它記錄他們已經洗掉了它)
我正在使用spring-boot-starter-parent 2.4.1,所以是Flyway 7.1.1。
誰能向我解釋如何在 Flyway 中使用通配符指定遷移檔案夾,為什么它不起作用?
uj5u.com熱心網友回復:
隨著 Flyway 的位置支持已經發展到支持通配符、云存盤等,Spring Boot 準確檢查位置的能力已經下降,如本期所述。因此,Spring Boot 2.5 已棄用對位置檢查的支持,在棄用期過后,它將完全洗掉。同時,您可以通過設定spring.flyway.check-location為關閉它false。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/326745.html
