Migrations: Write script to .sql file (Fixes #420)

This is more-or-less the same logic we used in EF6.
Then it's unhandlable here, and the user's VS must be really screwed up.