diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs index d318b5f7e1..649190f5f0 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs @@ -78,7 +78,7 @@ public class UmbracoPlan : MigrationPlan To("{C567DE81-DF92-4B99-BEA8-CD34EF99DA5D}"); To("{0D82C836-96DD-480D-A924-7964E458BD34}"); To("{1A0FBC8A-6FC6-456C-805C-B94816B2E570}"); - To("{302DE171-6D83-4B6B-B3C0-AC8808A16CA1}"); + To("{302DE171-6D83-4B6B-B3C0-AC8808A16CA1}"); To("{8184E61D-ECBA-4AAA-B61B-D7A82EB82EB7}"); To("{E261BF01-2C7F-4544-BAE7-49D545B21D68}"); To("{5A2EF07D-37B4-49D5-8E9B-3ED01877263B}"); @@ -98,7 +98,6 @@ public class UmbracoPlan : MigrationPlan // To 15.0.0 To("{7F4F31D8-DD71-4F0D-93FC-2690A924D84B}"); - To("{1A8835EF-F8AB-4472-B4D8-D75B7C164022}"); - + To("{1A8835EF-F8AB-4472-B4D8-D75B7C164022}"); } } diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPremigrationPlan.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPremigrationPlan.cs index 42a4db8677..4c52f8867c 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPremigrationPlan.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPremigrationPlan.cs @@ -59,6 +59,11 @@ public class UmbracoPremigrationPlan : MigrationPlan To("{F12C609B-86B9-4386-AFA4-78E02857247C}"); // To 15.0.0 + // - The tours data migration was run as part of the regular upgrade plan for V14, but as it affects User data, + // we need it to be run before the V15 User data migrations run. In the regular upgrade plan it has now been + // replaced with a noop migration for the corresponding migration state. + To("{A08254B6-D9E7-4207-A496-2ED0A87FB4FD}"); + To("{69AA6889-8B67-42B4-AA4F-114704487A45}"); To("{B9133686-B758-404D-AF12-708AA80C7E44}"); } } diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/MigrateTours.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/MigrateTours.cs index 17444c33d7..934fa75914 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/MigrateTours.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/MigrateTours.cs @@ -26,16 +26,18 @@ internal class MigrateTours : UnscopedMigrationBase protected override void Migrate() { + // if the table already exists, do nothing + if (TableExists(Constants.DatabaseSchema.Tables.UserData)) + { + Context.Complete(); + return; + } + using IScope scope = _scopeProvider.CreateScope(); using IDisposable notificationSuppression = scope.Notifications.Suppress(); ScopeDatabase(scope); // create table - if (TableExists(Constants.DatabaseSchema.Tables.UserData)) - { - return; - } - Create.Table().Do(); // transform all existing UserTour fields in to userdata diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/AddKindToUser.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/AddKindToUser.cs index b807c4cc9a..5195f27391 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/AddKindToUser.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_15_0_0/AddKindToUser.cs @@ -19,6 +19,13 @@ public class AddKindToUser : UnscopedMigrationBase protected override void Migrate() { + // If the new column already exists we'll do nothing. + if (ColumnExists(Constants.DatabaseSchema.Tables.User, NewColumnName)) + { + Context.Complete(); + return; + } + InvalidateBackofficeUserAccess = true; using IScope scope = _scopeProvider.CreateScope(); @@ -48,12 +55,6 @@ public class AddKindToUser : UnscopedMigrationBase private void MigrateSqlite() { - // If the new column already exists we'll do nothing. - if (ColumnExists(Constants.DatabaseSchema.Tables.User, NewColumnName)) - { - return; - } - /* * We commit the initial transaction started by the scope. This is required in order to disable the foreign keys. * We then begin a new transaction, this transaction will be committed or rolled back by the scope, like normal.