Search code examples
javaspring-bootmigrationflyway

flyway.conf file ignore location property


I have Spring Boot project with flyway.conf file inside. My project structure looks like:

springBootMainFolder/flyway.conf
springBootMainFolder/src/main/java/com/example/db/migration/V1__Some_migration.java
springBootMainFolder/src/main/resources/db/migration/V2_Another_migration.sql

As I understand, by default, flyway points location to db/migration (which is my third folder with files from list), and if I want to change it, I can just tell it to flyway inside flyway.conf file. Which is looks like:

flyway.locations=db.migration,classpath:db.migration
flyway.user=test
flyway.password=test
flyway.schemas=test
flyway.url=postgresql://test:5442/test

And when I run migrations, only migrations from third folder (springBootMainFolder/src/main/resources/db/migration) are visible, and even if I'm trying to set another dumb location in flyway.locations property it is got ignored and it starts to find under db.migration folder. Why it can be ignored and how I can set it?


Solution

  • I haven't understood why location property was ignored from flyway.conf file, but if I place this property under configuration tag of flyway-maven-plugin plugin, it works.