dropMaterializedView

Drops an existing materialized view in Snowflake. 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 drop

Yes

ifExists

Boolean

Only drop if the view exists using IF EXISTS

No

<?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">
  <!-- Basic drop -->
  <changeSet id="drop-mv-basic" author="examples">
    <pro-snowflake:dropMaterializedView viewName="MV_SALES_SUMMARY"/>
  </changeSet>
  <!-- Drop with IF EXISTS -->
  <changeSet id="drop-mv-if-exists" author="examples">
    <pro-snowflake:dropMaterializedView
                viewName="MV_OLD_ANALYTICS"
                ifExists="true"/>
  </changeSet>
  <!-- Drop with schema qualification -->
  <changeSet id="drop-mv-qualified" author="examples">
    <pro-snowflake:dropMaterializedView
                catalogName="MY_DATABASE"
                schemaName="ANALYTICS"
                viewName="MV_DEPRECATED"
                ifExists="true"/>
  </changeSet>
</databaseChangeLog>