Escape changeset property during update command

Hi all,

I would like to apply a changeset that contains a template message, e.g.

INSERT INTO MY_TABLE (MESSAGE) VALUES(’‘Hello ${user.name}’)

I would like to resolve user.name variable using the web application but, unfortunately, this variable is resolved by liquibase during migration.

I saw in the liquibase source code that there is a variable that should do the trick

liquibase.parser.ChangeLogParserCofiguration#ChangeLogParserCofiguration

supportPropertyEscaping (alias enableEscaping), using it and escaping like ${:user.name} should works.

liquibase.changelog.ChangeLogParameters.ExpressionExpander#expandExpressions

I tried to configure the supportPropertyEscaping property using liquibase.properties file and using the -D approach, but nothing happens. I didn’t found any resource on internet.

Do you have any suggestions?

I run the tool using the CLI

Thank you

Felice

I forgot to mention that changelog are written in xml files and that sql is written inside the sql element.

Ok I found a solution.

In order to override the configuration I can define/override JAVA_OPTS env variable.
export JAVA_OPTS="$JAVA_OPTS -Dliquibase.enableEscaping=true"

I’m wondering if there are other ways to do the same with the CLI.