Using:
- Pomelo.EntityFrameworkCore.MySQL 3.1.1
- Microsoft.EntityFrameworkCore 3.1.3
- MySQL 5.7
It appears that if EF Core's update-database
command fails, no rollback is performed of the partial migration. Is that how it's supposed to work? If so, I'm curious why? More importantly, is there a way to make a rollback happen automatically, or at least something that can be run afterwards manually, when update-database
runs into an error? I've tried something like this:
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("Start Transaction;");
...
migrationBuilder.Sql("Commit;");
}
but running Rollback;
afterwards doesn't do anything. Thanks!