Passing parameter to liquibase in parametric queries

Hi guys! I’m using Liquibase to write some parametric queries like
create table ${tableName} …
I would like to pass the parameter tableName using the command line like:
liquibase --url=… --username=… --password=… … update “-Dparameter.tableName=table1”
The command above does not work but if I put the variable in liquibase.properties file it works.
Is there a way to pass parameters through the command line arguments?

Welcome to the forums @astungaro!

You’re really close on the specification. If your parameter in the changelog is `${tableName} try:

-DtableName=table1

instead of:

-Dparameter.tableName=table1

1 Like

Hi @Pete! Thank you so much! Your suggestion worked!

2 Likes