How do placeholders work in Flyway?

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. :-)


If the token was subdomain:

INSERT INTO FEED VALUES ('app.${subdomain}.company.org/feed1', 'My Feed');

The values in flyway.conf:

flyway.url=jdbc:mydb://db
flyway.user=root
flyway.schemas=schema1
flyway.placeholders.subdomain=example

Or command line:

flyway -url=jdbc:mydb://db -user=root -schemas=schema1 -placeholders.subdomain=example migrate

Would run the script as:

INSERT INTO FEED VALUES ('app.example.company.org/feed1', 'My Feed');

Tags:

Flyway