diff --git a/src/Umbraco.Core/Migrations/Upgrade/UmbracoUpgrader.cs b/src/Umbraco.Core/Migrations/Upgrade/UmbracoUpgrader.cs
index 99c4821680..fa29e80a6b 100644
--- a/src/Umbraco.Core/Migrations/Upgrade/UmbracoUpgrader.cs
+++ b/src/Umbraco.Core/Migrations/Upgrade/UmbracoUpgrader.cs
@@ -15,8 +15,12 @@ namespace Umbraco.Core.Migrations.Upgrade
{
private PostMigrationCollection _postMigrations;
- ///
- protected override MigrationPlan CreatePlan() => new UmbracoPlan();
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public UmbracoUpgrader()
+ : base(new UmbracoPlan())
+ { }
///
/// Executes.
diff --git a/src/Umbraco.Core/Migrations/Upgrade/Upgrader.cs b/src/Umbraco.Core/Migrations/Upgrade/Upgrader.cs
index 3795ed79af..f6df52bc1e 100644
--- a/src/Umbraco.Core/Migrations/Upgrade/Upgrader.cs
+++ b/src/Umbraco.Core/Migrations/Upgrade/Upgrader.cs
@@ -6,11 +6,17 @@ using Umbraco.Core.Services;
namespace Umbraco.Core.Migrations.Upgrade
{
///
- /// Provides an abstract base class for creating upgraders.
+ /// Represents an upgrader.
///
- public abstract class Upgrader
+ public class Upgrader
{
- private MigrationPlan _plan;
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public Upgrader(MigrationPlan plan)
+ {
+ Plan = plan;
+ }
///
/// Gets the name of the migration plan.
@@ -20,12 +26,7 @@ namespace Umbraco.Core.Migrations.Upgrade
///
/// Gets the migration plan.
///
- public MigrationPlan Plan => _plan ?? (_plan = CreatePlan());
-
- ///
- /// Creates the migration plan.
- ///
- protected abstract MigrationPlan CreatePlan();
+ public MigrationPlan Plan { get; }
///
/// Gets the key for the state value.
diff --git a/src/Umbraco.Tests/Migrations/AdvancedMigrationTests.cs b/src/Umbraco.Tests/Migrations/AdvancedMigrationTests.cs
index 07776fdee1..5ff0dcffc1 100644
--- a/src/Umbraco.Tests/Migrations/AdvancedMigrationTests.cs
+++ b/src/Umbraco.Tests/Migrations/AdvancedMigrationTests.cs
@@ -5,6 +5,7 @@ using NUnit.Framework;
using Umbraco.Core.Logging;
using Umbraco.Core.Migrations;
using Umbraco.Core.Migrations.Install;
+using Umbraco.Core.Migrations.Upgrade;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Dtos;
using Umbraco.Core.Services;
@@ -34,7 +35,7 @@ namespace Umbraco.Tests.Migrations
using (var scope = ScopeProvider.CreateScope())
{
- var upgrader = new MigrationTests.TestUpgrader(
+ var upgrader = new Upgrader(
new MigrationPlan("test")
.From(string.Empty)
.To("done"));
@@ -72,7 +73,7 @@ namespace Umbraco.Tests.Migrations
using (var scope = ScopeProvider.CreateScope())
{
- var upgrader = new MigrationTests.TestUpgrader(
+ var upgrader = new Upgrader(
new MigrationPlan("test")
.From(string.Empty)
.To("a")
@@ -108,7 +109,7 @@ namespace Umbraco.Tests.Migrations
using (var scope = ScopeProvider.CreateScope())
{
- var upgrader = new MigrationTests.TestUpgrader(
+ var upgrader = new Upgrader(
new MigrationPlan("test")
.From(string.Empty)
.To("a")
@@ -145,7 +146,7 @@ namespace Umbraco.Tests.Migrations
using (var scope = ScopeProvider.CreateScope())
{
- var upgrader = new MigrationTests.TestUpgrader(
+ var upgrader = new Upgrader(
new MigrationPlan("test")
.From(string.Empty)
.To("a")
@@ -180,7 +181,7 @@ namespace Umbraco.Tests.Migrations
using (var scope = ScopeProvider.CreateScope())
{
- var upgrader = new MigrationTests.TestUpgrader(
+ var upgrader = new Upgrader(
new MigrationPlan("test")
.From(string.Empty)
.To("a")
diff --git a/src/Umbraco.Tests/Migrations/MigrationTests.cs b/src/Umbraco.Tests/Migrations/MigrationTests.cs
index c539cd0c7d..8e84f88265 100644
--- a/src/Umbraco.Tests/Migrations/MigrationTests.cs
+++ b/src/Umbraco.Tests/Migrations/MigrationTests.cs
@@ -1,10 +1,8 @@
using System;
-using System.Configuration;
using System.Data;
using Moq;
using NUnit.Framework;
using Semver;
-using Umbraco.Core.Configuration;
using Umbraco.Core.Events;
using Umbraco.Core.Migrations;
using Umbraco.Core.Migrations.Upgrade;
@@ -18,22 +16,7 @@ namespace Umbraco.Tests.Migrations
[TestFixture]
public class MigrationTests
{
- public class TestUpgrader : Upgrader
- {
- private readonly MigrationPlan _plan;
-
- public TestUpgrader(MigrationPlan plan)
- {
- _plan = plan;
- }
-
- protected override MigrationPlan CreatePlan()
- {
- return _plan;
- }
- }
-
- public class TestUpgraderWithPostMigrations : TestUpgrader
+ public class TestUpgraderWithPostMigrations : Upgrader
{
private PostMigrationCollection _postMigrations;