fix #2567 - migrate tenant connection string details from database to appsettings.json

This commit is contained in:
Shaun Walker
2023-02-23 16:29:15 -05:00
parent 71dd00da0f
commit f2df8e96db
33 changed files with 562 additions and 309 deletions

View File

@ -12,25 +12,23 @@ namespace [Owner].[Module].Manager
{
public class [Module]Manager : MigratableModuleBase, IInstallable, IPortable
{
private I[Module]Repository _[Module]Repository;
private readonly ITenantManager _tenantManager;
private readonly IHttpContextAccessor _accessor;
private readonly I[Module]Repository _[Module]Repository;
private readonly IDBContextDependencies _DBContextDependencies;
public [Module]Manager(I[Module]Repository [Module]Repository, ITenantManager tenantManager, IHttpContextAccessor accessor)
public [Module]Manager(I[Module]Repository [Module]Repository, IDBContextDependencies DBContextDependencies)
{
_[Module]Repository = [Module]Repository;
_tenantManager = tenantManager;
_accessor = accessor;
_DBContextDependencies = DBContextDependencies;
}
public bool Install(Tenant tenant, string version)
{
return Migrate(new [Module]Context(_tenantManager, _accessor), tenant, MigrationType.Up);
return Migrate(new [Module]Context(_DBContextDependencies), tenant, MigrationType.Up);
}
public bool Uninstall(Tenant tenant)
{
return Migrate(new [Module]Context(_tenantManager, _accessor), tenant, MigrationType.Down);
return Migrate(new [Module]Context(_DBContextDependencies), tenant, MigrationType.Down);
}
public string ExportModule(Module module)