createRole

Creates a new role in Snowflake. Roles are named entities to which privileges can be granted and are used to control access to database objects.

Attributes

<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">
  <changeSet id="1" author="test">
    <pro-snowflake:createRole roleName="data_analyst"/>
  </changeSet>
  <changeSet id="2" author="test">
    <pro-snowflake:createRole roleName="analytics_team_lead"
                                   replaceIfExists="true"
                                   comment="Analytics Team Lead - Full access to analytics schemas"/>
  </changeSet>
  <changeSet id="3" author="test">
    <!-- Create tags first -->
    <sql>CREATE TAG environment</sql>
    <sql>CREATE TAG owner</sql>
    <!-- Create role with tags -->
    <pro-snowflake:createRole roleName="test_harness_role"
                                   comment="Test role for harness validation">
      <pro-snowflake:tags>
        <pro-snowflake:entry key="environment" value="test"/>
        <pro-snowflake:entry key="owner" value="integration_test"/>
      </pro-snowflake:tags>
    </pro-snowflake:createRole>
    <rollback>
      <pro-snowflake:dropRole roleName="test_harness_role" ifExists="true"/>
      <sql>DROP TAG IF EXISTS owner</sql>
      <sql>DROP TAG IF EXISTS environment</sql>
    </rollback>
  </changeSet>
</databaseChangeLog>