Make it easier to recover when SQL Source Control generates incorrect AutomaticSchemaChange.patch
When using V3 of migrations, SQL Source control parses the migration script, finds all dependent objects, and makes sure that the AutomaticSchemaChange.patch file brings the database up to a state where the user-written migration script can run. But, sometimes the AutomaticSchemaChange.patch file has a bug in it, due to a bug in the SQL Compare engine. I can file a bug on this, but those bugs don't seem to get fixed very quickly, and without a fix I can't deploy my database.
The only workaround that I've found in this case is to manually edit the AutomaticSchemaChange.patch file to fix the bug. But, this file is incredibly hard to edit. It's in "git patch" format, and if just one character is wrong, the migration script process will crash. It's even critical that the line endings be exactly right (some must be newlines, some must be carriage-return newline combinations.
The current approach used in the AutomaticSchemaChange.patch makes it very hard to work around any issues or errors. Perhaps you could find a more user-friendly approach for the inevitable cases where the tools have bugs and need to be hand tweaked.
-
[Deleted User] commented
We're having issues with this file as well. Considering how central to the migration scripts this is, it's unacceptable that there is such a serious bug in it.