Random programming things I'd want to remember

Tuesday, December 5, 2017

Entity Framework migration comes up blank

I'm working on an MVC project with code-first Entity Framework SQL Server database and my initial migration script kept coming up as blank. I ran

Add-Migration InitialCreate

command to no avail. I then (consulted stackoverfow.com and) ran

Add-Migration "InitialMigration" -verbose -ProjectName "MyProjectName" -Force

command and that did not help.

This post helped a lot. As it turned out, I had a ghost record in my MigrationHistory table. I cleared it and everything worked.

No comments: