我得到了一个数据库,并且意外地删除了__MigrationHistory表。 现在程序抛出错误,我不能丢失所有的数据。 有没有办法恢复我删除的表? 我会丢失我所有的数据库吗?如何恢复数据库EF迁移工具
我手动添加了__MigrationHistory,现在这个是错误:
Additional information: 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
你能赶上它抛出错误,并发布它,以便我们可能知道它是什么? – Claies
如果您正在尝试执行新的迁移,或者每次启动时自动迁移数据库,则“__MigrationHistory”表应该只是一个问题。无论哪种方式,这个错误都会告诉我们需要改变什么。 – Claies
它试图重新创建所有的数据库,它说它不能创建表 –