How to find pending migrations for EntityFramework
When running command Update-Database
, getting an error:
Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration.
You can use the Add-Migration command to write the pending model changes to a code-based migration.
When running Add-Migration
command, getting a migration for entity, that was deleted in prior commit to source. Removed SQL database, got fresh code into clean directory, checked that there is no entity in context.
Still getting same error when trying to run Update-Database
. How to find out where this deleted entity is still being remembered, and remove it completely?
Tried Update-Database -Script
, but got message
The EntityFramework package is not installed on project
Solution is to delete previous migration and rerun commands above. Deleted entity is stored in binary files for latest migration.
链接地址: http://www.djcxy.com/p/90260.html上一篇: 如何使用异步事务关闭领域实例