Files
Umbraco-CMS/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/FallbackLanguage.cs
Nikolaj Brask-Nielsen 6d48091328 docs: XML warnings (#14663)
* chore: Fix XML warnings

* docs: Fix XML warnings

* docs: Fix XML in resource designer

* docs: Fix XML warnings

* Revert "docs: Fix XML in resource designer"

This reverts commit 8ea61c51ac161e1853ae080db7fe1b4d4cb4d2be.
2023-09-06 20:08:17 +02:00

32 lines
1001 B
C#

using Umbraco.Cms.Core;
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
using Umbraco.Cms.Infrastructure.Persistence.SqlSyntax;
using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0;
/// <summary>
/// Adds a new, self-joined field to umbracoLanguages to hold the fall-back language for
/// a given language.
/// </summary>
[Obsolete("This is not used anymore and will be removed in Umbraco 13")]
public class FallbackLanguage : MigrationBase
{
public FallbackLanguage(IMigrationContext context)
: base(context)
{
}
protected override void Migrate()
{
ColumnInfo[] columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToArray();
if (columns.Any(x =>
x.TableName.InvariantEquals(Constants.DatabaseSchema.Tables.Language) &&
x.ColumnName.InvariantEquals("fallbackLanguageId")) == false)
{
AddColumn<LanguageDto>("fallbackLanguageId");
}
}
}