79636234

Date: 2025-05-23 21:45:30
Score: 0.5
Natty:
Report link

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
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Sergey Or