dropRowAccessPolicyOnView
Removes a row access policy from a view in Snowflake. After removing the policy from all views and tables, the policy itself can be dropped.
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 |
|---|---|---|---|
| String | Name of the catalog (database) containing the view | No |
| String | Name of the schema containing the view | No |
| String | Name of the view to remove the policy from | Yes |
| String | Name of the catalog containing the policy | No |
| String | Name of the schema containing the policy | No |
| String | Name of the row access policy to remove | Yes |
| Boolean | Remove policy only if view exists using | No |
<?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">
<!-- Basic drop policy from view -->
<changeSet id="drop-policy-from-view" author="examples">
<pro-snowflake:dropRowAccessPolicyOnView
viewName="EMPLOYEE_SUMMARY_VIEW"
policyName="DEPARTMENT_ACCESS_POLICY"/>
</changeSet>
<!-- Drop policy with IF EXISTS -->
<changeSet id="drop-policy-from-view-if-exists" author="examples">
<pro-snowflake:dropRowAccessPolicyOnView
viewName="SALES_REPORT_VIEW"
policyName="TENANT_ISOLATION_POLICY"
ifExists="true"/>
</changeSet>
<!-- Drop cross-schema policy from view -->
<changeSet id="drop-policy-cross-schema" author="examples">
<pro-snowflake:dropRowAccessPolicyOnView
viewName="FINANCE_DASHBOARD_VIEW"
policySchemaName="SECURITY"
policyName="FINANCE_ACCESS_POLICY"/>
</changeSet>
</databaseChangeLog>