I'm evaluating Flyway for use in my project. Our current SQL scripts contain placeholders for things like URLs which will have a different domain names depending on the environment (dev, qa, prod).
Specifically, we might have INSERT statements like
INSERT INTO FEED VALUES ('app.${env.token}.company.org/feed1', 'My Feed');
${env.token} needs to be replaced with 'dev', 'qa', or 'prod'.
We have about 50 different properties that could potentially need replacement in SQL scripts. The properties all reside in one or two properties files.
Is there a way to run the Flyway Ant migration task so that it pulls the replacement tokens and values from a properties file? Something along the lines of the Ant filter task?
If the token was
subdomain
:The values in flyway.conf:
Or command line:
Would run the script as:
Currently when supplying placeholders as properties, the property name should be prefixed with flyway.placeholders.
For example the ${env.token} placeholder can be specified directly as this Ant property: flyway.placeholders.env.token
There is currently no support for passing a property file directly, without using prefixes for the property names. Feel free to raise an issue in the Issue Tracker. :-)