Red Gate forums :: View topic - (Newbie) Need a procedure to handle data migrations
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

(Newbie) Need a procedure to handle data migrations

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



Joined: 21 Oct 2011
Posts: 4

PostPosted: Fri Oct 21, 2011 12:55 am    Post subject: (Newbie) Need a procedure to handle data migrations Reply with quote

The most common problem I am running into is adding new NOT NULL columns to tables. Before Source Control, this was simply a matter of executing a script against each DB:

1. add the column to the table
2. set initial value in exiting rows
3. alter column to not null

What's the right approach with SQL Source Control?
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1112

PostPosted: Fri Oct 21, 2011 5:31 am    Post subject: Reply with quote

Have you tried the latest v3 early access build? This has a feature that lets you add your own custom migration script to override default behavior. What you need to do is to add a migration script to cover the change in which the NOT NULL column was added, and to edit the default script to add the UPDATE statement.

see:
http://www.red-gate.com/MessageBoard/viewtopic.php?t=14110

This feature works with TFS, SVN and Vault for the time being. Which do you use?

David Atkinson
Product Manager
Red Gate Software
Back to top
View user's profile Send private message Send e-mail
chrisherring



Joined: 21 Oct 2011
Posts: 4

PostPosted: Fri Oct 21, 2011 6:11 am    Post subject: Reply with quote

David,

Thanks for the information. The Data Migration feature sounds like exactly what we need. We are using git; I take it that means we cannot use the v3 build yet.

Chris
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1112

PostPosted: Fri Oct 21, 2011 10:30 am    Post subject: Reply with quote

That's right, there isn't GIT support yet. Can I ask you to raise a feature request here so we can size the community interest?

http://redgate.uservoice.com/forums/39019-sql-source-control

Although there's one for Mercurial, there isn't a migrations feature request for GIT support, so you'll need to create a new one.

Thanks,

David
Back to top
View user's profile Send private message Send e-mail
chrisherring



Joined: 21 Oct 2011
Posts: 4

PostPosted: Fri Oct 21, 2011 11:01 am    Post subject: Reply with quote

Feature request added.

Thanks

Chris
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1112

PostPosted: Fri Oct 21, 2011 11:04 am    Post subject: Reply with quote

Feel free to try out the feature on a 'test' database using the 'just evaluating' option and provide us with feedback on the feature itself.

Thanks.

David
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