In EF5 we made Code First work in scenarios in which the target database exists but the tables still need to be created. This functionality depends on a check that is implemented in the method DatabaseTableChecker.AnyModelTableExists which currently executes hardcoded SQL information schema queries for "System.Data.SqlClient" and "System.Data.SqlClientCe.4.0" but returns true for any other ADO.NET provider invariant names:
switch (providerName)
{
case "System.Data.SqlClient":
provider = new SqlPseudoProvider();
break;
case "System.Data.SqlServerCe.4.0":
provider = new SqlCePseudoProvider();
break;
default:
return true;
}
We should instead make this logic work with any provider either moving the capabilities of the pseudo provider into the actual provider model or by taking advantage of existing functionality of the Migrations Initializer or of schema discovery in the existing provider model.
switch (providerName)
{
case "System.Data.SqlClient":
provider = new SqlPseudoProvider();
break;
case "System.Data.SqlServerCe.4.0":
provider = new SqlCePseudoProvider();
break;
default:
return true;
}
We should instead make this logic work with any provider either moving the capabilities of the pseudo provider into the actual provider model or by taking advantage of existing functionality of the Migrations Initializer or of schema discovery in the existing provider model.