I have a entity framework 6 code-first project. I deleted my database and want to re-create it from scratch. When I run update-database some of the migrations do not run. That causes an error later because the database is not in the expected state.
This is the first migration that is skipped:
using System.Data.Entity.Migrations; public partial class add_ConversationEntry_Type : DbMigration { public override void Up() { AddColumn("dbo.ConversationEntry", "Type", c => c.String(nullable: false)); } public override void Down() { DropColumn("dbo.ConversationEntry", "Type"); } }
It looks standard. It inherits from DbMigration and does nothing weird. The next 3 also are skipped and they all affect that dbo.ConversationEntry table.
With update-datebase -verbose it shows 'Applying explicit migrations:' and lists the migrations and these are missing from that list.
I have verified that these are also in the project file. Where does update-database get the list of migrations? Why would some be skipped?
Each entity framework migration consists from three files
.cs
and additional code-behind files
.Designer.cs
.resx
Make sure <timestamp>_dd_ConversationEntry_Type.Designer.cs
file is not missing and is included in your project.