EF 看不到来自合并的手动创建的迁移

EF does not see manualy created migrations which came from merge

我和我的同事在同一个项目上工作,一个使用 EF 6 Code First 方法的小型图书馆。为了保持数据库最新,我们正在使用迁移。昨天我合并了我同事的分支。该分支包含两个由 Add-Migration [MigrationName] 命令创建的新迁移。 现在,当我尝试 运行 Update-Database 命令时,出现错误

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.

我尝试重新 运行 Add-Migration 命令以查看模型中的 "new" 是什么。 EF 为我同事的迁移中所做的所有更改创建了一个巨大的迁移。看起来 EF 没有看到来自合并

的迁移

我在这里找到了这个问题的详细答案https://msdn.microsoft.com/en-us/data/dn481501.aspx