From 00d1ebe3de8f9453f0e295270b2dd5d051372e05 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 22 Feb 2024 12:47:07 +0100 Subject: [PATCH] Remove the default value constraint on "isContainer" before deleting the column (#15751) * Remove the default value constraint on "isContainer" before deleting the column * Swap migrations to avoid targeting missing column --- src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs | 2 +- .../Upgrade/V_14_0_0/AddListViewKeysToDocumentTypes.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs index ac53d0bb83..9d6fca5dd2 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs @@ -65,7 +65,6 @@ public class UmbracoPlan : MigrationPlan // To 14.0.0 To("{419827A0-4FCE-464B-A8F3-247C6092AF55}"); - To("{5F15A1CC-353D-4889-8C7E-F303B4766196}"); To("{69E12556-D9B3-493A-8E8A-65EC89FB658D}"); To("{F2B16CD4-F181-4BEE-81C9-11CF384E6025}"); To("{A8E01644-9F2E-4988-8341-587EF5B7EA69}"); @@ -73,5 +72,6 @@ public class UmbracoPlan : MigrationPlan To("{80D282A4-5497-47FF-991F-BC0BCE603121}"); To("{96525697-E9DC-4198-B136-25AD033442B8}"); To("{7FC5AC9B-6F56-415B-913E-4A900629B853}"); + To("{1539A010-2EB5-4163-8518-4AE2AA98AFC6}"); } } diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddListViewKeysToDocumentTypes.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddListViewKeysToDocumentTypes.cs index e79c505a4a..7320d733cc 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddListViewKeysToDocumentTypes.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddListViewKeysToDocumentTypes.cs @@ -44,7 +44,7 @@ public class AddListViewKeysToDocumentTypes : UnscopedMigrationBase if (ColumnExists(Constants.DatabaseSchema.Tables.ContentType, NewColumnName) is false) { IEnumerable contentTypeDtos = GetContentTypeDtos().Where(x => x.ListView is not null); - + Delete.DefaultConstraint().OnTable(Constants.DatabaseSchema.Tables.ContentType).OnColumn("isContainer").Do(); Delete.Column("isContainer").FromTable(Constants.DatabaseSchema.Tables.ContentType).Do(); Create.Column(NewColumnName) .OnTable(Constants.DatabaseSchema.Tables.ContentType)