Allow to use paths relative to flyway.conf location
See original GitHub issueRight now locations
defined in flyway.properties
are relative to current working directory. This may be a command line tool location or location of pom.xml
for Maven plug-in. This makes it very difficult to use single flyway.properties
to run some set of migrations.
Example file structure:
/someproject/migrations/flyway.properties
/someproject/migrations/sql/V1__aaa.sql
/someproject/migrations/sql/V2__bbb.sql
/someproject/pom.mxl
/tools/flyway/flyway.cmd
Right now if I want to run migrations from maven plug-in with option configFile
I have to set flyway.locations
to migrations/sql
in it. If I want to use same flyway.properties
from command line tool I have to explicitly override locations
with absolute path to sql file folder.
So I suggest to add a boolean option locationsAreRelativeToConfig
. If it set to true
then location of flyway.properties
(or another file provided by configFile
option) should be used as base directory for locations
. So for example above it will be possible to set
flyway.locations=filesystem:sql
and use flyway.properties
file both from maven plug-in and command line tool.
Issue Analytics
- State:
- Created 9 years ago
- Reactions:12
- Comments:14 (3 by maintainers)
Top GitHub Comments
+1 for relative paths. First thing I’m Googling as a brand new user.
This also should apply to flyway.conf (not just flyway.properties) as well, I want to simply define this:
flyway.locations=./sql/
So that flyway can pickup my sql from Git repo in repo sub-directory where . represents current directory of my project root (i.e., my git repo directory).
– Update:
My noob mistake. I got the above to work by changing above to:
flyway.locations=filesystem:./sql/