-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Description
Spring Boot version 2.4.3 (could be any which supports Flyway 6.4)
With version 6.4 flyway introduced support for wildcards in scripts locations, see https://flywaydb.org/blog/organising-your-migrations. Unfortunately the Spring location checker is not consistent with the new flyway feature.
When defining locations with wildcards, eg. spring.flyway.locations=classpath:/db/release-?.?/migration/
, spring.flyway.locations=classpath:/db/release-*/migration/
, Spring checks whether this location exists. In this case it certainly doesn't.
As a workaround I can set spring.flyway.check-location=false
but it took me some time to discover that the issue is indeed in Spring's additional path validation. Furthermore I'd like to check the location even when using wildcards.
Sample project: https://github.com/MateuszSobala/spring_flyway-location-wildcards
Code which needs to be adjusted:
Line 164 in 3b235e4
private void checkLocationExists(DataSource dataSource, FlywayProperties properties, |