From 111ab163f439de76f745c98bd622321e60ffe03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20El-Saig?= Date: Sun, 25 Jun 2023 17:18:01 +0200 Subject: [PATCH] Add "Empty" content type. --- .../Extensions/ContentTypes/ContentTypes.cs | 1 + .../Extensions/ContentTypes/Migrations.cs | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Lombiq.HelpfulExtensions/Extensions/ContentTypes/ContentTypes.cs b/Lombiq.HelpfulExtensions/Extensions/ContentTypes/ContentTypes.cs index fc094168..22e2602b 100644 --- a/Lombiq.HelpfulExtensions/Extensions/ContentTypes/ContentTypes.cs +++ b/Lombiq.HelpfulExtensions/Extensions/ContentTypes/ContentTypes.cs @@ -2,6 +2,7 @@ namespace Lombiq.HelpfulExtensions.Extensions.ContentTypes; public static class ContentTypes { + public const string Empty = nameof(Empty); public const string Page = nameof(Page); public const string SiteTexts = nameof(SiteTexts); } diff --git a/Lombiq.HelpfulExtensions/Extensions/ContentTypes/Migrations.cs b/Lombiq.HelpfulExtensions/Extensions/ContentTypes/Migrations.cs index 9df320a2..e07f5708 100644 --- a/Lombiq.HelpfulExtensions/Extensions/ContentTypes/Migrations.cs +++ b/Lombiq.HelpfulExtensions/Extensions/ContentTypes/Migrations.cs @@ -33,7 +33,11 @@ public int Create() .WithPart("FlowPart", part => part.WithPosition("2")) ); - return 2; + _contentDefinitionManager.AlterTypeDefinition(Empty, builder => builder + .WithDescription("A base content type for ad-hoc welding parts or fields on.") + ); + + return 3; } public int UpdateFrom1() @@ -46,4 +50,13 @@ public int UpdateFrom1() return 2; } + + public int UpdateFrom2() + { + _contentDefinitionManager.AlterTypeDefinition(Empty, builder => builder + .WithDescription("A base content type for ad-hoc welding parts or fields on.") + ); + + return 3; + } }