alterViewProperties

Sets or unsets properties on an existing Snowflake view.

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 view

No

schemaName

String

Name of the schema containing the view

No

viewName

String

Name of the view to alter

Yes

ifExists

Boolean

If true, only alters if the view exists using IF EXISTS

No

secure

Boolean

Set to true for SET SECURE, false for UNSET SECURE

No*

comment

String

New comment text to set

No*

unsetComment

Boolean

If true, removes the existing comment

No*

*Exactly one SET or UNSET operation must be specified. Only one property can be set or unset per statement.

<?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 SECURE -->
  <changeSet id="set-secure" author="examples">
    <pro-snowflake:alterViewProperties
            viewName="MY_VIEW"
            secure="true"/>
  </changeSet>
  <!-- Unset SECURE -->
  <changeSet id="unset-secure" author="examples">
    <pro-snowflake:alterViewProperties
            viewName="MY_VIEW"
            secure="false"/>
  </changeSet>
  <!-- Set comment -->
  <changeSet id="set-comment" author="examples">
    <pro-snowflake:alterViewProperties
            viewName="MY_VIEW"
            comment="View containing customer data"/>
  </changeSet>
  <!-- Unset comment -->
  <changeSet id="unset-comment" author="examples">
    <pro-snowflake:alterViewProperties
            viewName="MY_VIEW"
            unsetComment="true"/>
  </changeSet>
  <!-- With IF EXISTS -->
  <changeSet id="alter-with-if-exists" author="examples">
    <pro-snowflake:alterViewProperties
            catalogName="MYDB"
            schemaName="PUBLIC"
            viewName="MY_VIEW"
            ifExists="true"
            secure="true"/>
  </changeSet>
</databaseChangeLog>