Home > Back-end >  Redgate SQL Source Control: ignoring Database Roles
Redgate SQL Source Control: ignoring Database Roles

Time:07-12

I'm using Redgate Source Control to changetrack a database. I have a testing database from which I commit, and a production database which is the final target.

I want to have a different Database Role (the setting found of Database->Security->Roles->Database Roles) in the production database because of specific requirements. I have changed one database on my production server, but every time I deploy to the production database, the Database Role resets to the status it was before I changed it (even though the specific role is not synced).

I found a filter on Comparison Options for user roles and checked the Ignore: "User's permissions and role memberships" and deployed the filter, but the Database role still resets every time I deploy any change to production. enter image description here

Is there a way to ignore Database roles or is there a workaround I could use?

CodePudding user response:

In SQL Control, there is an option for ignoring roles entirely (or using a rule to ignore certain ones).

Select your source controlled database in the Object Explorer, and then click SQL Source Control in your toolbar. Go to the Setup Page, and then select "Edit filter rules".

Then simply untick Role and the Roles won't be source controlled any more, or you can add rules to exclude/include roles that meet said rule(s). Note you may need to remove the Role details from your Source Control repository as well, as otherwise the position of the role when you stopped Source Controlling it may be used (I suggest checking).

Edit Filter Rules Screen

  • Related