Ruchi Sharavat

Ruchi Sharavat

  • NA
  • 959
  • 586.6k

Without migration, model and schema changes pushed

Aug 5 2022 6:34 AM

We had generated 1 Code First Approach migration in develop branch but suddenly got a requirement to do partial schema changes on production. Steps follwowed:

1. Modified schema directly on production DB(multiple databases)

2. Pushed just Model schema changes

3. No migration snapshots created or pushed

This process didn't create any problem on most of the databases while accesses from UI but for some it was throwing this error while accessing from UI:

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.

Want to know why error is for few databases and not for all.


Answers (4)