Changes index to be a combined index since that is what is required

This commit is contained in:
Shannon
2019-12-11 16:30:27 +01:00
parent fba537928a
commit 2b14a40e45
2 changed files with 2 additions and 8 deletions

View File

@@ -15,16 +15,11 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_6_0
.OnTable(ContentVersionDto.TableName)
.OnColumn("nodeId")
.Ascending()
.WithOptions().NonClustered()
.Do();
Create
.Index("IX_" + ContentVersionDto.TableName + "_Current")
.OnTable(ContentVersionDto.TableName)
.OnColumn("current")
.Ascending()
.WithOptions().NonClustered()
.Do();
}
}
}

View File

@@ -19,7 +19,7 @@ namespace Umbraco.Core.Persistence.Dtos
[Column("nodeId")]
[ForeignKey(typeof(ContentDto))]
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_NodeId")]
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_NodeId", ForColumns = "nodeId,current")]
public int NodeId { get; set; }
[Column("versionDate")] // TODO: db rename to 'updateDate'
@@ -32,7 +32,6 @@ namespace Umbraco.Core.Persistence.Dtos
public int? UserId { get => _userId == 0 ? null : _userId; set => _userId = value; } //return null if zero
[Column("current")]
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_Current")]
public bool Current { get; set; }
// about current: