How can I stop Entity Framework 5 migrations adding dbo. into key names?
You can customize the generated code by sub-classing the CSharpMigrationCodeGenerator class: class MyCodeGenerator : CSharpMigrationCodeGenerator { protected override void Generate( DropIndexOperation dropIndexOperation, IndentedTextWriter writer) { dropIndexOperation.Table = StripDbo(dropIndexOperation.Table); base.Generate(dropIndexOperation, writer); } // TODO: Override other Generate overloads that involve table names private string StripDbo(string table) { if (table.StartsWith(“dbo.”)) { return table.Substring(4); } return table; } … Read more