alterDynamicTable alterImmutableWhere

Modifies the immutable WHERE clause for a dynamic table. The immutable WHERE clause defines a filtering condition that remains constant across table refreshes, allowing Snowflake to optimize incremental refreshes.

Known limitations:

  • This change type does not support automatic rollback.

  • Snowflake snapshots created with Liquibase Secure 5.1 are incompatible with earlier versions due to enhanced object type detection for TABLES and VIEWS. Regenerate all snapshots with 5.1 after upgrading to avoid false differences in diff and diff-changelog operations.

Available attributes

Attribute

Type

Description

Required

catalogName

String

Name of the catalog (database) containing the table

No

schemaName

String

Name of the schema containing the table

No

tableName

String

Name of the dynamic table to alter

Yes

ifExists

Boolean

Only execute if the table exists

No

alterImmutableWhere nested attributes

Attribute

Type

Description

Required

newImmutableWhere

String

New immutable WHERE clause expression

No*

unsetImmutableWhere

Boolean

If true, removes the immutable WHERE clause

No*

*Exactly one of newImmutableWhere or unsetImmutableWhere must be specified.

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:pro-snowflake="http://www.liquibase.org/xml/ns/pro-snowflake"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
        http://www.liquibase.org/xml/ns/pro-snowflake
        http://www.liquibase.org/xml/ns/pro-snowflake/liquibase-pro-snowflake-latest.xsd">
  <!-- Set immutable WHERE clause -->
  <changeSet id="set-immutable-where" author="examples">
    <pro-snowflake:alterDynamicTable tableName="ORDERS_SUMMARY">
      <pro-snowflake:alterImmutableWhere newImmutableWhere="REGION IN ('US', 'EU', 'APAC')"/>
    </pro-snowflake:alterDynamicTable>
  </changeSet>
  <!-- Unset immutable WHERE clause -->
  <changeSet id="unset-immutable-where" author="examples">
    <pro-snowflake:alterDynamicTable tableName="ORDERS_SUMMARY">
      <pro-snowflake:alterImmutableWhere unsetImmutableWhere="true"/>
    </pro-snowflake:alterDynamicTable>
  </changeSet>
</databaseChangeLog>