That leaves the database in an inconsistent status.
I can think of different solutions:
- Delay the insertion of the MigrationVersion until the migration has been applied
- In case of an exception, insert in MigrationVersion the exception information, too
- In case of an exception, remove the entry in MigrationVersion