feat(dal): Индексы для RobotHistory

This commit is contained in:
Mikhail Trubnikov
2026-04-15 10:48:21 +10:00
parent a93e8de4b0
commit c3b4c45892
8 changed files with 7679 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,55 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
/// <inheritdoc />
public partial class tblRobotHistoryAddIndex : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_RobotHistories_HistoryLevel",
table: "RobotHistories");
migrationBuilder.DropIndex(
name: "IX_RobotHistories_RobotConfigurationId",
table: "RobotHistories");
migrationBuilder.CreateIndex(
name: "IX_RobotHistories_HistoryLevel_DateCreated",
table: "RobotHistories",
columns: new[] { "HistoryLevel", "DateCreated" },
descending: new[] { false, true });
migrationBuilder.CreateIndex(
name: "IX_RobotHistories_RobotConfigurationId_DateCreated",
table: "RobotHistories",
columns: new[] { "RobotConfigurationId", "DateCreated" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_RobotHistories_HistoryLevel_DateCreated",
table: "RobotHistories");
migrationBuilder.DropIndex(
name: "IX_RobotHistories_RobotConfigurationId_DateCreated",
table: "RobotHistories");
migrationBuilder.CreateIndex(
name: "IX_RobotHistories_HistoryLevel",
table: "RobotHistories",
column: "HistoryLevel");
migrationBuilder.CreateIndex(
name: "IX_RobotHistories_RobotConfigurationId",
table: "RobotHistories",
column: "RobotConfigurationId");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
/// <inheritdoc />
public partial class tblRobotHistoryAddIndex2 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_RobotHistories_DateCreated",
table: "RobotHistories",
column: "DateCreated");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_RobotHistories_DateCreated",
table: "RobotHistories");
}
}
}

View File

@@ -1900,12 +1900,15 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.HasIndex("HistoryLevel");
b.HasIndex("RobotConfigurationId");
b.HasIndex("DateCreated");
b.HasIndex("TaskStatusCode");
b.HasIndex("HistoryLevel", "DateCreated")
.IsDescending(false, true);
b.HasIndex("RobotConfigurationId", "DateCreated");
b.ToTable("RobotHistories");
});