Skip to content

Commit

Permalink
fix: add missing index on LastChangedList GRAR-1271
Browse files Browse the repository at this point in the history
  • Loading branch information
ridingwolf authored and CumpsD committed May 6, 2020
1 parent 39a83fc commit 9c758e3
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"commands": [
"paket"
]
},
"dotnet-ef": {
"version": "3.1.2",
"commands": [
"dotnet-ef"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasKey(x => x.Id)
.IsClustered();

modelBuilder
.Entity<LastChangedRecord>()
.HasIndex(x => new
{
x.Position,
x.LastPopulatedPosition,
x.ErrorCount,
x.LastError
});

modelBuilder
.HasDefaultSchema(Schema);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore.Migrations;

namespace Be.Vlaanderen.Basisregisters.ProjectionHandling.LastChangedList.Migrations
{
public partial class AddLastChangedListIndex : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_LastChangedList_Position_LastPopulatedPosition_ErrorCount_LastError",
schema: "Redis",
table: "LastChangedList",
columns: new[] { "Position", "LastPopulatedPosition", "ErrorCount", "LastError" });
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_LastChangedList_Position_LastPopulatedPosition_ErrorCount_LastError",
schema: "Redis",
table: "LastChangedList");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasIndex("Position");
b.HasIndex("Position", "LastPopulatedPosition", "ErrorCount", "LastError");
b.ToTable("LastChangedList");
});

Expand Down

0 comments on commit 9c758e3

Please sign in to comment.