Files
Umbraco-CMS/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_7_0/MissingDictionaryIndex.cs
Bjarke Berg 616d092577 Obsolete old migrations and exif code (#13382)
* Obsoleted and deleted internal migrations + Enabled breaking changes checks agains v11.0.0-rc1

* Obsoleted and deleted internal exif stuff

* Added CompatibilitySuppressions.xml

* Change GenerateCompatibilitySuppressionFile
2022-11-14 12:40:06 +01:00

33 lines
934 B
C#

using Umbraco.Cms.Infrastructure.Persistence.Dtos;
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_7_0;
[Obsolete("This is not used anymore and will be removed in Umbraco 13")]
public class MissingDictionaryIndex : MigrationBase
{
public MissingDictionaryIndex(IMigrationContext context)
: base(context)
{
}
/// <summary>
/// Adds an index to the foreign key column <c>parent</c> on <c>DictionaryDto</c>'s table
/// if it doesn't already exist
/// </summary>
protected override void Migrate()
{
var indexName = "IX_" + DictionaryDto.TableName + "_Parent";
if (!IndexExists(indexName))
{
Create
.Index(indexName)
.OnTable(DictionaryDto.TableName)
.OnColumn("parent")
.Ascending()
.WithOptions().NonClustered()
.Do();
}
}
}