alterSchemaManagedAccess

Enables or disables managed access for a Snowflake schema. Managed access schemas centralize privilege management by allowing only schema owners (or roles with MANAGE GRANTS privilege) to grant privileges on objects within the schema.

Note: Automatic rollback toggles the managed access setting back.

Known limitation: This change type does not support 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 modify

Yes

ifExists

Boolean

Don't error if the schema doesn't exist

No

enableManagedAccess

Boolean

true to enable, false to disable managed access

Yes

<?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">
  <!-- Enable managed access -->
  <changeSet id="enable-managed-access" author="examples">
    <pro-snowflake:alterSchemaManagedAccess
                schemaName="ANALYTICS"
                enableManagedAccess="true"/>
  </changeSet>
  <!-- Enable with IF EXISTS -->
  <changeSet id="enable-managed-access-if-exists" author="examples">
    <pro-snowflake:alterSchemaManagedAccess
                schemaName="STAGING"
                ifExists="true"
                enableManagedAccess="true"/>
  </changeSet>
  <!-- Disable managed access -->
  <changeSet id="disable-managed-access" author="examples">
    <pro-snowflake:alterSchemaManagedAccess
                catalogName="PROD_DB"
                schemaName="ANALYTICS"
                enableManagedAccess="false"/>
  </changeSet>
</databaseChangeLog>