Skip to content

Run both cms and package migrations in upgrader#17575

Merged
nikolajlauridsen merged 2 commits intov13/devfrom
v13/fix/fix-unattended-package-upgrade
Nov 20, 2024
Merged

Run both cms and package migrations in upgrader#17575
nikolajlauridsen merged 2 commits intov13/devfrom
v13/fix/fix-unattended-package-upgrade

Conversation

@nikolajlauridsen
Copy link
Contributor

Fixes #17436

The problem was that the upgrader only ever ran either CMS upgrades or package upgrades, this has been updated so both are run if needed.

Not that the CMS and package upgrades run in their own separate scopes, so it's safe to do it in a single notification handler 😄

Testing

Add both a CMS NoopMigration in UmbracoPlan and a package plan, unable unattended upgrades, and ensure both are run if needed.

Example package migration plan

using Umbraco.Cms.Core.Packaging;
using Umbraco.Cms.Infrastructure.Migrations;

namespace Umbraco.Cms.Web.UI;

public class MyMigrationPlan : PackageMigrationPlan
{
    public MyMigrationPlan() : base("MyPackage")
    {
    }

    protected override void DefinePlan() {
        To<NoopMigration>(Guid.Parse("AD8AF4BF-9AE1-42BC-9709-CA64891BA92D"));
    }
}

@nikolajlauridsen nikolajlauridsen merged commit 570005f into v13/dev Nov 20, 2024
@nikolajlauridsen nikolajlauridsen deleted the v13/fix/fix-unattended-package-upgrade branch November 20, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants