'EF commands stops working properly after branch merge
I have a feature branch I have been working on some database changes which resulted in one migration. Meanwhile, my college has merged a migration of his own into master.
The problem occurs when I try to merge master containing his migration into my feature branch to resolve conflicts. I have to resolve two conflicts in the .csproj
file choosing which migration to keep. I want to keep both.
I perform the merge in Visual Studio 2019. Before the merge, I can run EF commands just fine on my feature branch, but after the merge, I get this error message:
Unable to update the 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.
I have searched for an answer but found nothing that applies to my problem. I can not run Update-Database
because our pipeline runs all the EF migrations.
Does anybody know why EF is throwing this error?
Entity Framework Core .NET Command-line Tools: 6.0.3
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|