diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs index 7d6537d4da..713168a6c7 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs @@ -67,15 +67,15 @@ public class UmbracoPlan : MigrationPlan // To 14.0.0 To("{419827A0-4FCE-464B-A8F3-247C6092AF55}"); - To("{69E12556-D9B3-493A-8E8A-65EC89FB658D}"); - To("{F2B16CD4-F181-4BEE-81C9-11CF384E6025}"); - To("{A8E01644-9F2E-4988-8341-587EF5B7EA69}"); + To("{69E12556-D9B3-493A-8E8A-65EC89FB658D}"); + To("{F2B16CD4-F181-4BEE-81C9-11CF384E6025}"); + To("{A8E01644-9F2E-4988-8341-587EF5B7EA69}"); To("{E073DBC0-9E8E-4C92-8210-9CB18364F46E}"); To("{80D282A4-5497-47FF-991F-BC0BCE603121}"); To("{96525697-E9DC-4198-B136-25AD033442B8}"); To("{7FC5AC9B-6F56-415B-913E-4A900629B853}"); To("{1539A010-2EB5-4163-8518-4AE2AA98AFC6}"); - To("{C567DE81-DF92-4B99-BEA8-CD34EF99DA5D}"); + To("{C567DE81-DF92-4B99-BEA8-CD34EF99DA5D}"); To("{0D82C836-96DD-480D-A924-7964E458BD34}"); To("{1A0FBC8A-6FC6-456C-805C-B94816B2E570}"); To("{302DE171-6D83-4B6B-B3C0-AC8808A16CA1}"); diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPremigrationPlan.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPremigrationPlan.cs index c9d23acb90..a8131a0da4 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPremigrationPlan.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPremigrationPlan.cs @@ -53,5 +53,9 @@ public class UmbracoPremigrationPlan : MigrationPlan // To 14.0.0 To("{76FBF80E-37E6-462E-ADC1-25668F56151D}"); + To("{37CF4AC3-8489-44BC-A7E8-64908FEEC656}"); + To("{7BCB5352-B2ED-4D4B-B27D-ECDED930B50A}"); + To("{3E69BF9B-BEAB-41B1-BB11-15383CCA1C7F}"); + To("{F12C609B-86B9-4386-AFA4-78E02857247C}"); } } diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs index ad8e5091ea..67bdaf7395 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs @@ -20,6 +20,12 @@ public class AddGuidsToUserGroups : UnscopedMigrationBase protected override void Migrate() { + // If the new column already exists we'll do nothing. + if (ColumnExists(Constants.DatabaseSchema.Tables.UserGroup, NewColumnName)) + { + return; + } + // SQL server can simply add the column, but for SQLite this won't work, // so we'll have to create a new table and copy over data. if (DatabaseType != DatabaseType.SQLite) @@ -37,11 +43,6 @@ public class AddGuidsToUserGroups : UnscopedMigrationBase using IDisposable notificationSuppression = scope.Notifications.Suppress(); ScopeDatabase(scope); - if (ColumnExists(Constants.DatabaseSchema.Tables.UserGroup, NewColumnName)) - { - return; - } - var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToList(); AddColumnIfNotExists(columns, NewColumnName); @@ -68,12 +69,6 @@ public class AddGuidsToUserGroups : UnscopedMigrationBase using IDisposable notificationSuppression = scope.Notifications.Suppress(); ScopeDatabase(scope); - // If the new column already exists we'll do nothing. - if (ColumnExists(Constants.DatabaseSchema.Tables.UserGroup, NewColumnName)) - { - return; - } - // This isn't pretty, // But since you cannot alter columns, we have to copy the data over and delete the old table. // However we cannot do this due to foreign keys, so temporarily disable these keys while migrating. diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUsers.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUsers.cs index fe730fd2b8..6d5dbce1d8 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUsers.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUsers.cs @@ -26,6 +26,12 @@ internal class AddGuidsToUsers : UnscopedMigrationBase protected override void Migrate() { + if (ColumnExists(Constants.DatabaseSchema.Tables.User, NewColumnName)) + { + Context.Complete(); + return; + } + InvalidateBackofficeUserAccess = true; using IScope scope = _scopeProvider.CreateScope(); using IDisposable notificationSuppression = scope.Notifications.Suppress(); @@ -75,11 +81,6 @@ internal class AddGuidsToUsers : UnscopedMigrationBase private void MigrateSqlite() { - 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.