Pass in the variable to liquibase changelog script

Hi All,

I am very new to liquibase. Sorry for the basic question. Here is my question.

I need to change the password to AES_ENCRYPT and need to use key in this function. Is where any way that instead of hardcoded the KEY in change log script I can use the variable in changelog script for the key and this variable is set in the java code. Basically I didn’t want the KEY is hardcoded in the changelog script.

Do you have any suggestion?

Thanks in advance,

KL

There are  http://www.liquibase.org/manual/changelog_parameters changelog parameters which should be what you are looking for


Nathan

Thanks,
How to pass the variable to this liquibase?
KP

Thanks,
Where to set this variable?

The bottom of the referenced page lists how:


    Nathan

Hi,
I really don’t want to set this variable in the database changelog. Is it possible to set it as the environment variable?
Thanks,
KP

Yes, you can set it as a JVM system property by passing -Dpropertyname=value to java when it first starts, or as a parameter to ant, command line, or however you are running liquibase


Nathan

Is it possible to escape a change log parameter? I browsed the source - it doesn’t look like it?


I need to insert the literal ${user.name} into my DB, and because this is the default Java system property, it is expanded to my user name.


Perhaps an Ant-like escape mechanism for dollar signs, such as $${user.name}?