Merge pull request #3180 from sbwalker/dev
added defensive logic to resolve regression issue caused by #3175
This commit is contained in:
commit
d86c53858e
|
@ -145,7 +145,7 @@ namespace Oqtane.Repository
|
||||||
moduledefinition = new ModuleDefinition { ModuleDefinitionName = ModuleDefinition.ModuleDefinitionName, Version = ModuleDefinition.Version };
|
moduledefinition = new ModuleDefinition { ModuleDefinitionName = ModuleDefinition.ModuleDefinitionName, Version = ModuleDefinition.Version };
|
||||||
_db.ModuleDefinition.Add(moduledefinition);
|
_db.ModuleDefinition.Add(moduledefinition);
|
||||||
_db.SaveChanges();
|
_db.SaveChanges();
|
||||||
ModuleDefinition.Version = ""; // ensure migrations are executed during startup
|
ModuleDefinition.Version = ""; // ensure migrations are executed during startup for new module installations
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -159,7 +159,7 @@ namespace Oqtane.Repository
|
||||||
}
|
}
|
||||||
|
|
||||||
// manage releaseversions in cases where it was not provided or is lower than the module version
|
// manage releaseversions in cases where it was not provided or is lower than the module version
|
||||||
if (string.IsNullOrEmpty(ModuleDefinition.ReleaseVersions) || Version.Parse(ModuleDefinition.Version).CompareTo(Version.Parse(ModuleDefinition.ReleaseVersions.Split(',').Last())) > 0)
|
if (string.IsNullOrEmpty(ModuleDefinition.ReleaseVersions) || (!string.IsNullOrEmpty(ModuleDefinition.Version) && Version.Parse(ModuleDefinition.Version).CompareTo(Version.Parse(ModuleDefinition.ReleaseVersions.Split(',').Last())) > 0))
|
||||||
{
|
{
|
||||||
ModuleDefinition.ReleaseVersions = ModuleDefinition.Version;
|
ModuleDefinition.ReleaseVersions = ModuleDefinition.Version;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user