feat(core,dal,domain,snapshotWorker): Воркер по управлению снапшотами. Создание сгапшотов для таблицы RobotConfigurations
This commit is contained in:
4090
PARR.DAL/Migrations/20260713002251_tblRobotConfigurationSnapshots.Designer.cs
generated
Normal file
4090
PARR.DAL/Migrations/20260713002251_tblRobotConfigurationSnapshots.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblRobotConfigurationSnapshots : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ConfigurationSnapshots",
|
||||
schema: "robot",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
RobotCode = table.Column<int>(type: "integer", nullable: false),
|
||||
RobotStatusCode = table.Column<int>(type: "integer", nullable: false),
|
||||
TaskStatusCode = table.Column<int>(type: "integer", nullable: false),
|
||||
Count = table.Column<int>(type: "integer", nullable: false, comment: "Количество заданий в этой комбинации статусов")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ConfigurationSnapshots", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConfigurationSnapshots_RobotStatuses_RobotStatusCode",
|
||||
column: x => x.RobotStatusCode,
|
||||
principalTable: "RobotStatuses",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConfigurationSnapshots_Robots_RobotCode",
|
||||
column: x => x.RobotCode,
|
||||
principalTable: "Robots",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConfigurationSnapshots_TaskStatuses_TaskStatusCode",
|
||||
column: x => x.TaskStatusCode,
|
||||
principalTable: "TaskStatuses",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Снимки заданий роботам");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConfigurationSnapshots_RobotCode_DateCreated",
|
||||
schema: "robot",
|
||||
table: "ConfigurationSnapshots",
|
||||
columns: new[] { "RobotCode", "DateCreated" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConfigurationSnapshots_RobotStatusCode",
|
||||
schema: "robot",
|
||||
table: "ConfigurationSnapshots",
|
||||
column: "RobotStatusCode");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConfigurationSnapshots_TaskStatusCode",
|
||||
schema: "robot",
|
||||
table: "ConfigurationSnapshots",
|
||||
column: "TaskStatusCode");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ConfigurationSnapshots",
|
||||
schema: "robot");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,7 +175,7 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.Job", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -234,7 +234,7 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.JobAutoControl", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.JobAutoControl", b =>
|
||||
{
|
||||
b.Property<Guid>("JobId")
|
||||
.HasColumnType("uuid");
|
||||
@@ -256,7 +256,7 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.JobFieldFilter", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.JobFieldFilter", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -290,7 +290,7 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.JobRelationshipFilter", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.JobRelationshipFilter", b =>
|
||||
{
|
||||
b.Property<Guid>("UnitFilterId")
|
||||
.HasColumnType("uuid");
|
||||
@@ -321,7 +321,7 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.JobUnitFilter", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -347,7 +347,7 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.UnitsInTemplate", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.UnitsInTemplate", b =>
|
||||
{
|
||||
b.Property<Guid>("TemplateId")
|
||||
.HasColumnType("uuid");
|
||||
@@ -1004,6 +1004,42 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("RobotConfigurations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotConfigurationSnapshot", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("Count")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("Количество заданий в этой комбинации статусов");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("RobotCode")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("RobotStatusCode")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("TaskStatusCode")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RobotStatusCode");
|
||||
|
||||
b.HasIndex("TaskStatusCode");
|
||||
|
||||
b.HasIndex("RobotCode", "DateCreated");
|
||||
|
||||
b.ToTable("ConfigurationSnapshots", "robot", t =>
|
||||
{
|
||||
t.HasComment("Снимки заданий роботам");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotSnapshot", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -3232,7 +3268,7 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("DistributionPeriodType");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.Job", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.JobGroupEntities.JobGroup", "Group")
|
||||
.WithMany("Jobs")
|
||||
@@ -3251,18 +3287,18 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Tnk");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.JobAutoControl", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.JobAutoControl", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Job.Job", "Job")
|
||||
b.HasOne("PARR.Domain.Entities.JobEntities.Job", "Job")
|
||||
.WithOne("AutoControl")
|
||||
.HasForeignKey("PARR.Domain.Entities.Job.JobAutoControl", "JobId")
|
||||
.HasForeignKey("PARR.Domain.Entities.JobEntities.JobAutoControl", "JobId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Job");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.JobFieldFilter", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.JobFieldFilter", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField")
|
||||
.WithMany("JobFieldFilters")
|
||||
@@ -3270,7 +3306,7 @@ namespace PARR.DAL.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.Domain.Entities.Job.JobUnitFilter", "UnitFilter")
|
||||
b.HasOne("PARR.Domain.Entities.JobEntities.JobUnitFilter", "UnitFilter")
|
||||
.WithMany("FieldFilters")
|
||||
.HasForeignKey("UnitFilterId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -3281,7 +3317,7 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("UnitFilter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.JobRelationshipFilter", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.JobRelationshipFilter", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField")
|
||||
.WithMany("RelationshipFilters")
|
||||
@@ -3289,7 +3325,7 @@ namespace PARR.DAL.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.Domain.Entities.Job.JobUnitFilter", "UnitFilter")
|
||||
b.HasOne("PARR.Domain.Entities.JobEntities.JobUnitFilter", "UnitFilter")
|
||||
.WithMany("RelationshipFilters")
|
||||
.HasForeignKey("UnitFilterId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -3300,9 +3336,9 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("UnitFilter");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.JobUnitFilter", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Job.Job", "Job")
|
||||
b.HasOne("PARR.Domain.Entities.JobEntities.Job", "Job")
|
||||
.WithMany("UnitFilters")
|
||||
.HasForeignKey("JobId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -3311,7 +3347,7 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Job");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.UnitsInTemplate", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.UnitsInTemplate", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Template", "Template")
|
||||
.WithMany("UnitsInTemplate")
|
||||
@@ -3507,6 +3543,33 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Template");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotConfigurationSnapshot", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Robot", "Robot")
|
||||
.WithMany("ConfigurationSnapshots")
|
||||
.HasForeignKey("RobotCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.Domain.Entities.RobotStatus", "RobotStatus")
|
||||
.WithMany("ConfigurationSnapshots")
|
||||
.HasForeignKey("RobotStatusCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.Domain.Entities.TaskStatus", "TaskStatus")
|
||||
.WithMany("ConfigurationSnapshots")
|
||||
.HasForeignKey("TaskStatusCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Robot");
|
||||
|
||||
b.Navigation("RobotStatus");
|
||||
|
||||
b.Navigation("TaskStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotHistory", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.RobotHistoryLevel", "RobotHistoryLevel")
|
||||
@@ -3634,7 +3697,7 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Template", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Job.Job", "Job")
|
||||
b.HasOne("PARR.Domain.Entities.JobEntities.Job", "Job")
|
||||
.WithMany("Templates")
|
||||
.HasForeignKey("JobId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -3802,7 +3865,7 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Periods");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.Job", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.Job", b =>
|
||||
{
|
||||
b.Navigation("AutoControl");
|
||||
|
||||
@@ -3811,7 +3874,7 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("UnitFilters");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Job.JobUnitFilter", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.JobEntities.JobUnitFilter", b =>
|
||||
{
|
||||
b.Navigation("FieldFilters");
|
||||
|
||||
@@ -3860,6 +3923,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Robot", b =>
|
||||
{
|
||||
b.Navigation("ConfigurationSnapshots");
|
||||
|
||||
b.Navigation("RobotConfigurations");
|
||||
});
|
||||
|
||||
@@ -3875,6 +3940,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotStatus", b =>
|
||||
{
|
||||
b.Navigation("ConfigurationSnapshots");
|
||||
|
||||
b.Navigation("RobotConfigurations");
|
||||
});
|
||||
|
||||
@@ -3937,6 +4004,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.TaskStatus", b =>
|
||||
{
|
||||
b.Navigation("ConfigurationSnapshots");
|
||||
|
||||
b.Navigation("RobotConfigurations");
|
||||
|
||||
b.Navigation("RobotHistories");
|
||||
|
||||
Reference in New Issue
Block a user