Skip to content

Commit 6b44e1c

Browse files
fix(multitenancy): update migrations assembly configuration in TenantDbContextFactory to read from configuration with default fallback (#1199)
1 parent 744fda9 commit 6b44e1c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Modules/Multitenancy/Modules.Multitenancy/Data/TenantDbContextFactory.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ public TenantDbContext CreateDbContext(string[] args)
1919
var provider = configuration["DatabaseOptions:Provider"] ?? "POSTGRESQL";
2020
var connectionString = configuration["DatabaseOptions:ConnectionString"]
2121
?? "Host=localhost;Database=fsh-tenant;Username=postgres;Password=postgres";
22-
22+
var migrationsAssembly = configuration["DatabaseOptions:MigrationsAssembly"]
23+
?? "FSH.Playground.Migrations.PostgreSQL";
2324
var optionsBuilder = new DbContextOptionsBuilder<TenantDbContext>();
2425

2526
switch (provider.ToUpperInvariant())
2627
{
2728
case "POSTGRESQL":
2829
optionsBuilder.UseNpgsql(
2930
connectionString,
30-
b => b.MigrationsAssembly("FSH.Playground.Migrations.PostgreSQL"));
31+
b => b.MigrationsAssembly(migrationsAssembly));
3132
break;
3233
default:
3334
throw new NotSupportedException($"Database provider '{provider}' is not supported for TenantDbContext migrations.");

0 commit comments

Comments
 (0)