Issue
By default, Flyway searches for migrations that start with "V" in the folder db/migration
, for example:
V1_1_0__init_schema.sql
However, my migrations have the following naming pattern (and I can't change my migrations name):
20210902193819451__init_schema.sql
How can I remove the letter "V" from the default behavior of Flyway, so that my migrations can be found?
I've already tried to set the following property in my configurations file:
spring.flyway.sql-migration-prefix: ""
, but that doesn't work, and I get the following error:
Invocation of init method failed; nested exception is org.flywaydb.core.api.exception.FlywayValidateException: Validate failed: Migrations have failed validation
Solution
I solved the problem adding the following configs to my application.yml
file:
spring.flyway.sql-migration-prefix: "20"
spring.flyway.sql-migration-separator: "_"
Instead of removing the prefix, I've simply replaced it.
Answered By - Caroline
Answer Checked By - Candace Johnson (JavaFixing Volunteer)