Red Gate forums :: View topic - New to SQL Source Control - how to get initial source commit
Return to www.red-gate.com RSS Feed Available

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

New to SQL Source Control - how to get initial source commit

Search in SQL Source Control 3 forum
Post new topic   Reply to topic
Jump to:  
Author Message
shiftbit



Joined: 06 Mar 2013
Posts: 9

PostPosted: Wed Mar 06, 2013 12:45 am    Post subject: New to SQL Source Control - how to get initial source commit Reply with quote

Have SVN and a repository structure like so:
Tags
Branches
Trunk

How do I get a scripted copy of my database(s) into trunk?

Typically, trunk is reserved for merging changes INTO from other branches.

So in a typical scenario, I would branch code off to one of the branches, then make changes there. Ive been going through some of the examples on the red gate site, but am still a bit confused with "linking".
ie, http://www.red-gate.com/supportcenter/Content/SQL_Source_Control/help/3.1/SSC_WE_Setting_up

Say I have a local instance and I have also made a branch of the code from trunk to work on.
1st,
How do I get this initial copy into trunk
2nd,
How do I point my local db at my branched code?

I created a test branch, and managed to link my local instance to this path. I made a simple procedure change, committed the change, then checked the branch. Nothing there?


This is the work flow I am hoping I can achieve:
- create an initial copy of several databases in trunk (how?)
- branch this code to make changes within the branch
- the branch will be checked out locally and used against a local instance of the given database
- merge changes back into trunk
- apply changes from trunk to target database on a different server
Back to top
View user's profile Send private message
shiftbit



Joined: 06 Mar 2013
Posts: 9

PostPosted: Wed Mar 06, 2013 1:00 am    Post subject: Reply with quote

Ok, now that just posted all of the above, I think my problem was the subversion repository browser. I closed it down and re-opened, and my test branch had a scripted copy of my database.

So, now I think I see the path I need to take to get my database(s) into source.

Make a backup copy of each of my database(s)
restore them locally
link each to a path in Trunk in subversion, each in their own folder
this should create the scripted versions in trunk
THEN I can branch from there to make changes in the branch...err I think

So lets say I create a branch to work on, and I have a local instance, how can I point this local instance at my branched code?
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1114
Location: Twitter: @dtabase

PostPosted: Wed Mar 06, 2013 9:37 am    Post subject: Reply with quote

If you create a branch, you simply link your database to that branch in the same way you did when linking the trunk.

Let us know how you get on.

David Atkinson
Red Gate
Back to top
View user's profile Send private message Send e-mail
shiftbit



Joined: 06 Mar 2013
Posts: 9

PostPosted: Wed Mar 06, 2013 1:19 pm    Post subject: Reply with quote

David,

Thanks for the reply. That is what i am about to do this morning. Putting our sql objects under source control is a top priority of mine, so I can keep track of changes. I will report back when Im finished.
Back to top
View user's profile Send private message
shiftbit



Joined: 06 Mar 2013
Posts: 9

PostPosted: Wed Mar 06, 2013 11:12 pm    Post subject: Reply with quote

Ok, I managed to finish earlier today getting several databases scripted and placed into our subversion repository. Using a combination of SQL Compare and SQL Source Control, I did the following:

- created empty local databases
- use sql compare to basically re-recreate the database that I want to version and use as a starting point (the production db server).
- once I had local instance copies of the databases I wanted to version, I linked each one in turn with a path in the main branch of svn (trunk).
- since this was new, all the changes were "add", so i committed the changes and now I had these db's scripted and in subversion! success, a starting point for further development.
- now I branched trunk to create a development branch.
- checked out this development branch, made a small update, and committed the changes.
- re-linked the database that was associated with the change, then did a "get latest" from within SSMS and the source control tab. A conflict was detected and I took the version in SVN.
- now my local instance had the update.

im cooking now!
Back to top
View user's profile Send private message
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