Flyway Placeholders are not saved in the project
javaDuke
Posts: 12 Bronze 1
While using community edition desktop, I've noticed that once I did setup my placeholders, it does no save into the project file. So the next time I start the desktop, the placeholders are gone.
Is this a bug or missing functionality that is being in development still?
Is this a bug or missing functionality that is being in development still?
Tagged:
Best Answers
-
Peter_Laws Posts: 278 Silver 2As the interface says, these parameters are temporary and will not persist.
Whereas, if you were to define them in the config file or environment variables (as mentioned in link of your first comment) they will then persist.
Additionally, if you add them in either environment variables, or the root flyway install directory as opposed to the project directory, the placeholders will be available for all instances of flyway.
-
Peter_Laws Posts: 278 Silver 2Excellent!
That degree of granularity is coming, you've probably seen the project configs starting to use TOML files, this has been instituted to allow environment specific definitions. It's still a work in progress however and will take a little time before what you're looking for is implemented exactly as you described.
Hopefully the above format will be an adequate stopgap until then.
If my replies have proven useful, please consider marking an applicable post as answered to assist other members of the community.
Answers
It could be either; how are you defining them and in what context please?
In a multi-env/team environment where one delivers the script and the other team applies to a different environments like (DEV, UAT, PROD, etc) is it possible to defile some sort of "profiles" that contain values for the placeholders specific to the target environment?
Just a note to other devs, there are two "toml" format config files:
- flyway.toml
- flyway.user.toml
I tried setting up my placeholders in either of them and it worked.
NOTE: When you setup in flyway.user.toml you should specify full placehalder key name otherwise it will not be found.
Example:
Consider placeholder key "myKey", then in flyway.user.toml you should specify:
flyway.placeholders.myKey = "myValue"
In flyway.toml there are sections and you can spectify in "Global" flyway section, e.g.
mixed = true
Notice, that "flyway" prefix was omitted, since its part of the [flyway] section that adds this namespace.
For environment specific section you have to specify full placeholder name, for example H2Mem: