Red Gate forums :: View topic - Lost migration script in SSMS
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Source Control 3
SQL Source Control 3 forum

Lost migration script in SSMS

Search in SQL Source Control 3 forum
Post new topic   Reply to topic
Jump to:  
Author Message
AdamY



Joined: 15 Oct 2010
Posts: 41

PostPosted: Thu May 23, 2013 7:54 pm    Post subject: Lost migration script in SSMS Reply with quote

I recently created a migration script to cover some changes to a table and sprocs. When I committed the changes yesterday, the file disappeared from the "Migrations" tab of SQL Source Control. I have version 3.4.1.73 of SQL Source Control and I did check in these changes with the #ignorepolicies tag. I have restarted SSMS and rebooted my machine, but the issue persists. The only file that shows is one I committed 2 months ago.


It seems the only part broken is the SQL Source Control because...
[1] The script does show in TFS and is in my local TFS file directory.



[2] When using SQL Compare to create a change script, it does recognize the migration script and use it.

The Migration Scripts location is correct in SQL Source Control.


How do I get SQL Source Control to show the file again? Thank you for your help.


Last edited by AdamY on Wed Feb 26, 2014 5:34 am; edited 1 time in total
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Tue May 28, 2013 12:11 pm    Post subject: Reply with quote

Thanks for your post, and sorry you're having trouble with the migration scripts.

In order for SQL Source Control to consider the migration script, the database revisions need to be correct in the database level extended properties, and the database needs to be linked to the exact same repository. We don't currently support cross branch migration scripts, so if something doesn't match up, then we err on the side of caution and ignore it.

Can you take a look at 'CompassionWeb 11234 to 11466.migrationScript' and also at the linked database's extended properties and see if the repository locations all match up?
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
AdamY



Joined: 15 Oct 2010
Posts: 41

PostPosted: Thu May 30, 2013 6:47 pm    Post subject: Answers Reply with quote

The database revision changes every time changes are checked in so I don't understand how that would cause a problem. The current DB revision (in extended properties) is 11468, but I have checked in changes since the migration script check-in so it should be different. And the older migration script is still showing (10507 to 10508). I'm not doing cross-branch migration scripts. SQL Compare is seeing the "missing" migration script, too.

I checked the repository locations and found this...

The DB extended property "SQLSourceControl Scripts Location" shows:
Quote:
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<ISOCCompareLocation version="1" type="TfsLocation">
<ServerUrl>https://tfs.ci.org:8143/tfs/</ServerUrl>
<SourceControlFolder>$/Compassion.com/Source - Database/Dev/CompassionWeb</SourceControlFolder>
</ISOCCompareLocation>


The DB extended property "SQLSourceControl Migration Scripts Location" shows:
Quote:
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<ISOCCompareLocation version="1" type="TfsLocation">
<ServerUrl>https://tfs.ci.org:8143/tfs/</ServerUrl>
<SourceControlFolder>$/Compassion.com/Source - Database/Dev/Migration Scripts</SourceControlFolder>
</ISOCCompareLocation>


'CompassionWeb 11234 to 11466.migrationScript' shows:
Quote:
<MigrationScript version="2" type="MigrationScript">
<Name>CompassionWeb 11234 to 11466</Name>
<FromVersion version="1" type="VersionInfoRaw">
<Version>11234</Version>
<ScriptFolderLocation>&lt;?xml version="1.0" encoding="utf-16" standalone="yes"?&gt;
&lt;!----&gt;
&lt;ISOCCompareLocation version="1" type="TfsLocation"&gt;
&lt;ServerUrl&gt;https://tfs.ci.org:8143/tfs/&lt;/ServerUrl&gt;
&lt;SourceControlFolder&gt;$/Compassion.com/Source - Database/Dev/CompassionWeb&lt;/SourceControlFolder&gt;
&lt;/ISOCCompareLocation&gt;</ScriptFolderLocation>
</FromVersion>
<ToVersion version="1" type="VersionInfoRaw">
<Version>11466</Version>
<ScriptFolderLocation>&lt;?xml version="1.0" encoding="utf-16" standalone="yes"?&gt;
&lt;!----&gt;
&lt;ISOCCompareLocation version="1" type="TfsLocation"&gt;
&lt;ServerUrl&gt;https://tfs.ci.org:8143/tfs/&lt;/ServerUrl&gt;
&lt;SourceControlFolder&gt;$/Compassion.com/Source - Database/Dev/CompassionWeb&lt;/SourceControlFolder&gt;
&lt;/ISOCCompareLocation&gt;</ScriptFolderLocation>
</ToVersion>


And the migration file that is showing up properly also has the same values. "CompassionWeb 10507 to 10508.migrationScript" shows:
Quote:
<MigrationScript version="2" type="MigrationScript">
<Name>CompassionWeb 10507 to 10508</Name>
<FromVersion version="1" type="VersionInfoRaw">
<Version>10507</Version>
<ScriptFolderLocation>&lt;?xml version="1.0" encoding="utf-16" standalone="yes"?&gt;
&lt;!----&gt;
&lt;ISOCCompareLocation version="1" type="TfsLocation"&gt;
&lt;ServerUrl&gt;https://tfs.ci.org:8143/tfs/&lt;/ServerUrl&gt;
&lt;SourceControlFolder&gt;$/Compassion.com/Source - Database/Dev/CompassionWeb&lt;/SourceControlFolder&gt;
&lt;/ISOCCompareLocation&gt;</ScriptFolderLocation>
</FromVersion>
<ToVersion version="1" type="VersionInfoRaw">
<Version>10508</Version>
<ScriptFolderLocation>&lt;?xml version="1.0" encoding="utf-16" standalone="yes"?&gt;
&lt;!----&gt;
&lt;ISOCCompareLocation version="1" type="TfsLocation"&gt;
&lt;ServerUrl&gt;https://tfs.ci.org:8143/tfs/&lt;/ServerUrl&gt;
&lt;SourceControlFolder&gt;$/Compassion.com/Source - Database/Dev/CompassionWeb&lt;/SourceControlFolder&gt;
&lt;/ISOCCompareLocation&gt;</ScriptFolderLocation>


Does any of that help you? I'm at a loss right now. I'm considering undoing all the DB changes, then changing them back and trying it over again - but I'm a little concerned that will cause other problems.
Back to top
View user's profile Send private message
AdamY



Joined: 15 Oct 2010
Posts: 41

PostPosted: Thu May 30, 2013 11:22 pm    Post subject: Resolved! Reply with quote

I unlinked the database from TFS, then relinked it (using the same location for Migration Scripts and the db code as I did before). Everything seems okay now. Looks like it just needed a "reboot".

IT Crowd says it best: http://youtu.be/p85xwZ_OLX0


Last edited by AdamY on Fri May 31, 2013 4:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Fri May 31, 2013 3:59 pm    Post subject: Reply with quote

Thanks for your reply. The good old turn it off and on again trick to the rescue.

I hope it behaves from now on.
_________________
Chris
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