This short article shows you one of the ways to resolve the error “Unable to update database to match the current model because there are pending changes and automatic migration is disabled.”
When you have an existing Code First project sometime you will bump into the error “Unable to update database to match the current model because there are pending changes and automatic migration is disabled”.
Go to Tools -> NuGet Package Manager -> Package Manager Console (based on Visual Studio 2015).
cmdlet Add-Migration at command pipeline position 1
Supply values for the following parameters:
Scaffolding migration ‘TourismContext’.
The Designer Code for this migration file includes a snapshot of your current Code First model. This snapshot is used to calculate the changes to your model when you scaffold the next migration. If you make additional changes to your model that you want to include in this migration, then you can re-scaffold it by running ‘Add-Migration TourismContext’ again.
The TourismContext is just a name of the context, you might not use the same name.
After this type: