Migration Script is not working in Branches

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

Migration Script is not working in Branches

Postby joseph.tg » Mon Jul 22, 2013 1:03 pm

Hi Team,

I have Dev,Test and Stage branches created in TFS. Dev I have linked 'Dev Branch' to the Red gate Source control and developers are able to commit their changes properly.

For the 'Test Server' deployment, we are merging the selected changes directly from 'Dev Branch' to 'Test Branch' from 'Dev Branch'. while check-in a command line script will execute and it will update the changes to the 'Test database'.

For the 'Stage Server' deployment, we are merging the selected changes from 'Test Branch' to ' Stage Branch'. while check-in a command line script will execute and it will update the changes from 'Stage Branch' to the 'Stage database'.

Now I am facing an issue with migration script. Migration script only considering in 'Dev Branch'. While doing the Test/Staging deployment these migration scripts are not considering.

How to resolve this issue?
How the branch structure will support in red gate source control?

Regards,
Joseph
joseph.tg
 
Posts: 11
Joined: Thu May 30, 2013 7:53 am

Postby eddie davis » Wed Jul 24, 2013 3:00 pm

Hi Joseph, thank you for your forum post.

The current way that the Migration Scripts operate, they do not support or work across branches.

The good news is that these is a project in development, known as Migrations V2, which is planned to address the branching issues. Sadly I do not have an ETA as to when this new version of the Migrations process will become available.

When I receive further information, I will update this forum post.

Many Thanks
Eddie
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
 
Posts: 943
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software

Postby David Pond » Wed Jul 24, 2013 8:53 pm

Hi Joseph,

You can join our Google group where we're discussing the development of migrations v2 here: https://groups.google.com/group/red-gate-migrations

We've just released an early access build of SoC to demonstrate the approach we're considering.

David
David Pond
Site Admin
 
Posts: 24
Joined: Tue Mar 06, 2012 7:13 pm
Location: Cambridge, UK

Postby joseph.tg » Mon Aug 05, 2013 11:46 am

Hi Team,

We are in the middle of Red Gate source control implementation. Can you please update me the ETA of this functionality.

Also we are using SQL compare and SQL Data Compare for automated (Command-line) deployment. Are we going to integrate the migration scripts functionality soon? What will be the ETA of this?

My requirements are:
1) Migration scripts should work across the branches. Means, I need to deploy the database changes from Branch to database including migration scripts.
2) I need to include custom scripts for the deployment, this also should work in branch architecture.
3) Both Migration scripts and Custom scripts need to deploy from one Branch to databases through the command line scripts

Can any one update me, whether above 3 points are going to cover with new release or not.

Regards,
Joseph
joseph.tg
 
Posts: 11
Joined: Thu May 30, 2013 7:53 am

Migrations v2 Early Access Release is now available

Postby sherr » Mon Aug 05, 2013 1:49 pm

Hi Joseph,

The early access release of SQL Source Control with Migrations v2 is now available. You can read more about this and download it from http://documentation.red-gate.com/displ ... ss+release.

We do not have a command line yet, but should have that shortly (within a week or 2). I will update this forum as soon as it's available. This will help with automated deployments and pick up Migration scripts. It will then go into SQL Compare and SQL Data Compare (GUI and command lines), but I don't have an estimate for this yet.

Regarding your requirements:
1) Migration scripts should work across the branches. Means, I need to deploy the database changes from Branch to database including migration scripts.
This should work. We no longer rely on repository location or revision number so that Migrations will work across branches.

2) I need to include custom scripts for the deployment, this also should work in branch architecture.
I don't understand how a custom script is different from a migration script that is used during deployment. Could you explain this more?

3) Both Migration scripts and Custom scripts need to deploy from one Branch to databases through the command line scripts
As mentioned above, we should have a command line shortly that will pick up Migration scripts to be used in automated deployments. I'm not sure about what you mean by Custom scripts. Migration scripts are custom scripts that are re-used by SQL Compare during deployment.

Cheers!
Thank you!
Stephanie M. Herr :-)
Delivery Product Manager
sherr
 
Posts: 126
Joined: Thu Mar 19, 2009 12:45 pm
Location: Cambridge

Postby joseph.tg » Mon Aug 05, 2013 2:53 pm

Hi,

Custom script means, suppose I have to update some data in a table as part of a deployment. This is not a part of DDL changes. In this case I want to create a script and execute the same at the time of deployment.

