dropSchema

Drops a schema in Snowflake with optional CASCADE/RESTRICT modes and IF EXISTS support.

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 database containing the schema

No

schemaName

String

Name of the schema to drop

Yes

ifExists

Boolean

Don't error if schema doesn't exist using IF EXISTS

No

dropMode

String

CASCADE (drop all objects) or RESTRICT (fail if not empty)

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-schema" author="examples">
    <pro-snowflake:dropSchema schemaName="OLD_SCHEMA"/>
  </changeSet>
  <!-- Drop with IF EXISTS -->
  <changeSet id="drop-schema-if-exists" author="examples">
    <pro-snowflake:dropSchema
                schemaName="TEMP_SCHEMA"
                ifExists="true"/>
  </changeSet>
  <!-- Drop with CASCADE -->
  <changeSet id="drop-schema-cascade" author="examples">
    <pro-snowflake:dropSchema
                schemaName="STAGING"
                ifExists="true"
                dropMode="CASCADE"/>
  </changeSet>
</databaseChangeLog>

dropSchema - Liquibase