Red Gate forums :: View topic - Migration Scripts not being detected
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Migration Scripts not being detected

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
carina23



Joined: 15 Aug 2012
Posts: 1

PostPosted: Wed Aug 15, 2012 1:41 pm    Post subject: Migration Scripts not being detected Reply with quote

Hi,

We've been trying to get Redgate migration scripts going for our next release, and have found that Redgate Compare isn't picking up on the migration scripts already committed to TFS. We're using SQL Server 2008 and TFS 2010.

When going through the deployment wizard the step for selecting the migration scripts to include is skipped over as it says there are none.

There doesn't seem to be any way of selecting where the migration scripts are kept in SQL Compare (like you would in linking a database to source control in redgate source control in SSMS). How does SQL Compare pick up on the location of the migration scripts folder?
Back to top
View user's profile Send private message
jhilden



Joined: 24 Apr 2012
Posts: 9

PostPosted: Mon Oct 01, 2012 10:02 pm    Post subject: Reply with quote

I'm having a problem with it not picking up migration scripts for some databases as well. I'm using SVN and SQL Server 2008. Is anyone else seeing this?

Note: in your "from" database if you right click and go to properties and then look in the extended properties tab you'll see that the version number, URL, and Migration scripts URL are all listed there.
Back to top
View user's profile Send private message
BobGood



Joined: 25 Mar 2008
Posts: 8

PostPosted: Fri Nov 02, 2012 12:17 am    Post subject: Reply with quote

I am also having a problem with SQL Compare detecting there is a scripts folder, unless launched from within SSMS using an actual database as the source (then changing it to source code).

Using SVN as repository and opening SQL Compare directly I haven't been able to detect the scripts folder. On migration wizard, migration scripts step is grayed out.

Steps to reproduce:
1. Have a database under source control, and at least one migration script checked into source control.
2. Open SQL Compare. (my version 10.2.0.1337)
3. Choose Source control as source.
4. Choose <Browse source control> in repository drop down.
5. Choose SVN
6. Paste or browse for Database Repository URL
7. Paste or browse for Migration Scripts Repository URL
8. Press [Link]
9. Select target database
10. Press Compare.

Expected result: Migration script symbol next to objects for which migration scripts were created. Step in wizard to select migration scripts to utilize.

Actual result: No migration script symbol for objects for which migration scripts were written. No step in wizard to select migration scripts to apply.

This behavior is different than if starting from SSMS, selecting a database to compare from initially, then switching to source control as the source.
In that case the symbol appears and the wizard step exists.
_________________
Bob Good
Back to top
View user's profile Send private message
David Atkinson



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

PostPosted: Fri Nov 02, 2012 12:25 am    Post subject: Reply with quote

What build are you using? Would you be able to do a Check for Updates in SQL Compare and check that you're on the latest. If you're not, could you try to repro it on the latest build and let us know?

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



Joined: 25 Mar 2008
Posts: 8

PostPosted: Fri Nov 02, 2012 12:32 am    Post subject: Reply with quote

I'm using 10.2.0.1331.
I see that 10.2.3.1 is available. I will try it.
_________________
Bob Good
Back to top
View user's profile Send private message
David Atkinson



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

PostPosted: Fri Nov 02, 2012 12:34 am    Post subject: Reply with quote

Thanks. There are some components that are shared between SQL Source Control and SQL Compare so it might also be prudent to get the latest SQL Source Control version if you don't have that already.
Back to top
View user's profile Send private message Send e-mail
BobGood



Joined: 25 Mar 2008
Posts: 8

PostPosted: Fri Nov 02, 2012 1:57 am    Post subject: Reply with quote

Found the problem - wasn't the build (still failed after upgrade).

I should have documented following steps above.

Add change steps above to:

1a (add) Copy subversion branch to tagged branch for release.
6 and 7 used tagged branch to deploy from.

Problem: Migration script includes a separate meta file with .migrationScript extension that has URL (and revision number) to the database script repository.

I presume these are so SQL Compare can calculate the changes up to the migration script, then apply the migration script, and finally generate a script to bring the DB up to date. Essentially telling SQL Compare what the database should look like before and after the script.

I'm not sure there is a reliable work-around to this one. While I can (and did) change the URL in the .migrationScript to match the new branch. This resulted in SQL Compare showing the existance of the script and including the wizard step to include it in the deployment. However the specific revisions referred to do not exist in that branch. It is easy to think of some scenarios where the result may not be as intended.

So for the moment, deploying from a tagged or release branch using migration scripts is problematic.

David, I hope the reason you are available so late is that you are on the west coast preparing for SQL in the City Seattle. Caught your presentations in Chicago and I recommend them to anyone doing version control or deployment.
_________________
Bob Good
Back to top
View user's profile Send private message
David Atkinson



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

PostPosted: Fri Nov 02, 2012 2:13 am    Post subject: Reply with quote

You have indeed identified a limitation of our migrations implementation. It works well for a single branch, but it falls short when generating deployments cross-branch.

We used to simply not pull in migration scripts if the branches weren't the same, which is why we store the branch url in the .migrationscript file. In the latest version of SQL Compare, however, we've relaxed that requirement as it will allow deployments to work in some cases. However, because we don't know the correct order to use as revisions numbers are only linear within a branch, there's certainly no guarantee that it will work.

We're hoping to tackle this problem soon and hopefully come up with a workable solution.
Back to top
View user's profile Send private message Send e-mail
BobGood



Joined: 25 Mar 2008
Posts: 8

PostPosted: Fri Nov 02, 2012 2:15 am    Post subject: Reply with quote

Also, I now see similar information, confirming issues with branching, in the SQL Source Control 3 forum from last May 2012.
_________________
Bob Good
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