alterStreamTags

Sets or removes tags on an existing stream in Snowflake. Tags must exist before they can be applied.

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 catalog (database) containing the stream

No

schemaName

String

Name of the schema containing the stream

No

streamName

String

Name of the stream to alter

Yes

ifExists

Boolean

Only execute if the stream exists

No

setTags

Nested

Key-value pairs of tags to set*

No

unsetTags

Nested

List of tag names to remove*

No

*Exactly one of setTags or unsetTags must be specified.

setTags nested attributes

Attribute

Type

Description

Required

entry

Nested

Key-value pair for a tag

Yes

unsetTags nested attributes

Attribute

Type

Description

Required

unsetTag

Nested

Tag to remove

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">
  <!-- Set tags -->
  <changeSet id="set-stream-tags" author="examples">
    <pro-snowflake:alterStreamTags streamName="MY_STREAM">
      <pro-snowflake:setTags>
        <pro-snowflake:entry key="MYDB.PUBLIC.environment" value="production"/>
        <pro-snowflake:entry key="MYDB.PUBLIC.owner" value="data-team"/>
      </pro-snowflake:setTags>
    </pro-snowflake:alterStreamTags>
  </changeSet>
  <!-- Unset tags -->
  <changeSet id="unset-stream-tags" author="examples">
    <pro-snowflake:alterStreamTags streamName="MY_STREAM">
      <pro-snowflake:unsetTags>
        <pro-snowflake:unsetTag tagName="MYDB.PUBLIC.environment"/>
      </pro-snowflake:unsetTags>
    </pro-snowflake:alterStreamTags>
  </changeSet>
</databaseChangeLog>