• Reference
  • Version ยท 6.0
  • Change Automation Reference

conditions-filter

Last updated: September 29, 2026

Use the --conditions-filter argument at runtime to control which changesets a command runs, based on each changeset's conditions attribute.

Note: The --conditions-filter argument requires Liquibase Secure 5.2.2 or later. It is one of four attribute filters introduced together: --teams-filter, --releases-filter, --keywords-filter, and --conditions-filter. All four behave the same way.

Uses

Pass --conditions-filter with one value or a comma-separated list of values. A changeset matches when any value in its conditions attribute equals any value in the filter. Matching is a straight string comparison and is fully case-insensitive on both sides. For example, conditions="Hotfix" matches --conditions-filter=HOTFIX.

The --conditions-filter argument does not support the full logical expressions of label-filter and context-filter. There is no AND, OR, !, or parenthetical grouping. As of Liquibase Secure 6.0, it does support the @ strict-matching operator, described below. A comma-separated list matches changesets that have any of the listed values. Liquibase stores the attribute value exactly as you authored it and only splits, trims, and lowercases the values when the filter is evaluated.

If a changeset does not have a conditions attribute, it always runs, even when a filter is specified, unless the filter uses the @ operator. This matches the behavior of labels and contexts. If you run a command without --conditions-filter, all changesets run whether they have a conditions attribute or not.

The @ operator

The @ symbol is used in the --conditions-filter argument at runtime to force strict matching. By default, changesets without a conditions value are always executed. Using @ ensures that only changesets with the specified conditions value are executed. The @ operator requires Liquibase Secure 6.0 or later.

Given these changesets:

--changeset your.name:1 conditions:nightly-ok CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY); --changeset your.name:2 conditions:nightly-ok CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY); --changeset your.name:3 conditions:prod-only CREATE TABLE t3 (id INT NOT NULL PRIMARY KEY); --changeset your.name:4 CREATE TABLE t4 (id INT NOT NULL PRIMARY KEY);

Running liquibase update --conditions-filter="@nightly-ok" executes only changesets 1 and 2. Changeset 3 (conditions:prod-only) and changeset 4 (no conditions attribute) are both excluded.

Supported commands

You can use --conditions-filter with the commands that execute or evaluate changesets:

  • Update commands: update, update-sql, update-count, update-to-tag, update-testing-rollback

  • Rollback commands: rollback, rollback-sql, rollback-count, rollback-count-sql, rollback-to-date, rollback-to-date-sql, future-rollback-sql, future-rollback-count-sql, future-rollback-from-tag-sql

  • Utility and tracking commands: changelog-sync, changelog-sync-sql, changelog-sync-to-tag, status, mark-next-changeset-ran, mark-next-changeset-ran-sql

  • Policy checks: checks run

Commands that do not execute changesets, such as diff, generate-changelog, snapshot, validate, and tag, do not accept the filter arguments. Commands that generate operation reports also record the filter values you used in the report.

Examples

Given these changesets:

--liquibase formatted sql --changeset your.name:1-create-employees conditions:baseline CREATE TABLE employees (id INT NOT NULL PRIMARY KEY, name VARCHAR(100) NOT NULL, department VARCHAR(50)); --rollback DROP TABLE employees; --changeset your.name:2-create-products conditions:hotfix CREATE TABLE products (id INT NOT NULL PRIMARY KEY, name VARCHAR(100) NOT NULL, price DECIMAL(10,2)); --rollback DROP TABLE products; --changeset your.name:3-create-audit-log conditions:maintenance CREATE TABLE audit_log (id INT NOT NULL PRIMARY KEY, action VARCHAR(255), performed_at TIMESTAMP); --rollback DROP TABLE audit_log; --changeset your.name:4-create-app-config CREATE TABLE app_config (id INT NOT NULL PRIMARY KEY, setting_name VARCHAR(100)); --rollback DROP TABLE app_config;

  • liquibase update --conditions-filter=hotfix deploys changeset 2 (products) and changeset 4 (app_config).

  • liquibase update --conditions-filter="hotfix,maintenance" deploys changesets 2, 3, and 4.

  • liquibase update --conditions-filter=weekend-window deploys only changeset 4.

You can also roll back by the same dimension. For example, liquibase rollback-count 1 --conditions-filter=hotfix rolls back the most recently deployed changeset whose conditions attribute matches.

Syntax

You can set this parameter in the following ways:

Option

Syntax

CLI parameter

--conditions-filter=<string>

Liquibase properties file (defaults file)

liquibase.command.conditionsFilter: <string> liquibase.command.<command>.conditionsFilter: <string>

Flow file argument (example)

cmdArgs: { conditions-filter: "<string>" }

JVM system property (JAVA_OPTS environment variable)

JAVA_OPTS=-Dliquibase.command.conditionsFilter=<string> JAVA_OPTS=-Dliquibase.command.<command>.conditionsFilter=<string>

Liquibase environment variable

LIQUIBASE_COMMAND_CONDITIONS_FILTER=<string> LIQUIBASE_COMMAND_<COMMAND>_CONDITIONS_FILTER=<string>