ASP.NET WebAPI app published on Azure, Entity Framework code first.
After publishing with migrations executing on application start (first pic) I can't add new migration and work with database context ("model backing the 'DatabaseContext' context has changed since the database was created" exception). On adding new migration EF breaks with error:
Unable to generate an explicit migration because the following explicit migrations are pending: [migration name]. Apply the pending explicit migrations before attempting to generate a new explicit migration.
Looks like EF doens't see migrations from __MigrationHistory table. I checked this table and last migrations exists.
In web.config there are only one connection string.
If it's important, DatabaseContextWithoutCache inherit DatabaseContext (they have different DbConfigurationType).
After adding null initializer Database.SetInitializer<DatabaseContext>(null); to database context it works but I still can't add any migration.
Why does Entity Framework doesn't see that migration is already appended to database? update-database breaks because there are already tables and columns in db.
EDIT:
In my migration list 2 migrations. I rolled back to init (first) migration and remove second. Then add-migration (now it contains changes from second and new changes) and run update-database. It works.
But EF ignore that db is up-to-date and breaks with "model backing the 'DatabaseContext' context has changed since the database was created" exception.
OMG I DON'T UNDERSTAND
