How to ignore grant permission within schema change

ducmanducman Posts: 17 New member
edited May 23, 2018 6:35PM in ReadyRoll
Schema file tend to have the creation of the schema with grant permissions of that schema to users. 

But if we filter out users, how can we filter out the grant permission to those users within the schema file?

-- example ... how does one filter/ignore the grant line so readyroll doesn't detect these changes?
CREATE SCHEMA [test] -- schema exists in all regions
AUTHORIZATION [dbo]
GO
GRANT DELETE ON SCHEMA:: [test] TO [domain\test_user] -- user only exists in dev region
GO
Tagged:

Best Answer

  • dnlnlndnlnln Posts: 234 Gold 2
    Accepted Answer
    You can ignore all user permissions, as role memberships that include users, by adding the following to your ProjectName.sqlproj file under the <Project> element:
    <div>&lt;PropertyGroup&gt;&nbsp; &nbsp; &nbsp; 
    &lt;SyncOptionIgnoreUsersPermissionsAndRoleMemberships&gt;True&lt;/SyncOptionIgnoreUsersPermissionsAndRoleMemberships&gt;
    <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: Roboto, &quot;Helvetica Neue&quot;, Arial, sans-serif;">&lt;/PropertyGroup&gt;</span></div>
    When you next import your database, such permissions & memberships will be excluded from the generated migrations

    For more information, see Key concepts > Configuring comparison & script generation options.
    Daniel Nolan
    Product Manager
    Redgate Software

Answers

  • RichardLRichardL Posts: 418 Gold 4
    Hi @ducman

    Thanks for your post. 

    If you don't receive a response from the community and you have a support contract you can always send us a ticket so that a product specialist can help you with your issue. 

    Kind regards

    Richard Lynch. 
    Customer Support
    Redgate Software
Sign In or Register to comment.