feat(dal): Индексы для RobotHistory
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="8.6.1" />
|
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="8.6.1" />
|
||||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.5.2" />
|
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.5.2" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.20">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|||||||
3791
PARR.DAL/Migrations/20260415000357_tblRobotHistoryAddIndex.Designer.cs
generated
Normal file
3791
PARR.DAL/Migrations/20260415000357_tblRobotHistoryAddIndex.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3793
PARR.DAL/Migrations/20260415002940_tblRobotHistoryAddIndex2.Designer.cs
generated
Normal file
3793
PARR.DAL/Migrations/20260415002940_tblRobotHistoryAddIndex2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1900,12 +1900,15 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("HistoryLevel");
|
b.HasIndex("DateCreated");
|
||||||
|
|
||||||
b.HasIndex("RobotConfigurationId");
|
|
||||||
|
|
||||||
b.HasIndex("TaskStatusCode");
|
b.HasIndex("TaskStatusCode");
|
||||||
|
|
||||||
|
b.HasIndex("HistoryLevel", "DateCreated")
|
||||||
|
.IsDescending(false, true);
|
||||||
|
|
||||||
|
b.HasIndex("RobotConfigurationId", "DateCreated");
|
||||||
|
|
||||||
b.ToTable("RobotHistories");
|
b.ToTable("RobotHistories");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
using PARR.Domain.Entities.Base;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using PARR.Domain.Entities.Base;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace PARR.DAL.Models
|
namespace PARR.DAL.Models
|
||||||
{
|
{
|
||||||
[Table("RobotHistories")]
|
[Table("RobotHistories")]
|
||||||
|
[Index(nameof(HistoryLevel), nameof(DateCreated), IsDescending = new[] { false, true })]
|
||||||
|
[Index(nameof(RobotConfigurationId), nameof(DateCreated))]
|
||||||
|
[Index(nameof(DateCreated))]
|
||||||
public class RobotHistory : IBaseEntity
|
public class RobotHistory : IBaseEntity
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.5">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.20">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|||||||
Reference in New Issue
Block a user