alterStageComment

Sets or removes the comment on an existing stage in Snowflake.

Note: This change type does not support automatic rollback.

Available attributes

Attribute

Type

Description

Required

catalogName

String

Name of the catalog (database) containing the stage

No

schemaName

String

Name of the schema containing the stage

No

stageName

String

Name of the stage to alter

Yes

ifExists

Boolean

Don't error if the stage doesn't exist

No

newComment

String

New comment text to set (nested element)*

No

unsetComment

Boolean

Remove the existing comment*

No

* Exactly one of newComment or unsetComment must be specified.

Note: Stages use SET COMMENT = NULL to unset comments (unlike streams which use UNSET COMMENT).

<?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-stage-comment" author="examples">
    <pro-snowflake:alterStageComment stageName="DATA_STAGE">
      <pro-snowflake:newComment>Stage for loading customer data files</pro-snowflake:newComment>
    </pro-snowflake:alterStageComment>
  </changeSet>
  <!-- Set comment with IF EXISTS -->
  <changeSet id="set-stage-comment-if-exists" author="examples">
    <pro-snowflake:alterStageComment stageName="DATA_STAGE" ifExists="true">
      <pro-snowflake:newComment>Updated stage comment</pro-snowflake:newComment>
    </pro-snowflake:alterStageComment>
  </changeSet>
  <!-- Unset comment -->
  <changeSet id="unset-stage-comment" author="examples">
    <pro-snowflake:alterStageComment stageName="DATA_STAGE" unsetComment="true"/>
  </changeSet>
</databaseChangeLog>