0
votes

I have an EF database generated via Code First method. I manually changed the database through SQL Managment console. I added respectivly the tables I had added to the table on database. Now I get errors and EF is trying to update my DB. How can I change it so it wouldn't try to update it? I can't update it through EF it's too much sql code.

The error message is:

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.

1
What errors are you getting?GrandMasterFlush
AutomaticMigrationsEnabled = false;L-Four
I have this set up in my code already, but still throwing this exception. When I refresh the site it won't throw exception and the site works well.7h4ro3

1 Answers

1
votes

Enable automatic migrations

configuration.AutomaticMigrationsEnabled = true;