Add to a Deployment script

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

Add to a Deployment script

Postby bomberbri » Wed Jan 02, 2013 4:38 am

I'm trying to add something to a migration script. I know I can edit it manually but what I thought I might be able to do is where you can right click an object in commit changes tab and choose Add new migration script I thought there would be an option to add to existing migration script? If not how do people manage scripts for projects. We have a situation where developers are working on BAU work and a project. WE would like to be able to keep the project scripts together so at a later date they can be deployed as a package in a migration script or similar. How can I achieve this?
Cheers Brian
bomberbri
 
Posts: 2
Joined: Wed Jan 02, 2013 4:18 am

Postby swinghouse » Thu Jan 10, 2013 4:58 pm

I have this question as well.

The current migration script feature is certainly useful, but sometimes we need to script updates/inserts/deletes that don't necessarily correspond to changes in the database structure.

An example, inspired by a recent case:

We needed to update a number of records in our Clients table and the easiest way was to write an sql script.

However, we didn't need to change the structure of the Clients table, we only needed to update some data. Thus, the migration script feature in SQL Source Control wouldn't let us add this script as a migration script.

/Mattias
swinghouse
 
Posts: 99
Joined: Mon Sep 12, 2011 10:51 am

Postby matt_turner » Tue Jan 15, 2013 11:13 am

@bomberbri I'm not sure I understand your problem. Why are you unhappy to make a new migration script for new changes to your objects?

@swinghouse we are currently working on a set of improvements to the migration script functionality in SQL Source Control. One of the features of this new functionality is that it will support adding migration scripts not involving structural changes, like your example.
Matt Turner
Project Manager
SQL Source Control
matt_turner
 
Posts: 2
Joined: Fri May 04, 2012 3:49 pm
Location: Cambridge, UK

Postby swinghouse » Tue Jan 15, 2013 11:24 am

That sounds fantastic, Matt!

/Mattias
swinghouse
 
Posts: 99
Joined: Mon Sep 12, 2011 10:51 am

Postby SnapJag » Mon Feb 11, 2013 5:42 pm

I am glad to hear about this too. It's very much needed in our shop :)
Greg L. Wright
Sr. DBA \\ Consultant
snapjag.com
SnapJag
 
Posts: 3
Joined: Fri Apr 06, 2012 10:49 pm
Location: Salt Lake City

Postby Ruchika » Wed Jan 15, 2014 4:38 pm

Hi Brian/Mattias,

It sounds like you're both using MigrationsV1: http://www.red-gate.com/supportcenter/c ... Migrations

There is a new beta version of Migrations that the team is currently working on. See here: http://documentation.red-gate.com/display/MV2

I'd encourage you to try the beta version out as we've improved a lot of functionality in the beta and made it such that it can be better integrated with your CI system. Also, you should be able to handle your data migration use case by just adding an update sql as a migration script. SQL Compare will then run that update script before applying all other changes. The documentation site explains more about how the new feature works.

Let me know if you have any other question :- )


Cheers,

Ruchika
Ruchika
 
Posts: 8
Joined: Thu Aug 08, 2013 1:32 pm

Postby swinghouse » Mon Jan 27, 2014 2:54 pm

Excellent news! I will definitely try the beta of Migrations V2.
swinghouse
 
Posts: 99
Joined: Mon Sep 12, 2011 10:51 am


Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 2 guests