Partially Source Controlled

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

Moderators: Chris Auckland, David Atkinson, sherr, PhilScrace, andy.campbell.smith

Partially Source Controlled

Postby RMD » Wed Feb 13, 2013 9:38 pm

I have several projects that are add-ons to a 3rd party application. This 3rd party application has a very large database, and many customers want my add-ons to have their schema/data in the same database as the 3rd party application.

This creates a problem for SQL Source Control, as adding a database to source control appears to be an all-or-nothing thing.

Aside from just manually using SQL Compare with a scripts folder, is there a way to utilize SQL Source Control without having to add 100% of the database schema into source control?
RMD
 
Posts: 13
Joined: Thu Jan 29, 2009 5:50 pm

Postby Chris George » Fri Feb 15, 2013 12:06 pm

Hi,

Something that immediately springs to mind (and you'll have to judge whether this would work for you) is to use filters.

You will have to link the database to source control, but before committing your schema objects, filter out the ones you do not want to commit.

This can be done by schema or object name, with/without wildcards. So it depends on how your database is structured as to how easy this is.

The filters are committed to your version control system too, so these can be shared among your database developers using SQL Source Control.

I hope this helps, and let me know if you need help in settings this up.

Regards
Chris
Chris George
SQL Source Control
Red Gate Software
Chris George
 
Posts: 21
Joined: Sun May 31, 2009 8:39 pm
Location: Red Gate Software Ltd

Postby datachomp » Fri Feb 15, 2013 4:46 pm

We hit this issue pretty early on for some of our DB's where multiple apps use the same DB.

Like Chris mentioned, filters worked great for us. If you already have things organized by schema, it makes it tons easier.
datachomp
 
Posts: 1
Joined: Fri Feb 15, 2013 4:39 pm

Postby RMD » Fri Feb 15, 2013 11:01 pm

So you're adding the entire database to source control, and then setting up filters so that you're only checking in/out the stuff that matches your schema (or whatever)?

Is there a way to not have to add the entire database? This 3rd party database has tens of thousands of objects.
RMD
 
Posts: 13
Joined: Thu Jan 29, 2009 5:50 pm

Postby Chris George » Sat Feb 16, 2013 12:47 am

Hi RMD,

Whilst it is true that the database is linked to source control, you would only be committing/retrieving the objects that satisfies your filter.

We don't automatically commit your entire database when you link, so as long as you apply the filter before your first commit, then you should see the behaviour you desire.

Regards
Chris
Chris George
SQL Source Control
Red Gate Software
Chris George
 
Posts: 21
Joined: Sun May 31, 2009 8:39 pm
Location: Red Gate Software Ltd


Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 1 guest