Best practices for deploying to Teradata schemas with varying schema names in the pipeline
Last updated: June 18, 2026
As database changes move through a pipeline, the target schema name often differs from one environment to the next. For example, the same change might deploy to a DEV schema, then a TEST schema, and finally a PROD schema. Rather than maintaining a separate changelog for each environment, use Liquibase property substitution to parameterize the schema name so a single changelog works everywhere.
Liquibase performs variable substitution in changelog and changeset files. As long as the property is defined, you can reference it with the ${property_name} syntax. For more detail, see What is property substitution?.
Reference the schema name with a property
Reference the target schema with ${TARGET_SCHEMA} in your changeset. The changeset stays identical in every environment. Only the value of TARGET_SCHEMA changes.
Supply the value for each environment
The changeset never changes. You supply a different value for TARGET_SCHEMA in each stage of your pipeline. For a pipeline, the recommended approach is context-based properties: declare a value for each context at the top of your changelog, before any changesets.
Then select the environment at deploy time by passing its context. For example, --context-filter=DEV makes ${TARGET_SCHEMA} resolve to DEV_SCHEMA, so the change deploys to the DEV schema. Pass the context whichever way fits your pipeline, or override the value directly with -D (useful for formatted SQL changelogs or pipeline-generated names).
Be sure to:
Replace
your_database_urlwith your Teradata connection URL. For example,jdbc:teradata://your_hostname/DATABASE=your_databaseReplace
your_usernameandyour_passwordwith your credentialsReplace
DEV(orDEV_SCHEMA) with the context or schema for the environment you are deploying to
# liquibase.properties
contextFilter: DEVVary included paths by environment
You can use the same approach to control which files Liquibase includes. Reference a property in an includeAll path so each environment pulls in its own set of scripts. As with the schema name, you write ${TARGET_ENV} once and supply its value per environment.
--liquibase formatted sql
--includeAll path:scripts/${TARGET_ENV}/When TARGET_ENV is set to PROD, Liquibase replaces the variable with PROD and includes all of the files from the scripts/PROD/ directory.