I'm trying to create a DbContext specific to may Domain that has one model class entirely managed by EF, and another that gets mapped to a database view. To ensure EF doesn't try to create this view that already exists, I added just the view to my DbContext and ran the following command:
Add-Migration InitialUnmanaged -IngoreChanges
This creates a Migration with an empty Up and Down, which is exactly what I want. I'm able to update my dev database using this Migration, but whenever I try to add a second Migration that includes my EF-managed model class, I get an error.
Add-Migration Initial
Unable to generate an explicit migration because the following explicit migrations are pending: [201510151553565_InitialUnmanaged]. Apply the pending explicit migrations before attempting to generate a new explicit migration.
The thing is, I've already applied that explicit Migration, and I can see it in my MigrationHistory table.
MigrationId
201510151553565_InitialUnmanaged
Can anyone help me understand why this is happening and how to work around it?