Must use custom ISqlGeneratorHelper:
builder.Services.AddEntityFrameworkMySql();
builder.Services.AddSingleton<ISqlGenerationHelper, CustomMySqlSqlGenerationHelper>();
then
public sealed class CustomMySqlSqlGenerationHelper : MySqlSqlGenerationHelper
{
public CustomMySqlSqlGenerationHelper(
RelationalSqlGenerationHelperDependencies dependencies,
IMySqlOptions options)
: base(dependencies, options)
{
}
public override string GetSchemaName(string name, string schema)
=> schema; // <-- this is the first part that is needed to map schemas to databases
}