Our organization has need to have a single database, multi-tenant
(by table schema, not by tenant id) architecture.
There is a great article h
very nice approach and it helped me to get a more straight forward solution. You may override only the Name-Method, it is used in every writer .... Sorry for new answer, but i'm not allowed to comment ....
public class SqlServerSchemaAwareMigrationSqlGenerator:SqlServerMigrationSqlGenerator
{
private string _schema;
public accountMigrationSqlGenerator(string schema)
{
_schema = schema;
}
protected override string Name(string name)
{
int p = name.IndexOf('.');
if(p>0)
{
name = name.Substring(p + 1);
}
return $"[{_schema}].[{name}]";
}
}