Reputation: 752
I thought I figured it out when I disabled AutomaticMigrations.
I Update-Database then Add new column name to DAL class.
Then execute Add-Migration
But I am caught in a loop of nonsense.
I execute Update-Database and am treated to ... Applying explicit migrations: [a list of the current migrations].
then this line for each migration. Applying explicit migration: [id]
Then it warning me that the model is NOT up to date. So I execute Add-Migration and get the error... Unable to generate an explicit migration because the following explicit migrations are pending: [the same list I just saw applied]
WTF?
Upvotes: 2
Views: 760
Reputation: 752
I resolved this through the following steps.
Good luck if you run into this problem.
I further ran into problems when I added code that explicitly called the initializer to speed up startup time. Then whenever I did an update-database...it would use my context class, try to do the initializer and fail.
Code-First is a good step in the right direction but it has all these be careful scenarios.
Upvotes: 1