Fix #4954: use Pomelo.EntityFrameworkCore.MySql package.

This commit is contained in:
Ben
2025-01-14 19:58:56 +08:00
parent fd09912cd7
commit 9508983b15
4 changed files with 33 additions and 7 deletions

View File

@ -74,6 +74,9 @@ namespace Oqtane.Infrastructure
case "6.0.1":
Upgrade_6_0_1(tenant, scope);
break;
case "6.0.2":
Upgrade_6_0_2(tenant, scope);
break;
}
}
}
@ -494,6 +497,29 @@ namespace Oqtane.Infrastructure
}
}
private void Upgrade_6_0_2(Tenant tenant, IServiceScope scope)
{
// remove MySql.EntityFrameworkCore package
string[] assemblies = {
"MySql.EntityFrameworkCore.dll"
};
foreach (var assembly in assemblies)
{
try
{
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var filepath = Path.Combine(binFolder, assembly);
if (System.IO.File.Exists(filepath)) System.IO.File.Delete(filepath);
}
catch (Exception ex)
{
// error deleting asesmbly
_filelogger.LogError(Utilities.LogMessage(this, $"Oqtane Error: 6.0.2 Upgrade Error Removing {assembly} - {ex}"));
}
}
}
private void AddPagesToSites(IServiceScope scope, Tenant tenant, List<PageTemplate> pageTemplates)
{
var tenants = scope.ServiceProvider.GetRequiredService<ITenantManager>();