Running EF Core migrations across tenant databases
Checked against Tenantry 0.5, .NET 10 and EF Core 10. With one database for everyone, a release applies its EF Core migrations once, with dotnet ef database update or a dotnet ef database update updates one database at a time. This post looks at what that takes, first by hand and then with Tenantry Pro's migration runner. Given Tenantry Core's tenant scopes, each of which connects the context to its tenant's database, the first version foreach (var tenant in await tenants.GetAllTenantsAsync(ct)) { await using var scope = scopes.CreateScope(tenant); var db = scope.ServiceProvider.GetRequiredSer
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in