Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple lines in the flyway.conf file for configuration values #2555

Closed
philci52 opened this issue Nov 8, 2019 · 7 comments
Closed
Assignees
Milestone

Comments

@philci52
Copy link

@philci52 philci52 commented Nov 8, 2019

Which version and edition of Flyway are you using?

Flyway Community Edition 6.0.7 by Redgate

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Command line

Which database are you using (type & version)?

Postgres 9.4 & Mysql 5.7

Which operating system are you using?

Windows 10

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)

I am new to flyway, so maybe there is a better way to do this, but regardless, this is "nice to have" that I've come across. I searched stack overflow and the existing bugs, but did not find anything related.
Our project has several components, each of which require their own database tables and scripts. I've decided that one way to do this is to create an directory hierarchy and for each specific deployment, the admin can change the flyway.conf file to include the directories for the components that they want.
This results in a very long line of paths for the flyway.locations configuration location that makes it hard to read and organize. I was hoping that there was a way to have each location on a separate line. I was hoping the configuration file was a java properties file and attempted to use a \ at the end of the line and the next directory on the following line. Anyway I've not found a way to do this.

What did you expect to see?

A decipherable error message.

What did you see instead?

Putting a \ at the end of the line and a path on the next line oddly resulted in the following, which is probably another issue:
WARNING: Skipping META-INF.versions.9.org.h2.util.Bits: (UnsupportedClassVersionError: META-INF/versions/9/org/h2/util/Bits has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0)
... (lots of these errors)

I'm using
openjdk version "1.8.0_212-3-redhat"
OpenJDK Runtime Environment (build 1.8.0_212-3-redhat-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)

The flyway documentation states that it supports java 8 (class file version 5.2)

@philci52
Copy link
Author

@philci52 philci52 commented Nov 8, 2019

I meant to say class file version 52 (not 5.2)

@alextercete
Copy link
Contributor

@alextercete alextercete commented Nov 11, 2019

@philci52 I know this doesn't necessarily address your original request, but you could have a flyway.conf in the root directory of each component, then you could specify relative paths in locations. Would that solve your issue?

If not, could you please share you flyway.conf (or an example of what it looks like)?

@philci52
Copy link
Author

@philci52 philci52 commented Nov 11, 2019

@alextercete Thank you for the suggestion. I guess having multiple flyway.conf files requires me to either pass a large number of parameters on the configFiles command line argument or have run flyway once for each component and to ensure that each components versions aren't out of order. For better or worse, all components share the same schema. Anyway, the flyway.locations parameter as its set up now looks like the following:

flyway.locations:component1/sql/flyway/postgresql/,component2/sql/flyway/postgresql/,component3/sql/flyway/postgresql/,component4/sql/flyway/postgresql/,component5/sql/flyway/postgresql/,component6/sql/flyway/postgresql/,component7/sql/flyway/postgresql/,component8/sql/flyway/postgresql/

@philci52
Copy link
Author

@philci52 philci52 commented Nov 11, 2019

The flyway.locations that caused the error above looked like this:

flyway.locations:component1/sql/flyway/postgresql/,\
component2/sql/flyway/postgresql/

@alextercete
Copy link
Contributor

@alextercete alextercete commented Nov 11, 2019

@philci52 Just out of curiosity: if we supported Ant wildcards in locations, would this solve your problem?

For example:

flyway.locations=filesystem:**/sql/flyway/postgresql/

@philci52
Copy link
Author

@philci52 philci52 commented Nov 11, 2019

@alextercete No, sorry because that would include all the components, not just the ones that the administrator would want to install. FWIW, this is a nice to have feature, certainly not any blocker for us using flyway.

@alextercete
Copy link
Contributor

@alextercete alextercete commented Nov 11, 2019

Cool, thanks! We'll keep it in the backlog and consider it for a future version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants