Introducing Agent Safe Governance for the AI Era

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.

loading

loading

loading

loading

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.

loading

loading

loading

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_url with your Teradata connection URL. For example, jdbc:teradata://your_hostname/DATABASE=your_database

  • Replace your_username and your_password with your credentials

  • Replace DEV (or DEV_SCHEMA) with the context or schema for the environment you are deploying to

loading

# liquibase.properties
contextFilter: DEV

loading

loading

Vary 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.

loading

loading

loading

--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.