Skip to content

New package migration causes all migrations of plan to run #21730

@patrickdemooij9

Description

@patrickdemooij9

Which Umbraco version are you using?

17.x.x

Bug summary

I don't remember this being the case in other Umbraco version, but I can't quite pinpoint when this started happening.
Given the following state in the database:

Image

And the following migration plan:

[Weight(10)]
public class SeoToolkitMigrationPlan : PackageMigrationPlan
{
    public SeoToolkitMigrationPlan()
        : base("SEO Toolkit", "SeoToolkit_Common_Migration")
    { }

    protected override void DefinePlan()
    {
        To<SeoSettingsInitialMigration>("state-1");
        To<AddSeoToolkitSectionToAdminUserGroupMigration>("state-2");
        To<CreateSeoToolkitUserGroupMigration>("state-3");
        To<SeoToolkitDomainMigration>("state-4");
        To<SeoKeyValueMigration>("state-5");
        To<CommonIdToGuidMigration>("state-6");
    }
}

Running the application and placing a breakpoint on the first migration shows that the code of that migration is being triggered. I can also see it happening in the log:

Image

Specifics

No response

Steps to reproduce

Create a new migration plan
Add one migration
Run the application and see the migration being ran
Add another migration
Run the application and see both migrations are being ran

Expected result / actual result

Only the migrations after the current migration state should be ran

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions