alterMaterializedViewProperties

Alters properties of a materialized view in Snowflake, including security settings, comments, and data metric schedules. Materialized views require Snowflake Enterprise Edition or higher.

Note: This change type does not support automatic rollback or database inspection features (snapshot, diff, diff-changelog, and generate-changelog commands).

Available attributes

Attribute

Type

Description

Required

catalogName

String

Name of the catalog (database) containing the materialized view

No

schemaName

String

Name of the schema containing the materialized view

No

viewName

String

Name of the materialized view to alter

Yes

secure

Boolean

Set the view as SECURE*

No

comment

String

Comment to set on the materialized view*

No

dataMetricSchedule

String

Schedule for data metric computation*

No

unsetSecure

Boolean

Remove the SECURE property*

No

unsetComment

Boolean

Remove the comment*

No

unsetDataMetricSchedule

Boolean

Remove the data metric schedule*

No

* Only one SET or UNSET property can be specified per change

<?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 property -->
  <changeSet id="mv-set-secure" author="examples">
    <pro-snowflake:alterMaterializedViewProperties
                viewName="MV_SALES_SUMMARY"
                secure="true"/>
  </changeSet>
  <!-- Set comment -->
  <changeSet id="mv-set-comment" author="examples">
    <pro-snowflake:alterMaterializedViewProperties
                viewName="MV_SALES_SUMMARY"
                comment="Materialized view for sales aggregations"/>
  </changeSet>
  <!-- Set data metric schedule -->
  <changeSet id="mv-set-metric-schedule" author="examples">
    <pro-snowflake:alterMaterializedViewProperties
                viewName="MV_SALES_SUMMARY"
                dataMetricSchedule="15 MINUTE"/>
  </changeSet>
  <!-- Unset SECURE property -->
  <changeSet id="mv-unset-secure" author="examples">
    <pro-snowflake:alterMaterializedViewProperties
                viewName="MV_SALES_SUMMARY"
                unsetSecure="true"/>
  </changeSet>
  <!-- Unset comment -->
  <changeSet id="mv-unset-comment" author="examples">
    <pro-snowflake:alterMaterializedViewProperties
                viewName="MV_SALES_SUMMARY"
                unsetComment="true"/>
  </changeSet>
</databaseChangeLog>