Comments
6 comments
-
-
I'm defining for a migrate operation in the "flyway parameters" section
-
As 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.
-
Thank you for the insight! That can work
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? -
Excellent!
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. -
Peter_Laws said:As 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.
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.[flyway]
mixed = trueoutOfOrder = truelocations = [ "filesystem:migrations" ]validateMigrationNaming = trueplaceholders.myKey = "myValue"
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:[environments.H2Mem]url = "jdbc:h2:mem:testdb"user = "sa"flyway.placeholders.myKey = "myValue" <-- notice prefix "flyway."
Add comment
Please sign in to leave a comment.
Is this a bug or missing functionality that is being in development still?