flyway-play icon indicating copy to clipboard operation
flyway-play copied to clipboard

How to set Flyway config params

Open dragisak opened this issue 2 years ago • 3 comments

We need to disable Postgres locks as described here https://flywaydb.org/documentation/database/postgresql#lock-types

Does flyway-play look for flyway.conf file?

How do we set flyway.postgresql.transactional.lock=false in flyway-play?

dragisak avatar Aug 04 '22 20:08 dragisak

flyway-play does not currently support flyway.conf. (but this issue made me want to support it)

https://github.com/flyway/flyway/blob/3c6685e663492064fe85ada629c6368f22de3b24/flyway-core/src/main/java/org/flywaydb/core/internal/database/postgresql/PostgreSQLConfigurationExtension.java#L39

From this code, it seems that the environment variable FLYWAY_POSTGRESQL_TRANSACTIONAL_LOCK can be used instead. Can this be a workaround for the time being?

tototoshi avatar Aug 04 '22 22:08 tototoshi

Thanks @tototoshi I tried setting FLYWAY_POSTGRESQL_TRANSACTIONAL_LOCK, but it didn't seem to work.

Also, I asked a related question here https://github.com/flyway/flyway/issues/3492

dragisak avatar Aug 05 '22 16:08 dragisak

I would like to work on this, would it be enough just to add

flyway.envVars()

before we load the flyway instance? somewhere here

I found also

flyway.loadDefaultConfigurationFiles()

for loading flyway.conf from default locations. We could add both, wdyt? But we should discuss precedence of these configurations. For env variables it's probably desired to override a configuration file, but should flyway.conf override application.conf, or the other way?

slivkamiro avatar Mar 14 '24 12:03 slivkamiro

Hi @tototoshi, am I on the right track with this one?

slivkamiro avatar Mar 25 '24 17:03 slivkamiro

@slivkamiro Thank you! I will take a look.

tototoshi avatar Mar 30 '24 06:03 tototoshi

But we should discuss precedence of these configurations. For env variables it's probably desired to override a configuration file, but should flyway.conf override application.conf, or the other way?

For the time being, I think the environment variable settings should override the application.conf settings. flyway-play is currently only considering the application.conf configuration of the Play Framework, and flyway.conf is not supported.

If I get a chance, I would like to improve flyway-play so that it can be configured with flyway.conf.

tototoshi avatar Apr 23 '24 13:04 tototoshi

Fixed by https://github.com/flyway/flyway-play/pull/389

tototoshi avatar Apr 25 '24 06:04 tototoshi