question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to use paths relative to flyway.conf location

See original GitHub issue

Right 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:closed
  • Created 9 years ago
  • Reactions:12
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

23reactions
RichardJECookecommented, Dec 29, 2015

+1 for relative paths. First thing I’m Googling as a brand new user.

10reactions
JDFagancommented, Mar 6, 2017

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/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Locations - Flyway by Redgate • Database Migrations Made ...
Unprefixed locations or locations starting with classpath: point to a package on the classpath and may contain both SQL and Java-based migrations.
Read more >
Flyway using subdirectories under sql directory with relative path
You can use relative directory paths with the filesystem: prefix, as follows. $ mvn flyway:migrate -Dflyway.locations=filesystem:scripts/migration.
Read more >
Working with existing Flyway configurations - Documentation
If you're using an existing Flyway configuration file ... Set flyway.locations to the relative path from this flyway.conf to the folder ...
Read more >
All configuration options - Quarkus
AWS Lambda Type Default AWS Lambda Common Type Default AWS Lambda Gateway REST API Type Default Agroal ‑ Database connection pool Type Default
Read more >
“How-to” Guides - Spring
For instance, the following example loads a YAML configuration file ... The first thing you can do to help it is to leave...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found