removes old todos and updates AutomaticPackgeMigrationPlan to use getter with backing field.

This commit is contained in:
Shannon
2021-06-14 14:22:11 -06:00
parent 0268793b2d
commit 10016c74f9
2 changed files with 18 additions and 9 deletions

View File

@@ -12,6 +12,8 @@ namespace Umbraco.Cms.Infrastructure.Packaging
/// </summary>
public abstract class AutomaticPackgeMigrationPlan : PackageMigrationPlan
{
private XDocument _xdoc;
protected AutomaticPackgeMigrationPlan(string name)
: base(name)
{
@@ -19,18 +21,28 @@ namespace Umbraco.Cms.Infrastructure.Packaging
protected sealed override void DefinePlan()
{
// calculate the final state based on the hash value of the embedded resource
Type planType = GetType();
PackageDataManifest = PackageMigrationResource.GetEmbeddedPackageDataManifest(planType);
// calculate the final state based on the hash value of the embedded resource
var finalId = PackageDataManifest.ToString(SaveOptions.DisableFormatting).ToGuid();
To<MigrateToPackageData>(finalId);
}
/// <summary>
/// Get/set the extracted package data xml manifest
/// Get the extracted package data xml manifest
/// </summary>
private XDocument PackageDataManifest { get; set; }
private XDocument PackageDataManifest
{
get
{
if (_xdoc != null)
{
return _xdoc;
}
Type planType = GetType();
_xdoc = PackageMigrationResource.GetEmbeddedPackageDataManifest(planType);
return _xdoc;
}
}
private class MigrateToPackageData : PackageMigrationBase
{

View File

@@ -201,9 +201,6 @@ namespace Umbraco.Cms.Infrastructure.Runtime
return UmbracoDatabaseState.NeedsUpgrade;
}
// TODO: We will need to scan for implicit migrations.
// TODO: Can we save the result of this since we'll need to re-use it?
IReadOnlyList<string> packagesRequiringMigration = _packageMigrationState.GetUmbracoPendingPackageMigrations(keyValues);
if (packagesRequiringMigration.Count > 0)
{