Migration Scripts not being detected
carina23
Posts: 2
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?
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?
Comments
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.
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.
David Atkinson
Red Gate
Product Manager
Redgate Software
I see that 10.2.3.1 is available. I will try it.
Product Manager
Redgate Software
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.
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.
Product Manager
Redgate Software