Updating src/Orchard.Web/Core/Common/Migrations.cs steps to remain compatible with dev instead of 1.10.x

This commit is contained in:
Benedek Farkas 2023-06-01 17:11:29 +02:00
parent 3d119c653a
commit 380c009614

View File

@ -80,7 +80,7 @@ namespace Orchard.Core.Common {
ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder
.Attachable()
.WithDescription("Automatically generates a unique identity for the content item, which is required in import/export scenarios where one content item references another."));
return 9;
}
@ -156,6 +156,23 @@ namespace Orchard.Core.Common {
}
public int UpdateFrom6() {
SchemaBuilder.AlterTable(nameof(IdentityPartRecord), table => table
.CreateIndex($"IDX_{nameof(IdentityPartRecord)}_{nameof(IdentityPartRecord.Identifier)}", nameof(IdentityPartRecord.Identifier)));
return 7;
}
public int UpdateFrom7() {
// The Container_Id is basically a foreign key, used in several queries
SchemaBuilder.AlterTable(nameof(CommonPartRecord), table => {
table.CreateIndex($"IDX_{nameof(CommonPartRecord)}_Container_id",
"Container_id");
});
return 8;
}
public int UpdateFrom8() {
// Studying SQL Server query execution plans we noticed that when the system
// tries to find content items for requests such as
// "The items of type TTT owned by me, ordered from the most recent"
@ -193,22 +210,6 @@ namespace Orchard.Core.Common {
nameof(CommonPartRecord.OwnerId),
nameof(CommonPartRecord.PublishedUtc));
});
return 7;
}
public int UpdateFrom7() {
SchemaBuilder.AlterTable(nameof(IdentityPartRecord), table => table
.CreateIndex($"IDX_{nameof(IdentityPartRecord)}_{nameof(IdentityPartRecord.Identifier)}", nameof(IdentityPartRecord.Identifier)));
return 8;
}
public int UpdateFrom8() {
// The Container_Id is basically a foreign key, used in several queries
SchemaBuilder.AlterTable(nameof(CommonPartRecord), table => {
table.CreateIndex($"IDX_{nameof(CommonPartRecord)}_Container_id",
"Container_id");
});
return 9;
}