Our add-migrations are failing routinely but not consistently. The migration always gets to the scaffolding step and then roughly 4 out of 5 times we will receive something
This happened to me on some long running scripts that generated new indexes. The workaround that we used was to use:
update-database -Script
EF then spits out the SQL migration to the screen and then we could run the SQL directly from the server so there were no timeout problems.