Adds a couple missing indexes
This commit is contained in:
@@ -185,6 +185,7 @@ namespace Umbraco.Core.Migrations.Upgrade
|
||||
|
||||
// to 8.6.0
|
||||
To<AddPropertyTypeValidationMessageColumns>("{3D67D2C8-5E65-47D0-A9E1-DC2EE0779D6B}");
|
||||
To<MissingContentVersionsIndexes>("{EE288A91-531B-4995-8179-1D62D9AA3E2E}");
|
||||
|
||||
//FINAL
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Umbraco.Core.Persistence.Dtos;
|
||||
|
||||
namespace Umbraco.Core.Migrations.Upgrade.V_8_6_0
|
||||
{
|
||||
|
||||
public class AddPropertyTypeValidationMessageColumns : MigrationBase
|
||||
{
|
||||
public AddPropertyTypeValidationMessageColumns(IMigrationContext context)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using Umbraco.Core.Persistence.Dtos;
|
||||
|
||||
namespace Umbraco.Core.Migrations.Upgrade.V_8_6_0
|
||||
{
|
||||
public class MissingContentVersionsIndexes : MigrationBase
|
||||
{
|
||||
public MissingContentVersionsIndexes(IMigrationContext context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Migrate()
|
||||
{
|
||||
Create
|
||||
.Index("IX_" + ContentVersionDto.TableName + "_NodeId")
|
||||
.OnTable(ContentVersionDto.TableName)
|
||||
.OnColumn("nodeId")
|
||||
.Ascending()
|
||||
.WithOptions().NonClustered()
|
||||
.Do();
|
||||
|
||||
Create
|
||||
.Index("IX_" + ContentVersionDto.TableName + "_Current")
|
||||
.OnTable(ContentVersionDto.TableName)
|
||||
.OnColumn("current")
|
||||
.Ascending()
|
||||
.WithOptions().NonClustered()
|
||||
.Do();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ namespace Umbraco.Core.Persistence.Dtos
|
||||
|
||||
[Column("nodeId")]
|
||||
[ForeignKey(typeof(ContentDto))]
|
||||
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_NodeId")]
|
||||
public int NodeId { get; set; }
|
||||
|
||||
[Column("versionDate")] // TODO: db rename to 'updateDate'
|
||||
@@ -30,8 +31,8 @@ namespace Umbraco.Core.Persistence.Dtos
|
||||
[NullSetting(NullSetting = NullSettings.Null)]
|
||||
public int? UserId { get => _userId == 0 ? null : _userId; set => _userId = value; } //return null if zero
|
||||
|
||||
// TODO: we need an index on this it is used almost always in querying and sorting
|
||||
[Column("current")]
|
||||
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_Current")]
|
||||
public bool Current { get; set; }
|
||||
|
||||
// about current:
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
</Compile>
|
||||
-->
|
||||
<Compile Include="AssemblyExtensions.cs" />
|
||||
<Compile Include="Migrations\Upgrade\V_8_6_0\MissingContentVersionsIndexes.cs" />
|
||||
<Compile Include="SystemLock.cs" />
|
||||
<Compile Include="Attempt.cs" />
|
||||
<Compile Include="AttemptOfTResult.cs" />
|
||||
|
||||
Reference in New Issue
Block a user