The Flyway documentation for ignoreMigrationPatterns
at https://documentation.red-gate.com/fd/flyway-ignore-migration-patterns-setting-277579002.html states
By default, future migrations are ignored. You can unset this by assigning an empty string to ignoreMigrationPatterns
Reviewing https://github.com/spring-projects/spring-boot/blob/3.5.x/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java it only sets the value of spring.flyway.ignore-migration-patterns
when the list is not empty.
When using Flyway with Spring Boot it looks like it isn't possible to set to an empty string as documented by Flyway.
Comment From: Chanwon-Seo
Hi, @manderson23.
As the issue description points out, the problem seems to be in FlywayAutoConfiguration.java where the ignore-migration-patterns
are configured.
https://github.com/spring-projects/spring-boot/blob/234501a07ab5388aad9474ff2d876cb8e916aeff/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java#L324
The line .whenNot(List:isEmpty)
prevents properties from being set when an empty list is provided.
By removing this line, you can set the property to an empty value, which can fix the problem as described in the Flyway document.
If this approach sounds good, I'd like to submit PR including modifications. Please let me know your opinion.
Thank you!
Comment From: Chanwon-Seo
Opened PR #46984 to address this!
Comment From: wilkinsona
Closing in favor of #46984. Thanks for the PR, @Chanwon-Seo.