Mary
Mary

Reputation: 3

How to use the variables defined in the flyway.conf file within it

I have a scenario for defining two parameters in a flyway.conf file with the following structure:

flyway.placeholders.parameter1: value1 flyway.placeholders.parameter2: $ {parameter1} _ value2

Can I define the parameters this way? Because when I call parameter 2 from the sql file, it does not return a proper value.

Upvotes: 0

Views: 1498

Answers (1)

Tom Smith
Tom Smith

Reputation: 121

Unfortunately, placeholders can't be inserted into other fields in the configuration file.

Using ${ ... } inside flyway.conf will instead try inserting an environment variable. In this case it would be trying to insert an environment variable called parameter1, so if this doesn't exist it just inserts an empty string.

parameter2 might have to be defined manually instead, or you could assign both parameter1 and parameter2 using an environment variable.

Upvotes: 1

Related Questions