alterShareComment

Sets or removes the comment on an existing share 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

shareName

String

Name of the share to alter

Yes

ifExists

Boolean

Don't error if the share doesn't exist

No

newComment

String

New comment text to set*

No

unsetComment

Boolean

Remove the existing comment*

No

* Exactly one of newComment or unsetComment must be specified.

<?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 comment -->
  <changeSet id="set-share-comment" author="examples">
    <pro-snowflake:alterShareComment
                shareName="MY_SHARE"
                newComment="Production data share for analytics team"/>
  </changeSet>
  <!-- Set comment with IF EXISTS -->
  <changeSet id="set-share-comment-if-exists" author="examples">
    <pro-snowflake:alterShareComment
                shareName="MY_SHARE"
                ifExists="true"
                newComment="Updated comment for existing share"/>
  </changeSet>
  <!-- Unset comment -->
  <changeSet id="unset-share-comment" author="examples">
    <pro-snowflake:alterShareComment
                shareName="MY_SHARE"
                unsetComment="true"/>
  </changeSet>
</databaseChangeLog>