Created
August 6, 2022 17:01
-
-
Save nedgrady/d59da3f5ffcdf35f464889494097e2ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pendingMigrations = Database.GetPendingMigrations(); | |
foreach (var pendingMigration in pendingMigrations) | |
{ | |
Console.WriteLine("Script for migration " + pendingMigration.Name + ":"); | |
var migrationScriptToPrint = pendingMigration.Script; | |
// our pipelines hilariously fail if the string "error" appears anywhere in the build log | |
// so tables/columns with "error" in their name cause a build failure even if everything was OK. | |
// Can't think of a better way to fix this... | |
migrationScriptToPrint = migrationScriptToPrint.Replace("error", "err*r"); | |
Console.WriteLine(migrationScriptToPrint) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment