Lost migration script in SSMS
AdamY
Posts: 55 Bronze 3
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.
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.
Comments
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?
I checked the repository locations and found this...
The DB extended property "SQLSourceControl Scripts Location" shows:
The DB extended property "SQLSourceControl Migration Scripts Location" shows:
'CompassionWeb 11234 to 11466.migrationScript' shows:
And the migration file that is showing up properly also has the same values. "CompassionWeb 10507 to 10508.migrationScript" shows:
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.
IT Crowd says it best: http://youtu.be/p85xwZ_OLX0
I hope it behaves from now on.