Red Gate forums :: View topic - Feature Request: store user default schema
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Source Control 2
SQL Source Control 2 forum

Feature Request: store user default schema

Search in SQL Source Control 2 forum
Post new topic   Reply to topic
Jump to:  
Author Message
meyerovb



Joined: 09 Dec 2010
Posts: 13

PostPosted: Wed Apr 13, 2011 6:27 pm    Post subject: Feature Request: store user default schema Reply with quote

I create a user, it stores the username and owned roles (db_owner), but it doesnt store the default schema, which is important in my case.
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 755
Location: Red Gate Software Ltd.

PostPosted: Mon Apr 18, 2011 4:27 pm    Post subject: Reply with quote

Thanks for your post.

The default schema should be scripted for the database level users. For example, if you create:

Code:
CREATE USER [test] FOR LOGIN [test] WITH DEFAULT_SCHEMA=[test_schema]


This will be added to the repository.

How are you creating the user?
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
meyerovb



Joined: 09 Dec 2010
Posts: 13

PostPosted: Tue Apr 19, 2011 2:23 pm    Post subject: Steps to reproduce Reply with quote

Create DB1, create Schema1, create User1 with default schema Schema1, link to source control and commit.

Create DB2, create User1 with no default schema, link to DB1 source control directory, get latest. Schema1 is created, but User1 is not set to default schema Schema1.
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 755
Location: Red Gate Software Ltd.

PostPosted: Thu Apr 21, 2011 3:25 pm    Post subject: Reply with quote

Thanks for your reply, I can see what you mean now.

Unfortunately, the default_schema setting is a user property that is automatically ignored by SQL Source Control. SQL Source control uses our SQL Compare engine to compare the differences between the live database and what's stored in Source Control. It's a default option in SQL Compare to ignore the 'user properties' and SQL source control uses the default SQL Compare options. We have an open feature request to allow the user to configure the SQL Compare engine options, which you might like to vote for here

Currently the only workarounds I can think of are:

1) Delete user1 from DB2 and then 'get' the complete user from source control.
2) Use SQL Compare to deploy the user from Source Control to the database, and turn off the option: 'ignore' > 'user properties'

I hope this helps explain.

Let me know if you need any more information.
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group