alterSchemaProperties

Sets or unsets multiple properties on an existing schema in Snowflake.

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 alter

Yes

ifExists

Boolean

Only alter if the schema exists using IF EXISTS

No

dataRetentionTimeInDays

Integer

Number of days to retain data for Time Travel*

No

maxDataExtensionTimeInDays

Integer

Maximum days to extend data retention

No

comment

String

Comment text for the schema

No

defaultDdlCollation

String

Default collation for string columns

No

classificationProfile

String

Fully-qualified name of classification profile

No

objectVisibility

String

Object visibility setting (PRIVILEGED)

No

logLevel

String

Log level (DEBUG, INFO, WARN, ERROR, FATAL, OFF)

No

traceLevel

String

Trace level (ALWAYS, ON_EVENT, OFF)

No

defaultNotebookComputePoolCpu

String

Default CPU compute pool for notebooks

No

defaultNotebookComputePoolGpu

String

Default GPU compute pool for notebooks

No

defaultStreamlitNotebookWarehouse

String

Default warehouse for Streamlit notebooks

No

replicableWithFailoverGroups

Boolean

Enable replication with failover groups (YES/NO)

No

unsetDataRetentionTimeInDays

Boolean

Unset data retention time

No

unsetMaxDataExtensionTimeInDays

Boolean

Unset max data extension time

No

unsetComment

Boolean

Remove the comment

No

unsetDefaultDdlCollation

Boolean

Unset default DDL collation

No

unsetClassificationProfile

Boolean

Unset classification profile

No

unsetObjectVisibility

Boolean

Unset object visibility

No

unsetLogLevel

Boolean

Unset log level

No

unsetTraceLevel

Boolean

Unset trace level

No

unsetDefaultNotebookComputePoolCpu

Boolean

Unset CPU compute pool

No

unsetDefaultNotebookComputePoolGpu

Boolean

Unset GPU compute pool

No

unsetDefaultStreamlitNotebookWarehouse

Boolean

Unset Streamlit warehouse

No

unsetReplicableWithFailoverGroups

Boolean

Unset replicable with failover groups

No

* Standard Edition supports 0 or 1 only; Enterprise Edition supports 0-90 days.

At least one SET or UNSET property must be specified. Cannot mix SET and UNSET in the same changeset.

<?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 properties -->
  <changeSet id="set-schema-properties" author="examples">
    <pro-snowflake:alterSchemaProperties
                schemaName="ANALYTICS"
                ifExists="true"
                dataRetentionTimeInDays="1"
                logLevel="INFO"
                traceLevel="ALWAYS"
                comment="Analytics schema"/>
  </changeSet>
  <!-- Unset properties -->
  <changeSet id="unset-schema-properties" author="examples">
    <pro-snowflake:alterSchemaProperties
                schemaName="ANALYTICS"
                ifExists="true"
                unsetComment="true"
                unsetLogLevel="true"
                unsetTraceLevel="true"/>
  </changeSet>
  <!-- Set all properties -->
  <changeSet id="set-all-properties" author="examples">
    <pro-snowflake:alterSchemaProperties
                schemaName="PRODUCTION_DATA"
                dataRetentionTimeInDays="1"
                maxDataExtensionTimeInDays="14"
                comment="Production data schema"
                defaultDdlCollation="en-ci"
                logLevel="WARN"
                traceLevel="OFF"
                replicableWithFailoverGroups="true"/>
  </changeSet>
</databaseChangeLog>