How we can achieve this with Migration Script V2 ?

Regards,
Joseph
joseph.tg
 
Posts: 11
Joined: Thu May 30, 2013 7:53 am

Custom Script

Postby sherr » Mon Aug 05, 2013 3:06 pm

Hi Joseph,

Thanks for clarifying. In Migrations v2, a migration script doesn't have to be tied to DDL changes. So, you can just write your UPDATE script as a migration script and this will be picked up like all the other migrations. To do this, use the "Add migration script..." button on the Migrations tab.
Thank you!
Stephanie M. Herr :-)
Delivery Product Manager
sherr
 
Posts: 126
Joined: Thu Mar 19, 2009 12:45 pm
Location: Cambridge

Postby joseph.tg » Tue Aug 06, 2013 6:46 am

Hi Stephanie,

Thanks for your quick response!

I am using command-line SQL Compare for automation. What will be the ETA of this Migration V2 integrated command-line SQL Compare
Can I expect this in next 3 months?
If it is more than that, is there any alternate method for this?

I want to communicate the ETA with my team. Can you help me on this.

Regards,
Joseph
joseph.tg
 
Posts: 11
Joined: Thu May 30, 2013 7:53 am

ETA for command-line integration

Postby sherr » Tue Aug 06, 2013 7:06 am

Hi Joseph,

We should have a command line that will do what you need within the next week or 2. This will pick up migration scripts and also do a SQL Compare of the source and target to either generate a deployment script or synch the target directly. Just like SQL Compare will do.

It's separate for now while we integrate Migrations v2 into the SQL Compare GUI. Once this integration is done, then we'll have a release of SQL Compare with the updated command line to pick up the new migrations.

So, you can use this alternative command line to do automated deployments (esp. in CI environments) until SQL Compare is ready. It will have the same licensing requirements as SQL Compare.

I hope this helps! We'd love to hear how you get on with the SQL Source Control Early Access Release and this migration command line tool.
Thank you!
Stephanie M. Herr :-)
Delivery Product Manager
sherr
 
Posts: 126
Joined: Thu Mar 19, 2009 12:45 pm
Location: Cambridge

Postby Ruchika » Thu Aug 08, 2013 1:51 pm

Hi Joseph,

As Stephanie mentioned, you can now download the command line tool to use in your automated deployments from here: http://documentation.red-gate.com/display/MV2/

The above link also contains documentation to help you get started with migrations V2. If you want to be more involved in our development decisions, please join us at https://groups.google.com/group/red-gate-migrations

Let me know if you need any help with the command line tool.

Thanks,

Ruchika Raj
SQL Source Control Development Team
Red Gate Software Ltd.
T: 01223 438855
Ruchika
 
Posts: 8
Joined: Thu Aug 08, 2013 1:32 pm

Postby joseph.tg » Tue Aug 13, 2013 12:09 pm

Hi Ruchika,

Can you explain how to generate migration script using command line? Is there any worked example for this?

Regards,
Joseph
joseph.tg
 
Posts: 11
Joined: Thu May 30, 2013 7:53 am

Postby Ruchika » Thu Aug 15, 2013 5:30 pm

Hi Joseph,

I've written a quick guide to help you with the command line tool:

ftp://support.red-gate.com/patches/SQL_ ... e_tool.pdf


Let me know if you still need any help.



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

Postby joseph.tg » Wed Sep 04, 2013 12:47 pm

Hi Ruchika,

Now I am using SQL compare command line for automated deployment
(SqlCompare.exe).
What is the ETA of Migration V2 integrated SQL compare command line?

Thanks,
Joseph
joseph.tg
 
Posts: 11
Joined: Thu May 30, 2013 7:53 am

Postby Ruchika » Fri Sep 06, 2013 4:09 pm

Hi Joseph,

We're expecting to do a beta release of SQL Compare with Migrations V2 sometime during the 2nd week of October. Meanwhile, were you able to use the migs.exe command line to generate your deployment scripts?


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

Postby joseph.tg » Wed Oct 16, 2013 1:19 pm

Hi Ruchika,

Is Migration V2 integrated SQL compare command line released? If not, what is the ETA for this?

Regards,
Joseph
joseph.tg
 
Posts: 11
Joined: Thu May 30, 2013 7:53 am

Next

Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 0 guests

cron