0

I'm confused as to what to do in the situation I've gotten myself into.

I've recreated my database after an issue. When I run up my project, CodeFirst creates the database from my EF model. The site then works fine.

But as soon as I come to add a migration, it says I've got explicit migrations pending on my database. These pending migrations are ALL existing migrations.

It appears that my DB has been created with the most recent model. But without any model/revision data attached.

How do I go about populating that migration data so EF knows the db is up to date?

4

1 回答 1

0

我想问一下,你是如何解决你遇到的问题的?迁移的想法是您可以在它们中前后移动,允许您还原任何更改。

也就是说,你在哪里。在这种情况下,我必须同意@sq33G 并删除现有的迁移,并修复您当前的数据库。由于您没有对您的问题提供全面的说明,我建议如果 SQL 查询需要,可以将其他地方的数据导入您当前的数据库。

于 2013-09-04T12:59:25.627 回答