I started a project using Entity Framework 4.3 Code First with manual migrations and SQL Express 2008 and recently updated to EF5 (in VS 2010) and noticed that now when I ch
For Automatic Migrations use this code:
public class MyOwnMySqlMigrationSqlGenerator : MySqlMigrationSqlGenerator
{
protected override MigrationStatement Generate(AddForeignKeyOperation addForeignKeyOperation)
{
addForeignKeyOperation.PrincipalTable = addForeignKeyOperation.PrincipalTable.Replace("dbo.", "");
addForeignKeyOperation.DependentTable = addForeignKeyOperation.DependentTable.Replace("dbo.", "");
MigrationStatement ms = base.Generate(addForeignKeyOperation);
return ms;
}
}
And Set it on configuration:
SetSqlGenerator("MySql.Data.MySqlClient", new MyOwnMySqlMigrationSqlGenerator());