Is it possible to override flyway.url setting in flyway.conf from command line in flyway?

1.1k views Asked by At

Is it possible to override url that is given in .conf file when invoking migrate from command line?

flyway -flyway.url=jdbc:jtds:sqlserver://test_sqlserver:1433/mydatabase migrate

This above does not seem to work.

2

There are 2 answers

1
Axel Fontaine On BEST ANSWER

Yes. Command-line options are not prefixed with flyway.

In your case this would mean

flyway -url=jdbc:jtds:sqlserver://test_sqlserver:1433/mydatabase migrate

0
Dmitri On

To expand on that comment:

-D sets a system property (in this case flyway.baselineVersion), it's a parameter to java, not to flyway.

-baselineVersion=1 is a parameter to flyway

Both happen to work only because flyway uses both command line arguments and system properties (in addition to the configuration file), they are not otherwise related.