feat(dal,domain): Таблицы роботов перенесены в схему robot. Создана таблица TemplateRenamePendings - Шаблоны находящиеся в процессе переименования
This commit is contained in:
@@ -14,7 +14,7 @@ using PARR.API.Services.Interfaces;
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.Domain.Common.Pagination;
|
||||
using PARR.Domain.Common.Roles;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ using PARR.API.Services.Interfaces;
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.Domain.Common.Roles;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using PARR.Domain.Enums;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
|
||||
@@ -12,7 +12,7 @@ using PARR.API.Controllers.V1.Base;
|
||||
using PARR.API.Helpers;
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.Domain.Common.Roles;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.API.Controllers.V1.Statistics
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace PARR.API.Infrastructure.Middleware
|
||||
|
||||
public async ValueTask<bool> TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken)
|
||||
{
|
||||
logger.LogError(exception, "Ошибка во время запроса {TraceId}: {Message}", httpContext.TraceIdentifier, exception.Message);
|
||||
logger.LogDebug(exception, "Ошибка во время запроса {TraceId}: {Message}", httpContext.TraceIdentifier, exception.Message);
|
||||
|
||||
// определяем статус код, в зависимости от типа исключения
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.Base.History;
|
||||
using PARR.Domain.Entities.JobEntities;
|
||||
using PARR.Domain.Entities.JobGroupEntities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using PARR.Domain.Entities.Schedule;
|
||||
using PARR.Domain.Entities.Unit;
|
||||
|
||||
@@ -79,7 +80,7 @@ namespace PARR.API.MappingProfiles
|
||||
.ForMember(d => d.Script, o => o.MapFrom(s => s.AgentScript))
|
||||
.ForMember(d => d.TimeOutSec, o => o.MapFrom(s => s.AgentTimeOutSec));
|
||||
|
||||
CreateMap<PARR.Domain.Entities.TaskStatus, TaskStatusResponse>();
|
||||
CreateMap<PARR.Domain.Entities.RobotEntities.TaskStatus, TaskStatusResponse>();
|
||||
|
||||
#region ScheduleResponseAreaTimeOffsetResponse
|
||||
|
||||
@@ -255,7 +256,7 @@ namespace PARR.API.MappingProfiles
|
||||
|
||||
CreateMap<Robot, RobotResponse>();
|
||||
|
||||
CreateMap<PARR.Domain.Entities.TaskStatus, TaskStatusResponse>();
|
||||
CreateMap<PARR.Domain.Entities.RobotEntities.TaskStatus, TaskStatusResponse>();
|
||||
|
||||
CreateMap<RobotConfiguration, RobotConfigurationResponse>()
|
||||
.ForMember(d => d.Robot, o => o.MapFrom(s => s.Robot))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using PARR.Core.Repositories.Base;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.Core.Repositories.Interfaces
|
||||
{
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
{
|
||||
public interface IStatusTemplateRepository
|
||||
{
|
||||
IQueryable<Domain.Entities.TaskStatus> Get();
|
||||
IQueryable<Domain.Entities.RobotEntities.TaskStatus> Get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
{
|
||||
public interface ITaskStatusRepository
|
||||
{
|
||||
IQueryable<Domain.Entities.TaskStatus> Get();
|
||||
IQueryable<Domain.Entities.RobotEntities.TaskStatus> Get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using PARR.Core.Services.Shortcodes;
|
||||
using PARR.Domain.DTOs.RobotTask;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.Base.History;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using PARR.Domain.Enums;
|
||||
using PARR.Domain.Exceptions;
|
||||
using PARR.Domain.Settings;
|
||||
|
||||
@@ -8,6 +8,7 @@ using PARR.Domain.Entities.JobGroupEntities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using PARR.Domain.Entities.Schedule;
|
||||
using PARR.Domain.Entities.TaskEntities;
|
||||
using PARR.Domain.Entities.TemplateEntities;
|
||||
using PARR.Domain.Entities.Unit;
|
||||
using PARR.Domain.Enums;
|
||||
using PARR.Domain.Settings;
|
||||
@@ -18,34 +19,13 @@ namespace PARR.DAL.Context
|
||||
{
|
||||
public DataContext(DbContextOptions<DataContext> options) : base(options) { }
|
||||
|
||||
//public DbSet<Host> Hosts { get; set; }
|
||||
//public DbSet<WorkGroup> WorkGroups { get; set; }
|
||||
//public DbSet<AppInWorkInWorkGroup> AppInWorkInWorkGroups { get; set; }
|
||||
//public DbSet<EkStatus> EkStatuses { get; set; }
|
||||
//public DbSet<ResponseArea> ResponseAreas { get; set; }
|
||||
//public DbSet<Application> Applications { get; set; }
|
||||
//public DbSet<ApplicationType> ApplicationTypes { get; set; }
|
||||
//public DbSet<ApplicationInHost> ApplicationsInHosts { get; set; }
|
||||
|
||||
public DbSet<Template> Templates { get; set; }
|
||||
public DbSet<TemplateHistory> TemplateHistories { get; set; }
|
||||
public DbSet<TemplateStatusType> TemplateStatusTypes { get; set; }
|
||||
public DbSet<Domain.Entities.TaskStatus> TaskStatuses { get; set; }
|
||||
public DbSet<RobotStatus> RobotStatuses { get; set; }
|
||||
|
||||
public DbSet<Process> Processes { get; set; }
|
||||
public DbSet<Subprocess> Subprocesses { get; set; }
|
||||
public DbSet<Tnk> Tnks { get; set; }
|
||||
|
||||
//public DbSet<ApplicationsInWork> ApplicationsInWorks { get; set; }
|
||||
|
||||
public DbSet<Setting> Setting { get; set; }
|
||||
|
||||
public DbSet<RobotHistoryLevel> RobotHistoryLevels { get; set; }
|
||||
|
||||
public DbSet<Robot> Robots { get; set; }
|
||||
public DbSet<RobotConfiguration> RobotConfigurations { get; set; }
|
||||
public DbSet<RobotHistory> RobotHistories { get; set; }
|
||||
|
||||
#region Schedule
|
||||
|
||||
@@ -59,6 +39,8 @@ namespace PARR.DAL.Context
|
||||
public DbSet<ScheduleExcludeType> ScheduleExcludeTypes { get; set; }
|
||||
public DbSet<ScheduleResponseAreaTimeOffset> ScheduleResponseAreaTimeOffsets { get; set; }
|
||||
|
||||
public DbSet<DistributionPeriod> DistributionPeriods { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public DbSet<AgentHistory> AgentHistories { get; set; }
|
||||
@@ -73,8 +55,6 @@ namespace PARR.DAL.Context
|
||||
|
||||
public DbSet<WeekendDay> WeekendDays { get; set; }
|
||||
|
||||
public DbSet<DistributionPeriod> DistributionPeriods { get; set; }
|
||||
|
||||
public DbSet<ParrComponent> ParrComponents { get; set; }
|
||||
|
||||
#region Units
|
||||
@@ -142,11 +122,25 @@ namespace PARR.DAL.Context
|
||||
|
||||
#region Robot
|
||||
|
||||
public DbSet<RobotHistory> RobotHistories { get; set; }
|
||||
public DbSet<RobotHistoryLevel> RobotHistoryLevels { get; set; }
|
||||
public DbSet<Robot> Robots { get; set; }
|
||||
public DbSet<Domain.Entities.RobotEntities.TaskStatus> TaskStatuses { get; set; }
|
||||
public DbSet<RobotStatus> RobotStatuses { get; set; }
|
||||
public DbSet<RobotSnapshot> RobotSnapshots { get; set; }
|
||||
public DbSet<RobotConfigurationSnapshot> RobotConfigurationSnapshots { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Template
|
||||
|
||||
public DbSet<Template> Templates { get; set; }
|
||||
public DbSet<TemplateHistory> TemplateHistories { get; set; }
|
||||
public DbSet<TemplateStatusType> TemplateStatusTypes { get; set; }
|
||||
public DbSet<TemplateRenamePending> TemplateRenamePendings { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -203,7 +197,7 @@ namespace PARR.DAL.Context
|
||||
#endregion
|
||||
|
||||
#region TaskStatus
|
||||
modelBuilder.Entity<Domain.Entities.TaskStatus>(f =>
|
||||
modelBuilder.Entity<Domain.Entities.RobotEntities.TaskStatus>(f =>
|
||||
{
|
||||
f.HasData(
|
||||
|
||||
|
||||
@@ -39,7 +39,10 @@ namespace PARR.DAL
|
||||
services.AddDbContext<DataContext>(opt =>
|
||||
opt
|
||||
.EnableSensitiveDataLogging()
|
||||
.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))
|
||||
.UseNpgsql(
|
||||
configuration.GetConnectionString("DefaultConnection")
|
||||
//, npgsqlOptions => npgsqlOptions.CommandTimeout(300) // Время в секундах (5 минут)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
4096
PARR.DAL/Migrations/20260720233522_tblRobotsUpdateScheme.Designer.cs
generated
Normal file
4096
PARR.DAL/Migrations/20260720233522_tblRobotsUpdateScheme.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
68
PARR.DAL/Migrations/20260720233522_tblRobotsUpdateScheme.cs
Normal file
68
PARR.DAL/Migrations/20260720233522_tblRobotsUpdateScheme.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblRobotsUpdateScheme : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameTable(
|
||||
name: "TaskStatuses",
|
||||
newName: "TaskStatuses",
|
||||
newSchema: "robot");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "RobotStatuses",
|
||||
newName: "RobotStatuses",
|
||||
newSchema: "robot");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Robots",
|
||||
newName: "Robots",
|
||||
newSchema: "robot");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "RobotHistoryLevels",
|
||||
newName: "RobotHistoryLevels",
|
||||
newSchema: "robot");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "RobotHistories",
|
||||
newName: "RobotHistories",
|
||||
newSchema: "robot");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameTable(
|
||||
name: "TaskStatuses",
|
||||
schema: "robot",
|
||||
newName: "TaskStatuses");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "RobotStatuses",
|
||||
schema: "robot",
|
||||
newName: "RobotStatuses");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Robots",
|
||||
schema: "robot",
|
||||
newName: "Robots");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "RobotHistoryLevels",
|
||||
schema: "robot",
|
||||
newName: "RobotHistoryLevels");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "RobotHistories",
|
||||
schema: "robot",
|
||||
newName: "RobotHistories");
|
||||
}
|
||||
}
|
||||
}
|
||||
4096
PARR.DAL/Migrations/20260720233632_tblRobotsRename.Designer.cs
generated
Normal file
4096
PARR.DAL/Migrations/20260720233632_tblRobotsRename.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
222
PARR.DAL/Migrations/20260720233632_tblRobotsRename.cs
Normal file
222
PARR.DAL/Migrations/20260720233632_tblRobotsRename.cs
Normal file
@@ -0,0 +1,222 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblRobotsRename : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_RobotHistories_RobotConfigurations_RobotConfigurationId",
|
||||
schema: "robot",
|
||||
table: "RobotHistories");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_RobotHistories_RobotHistoryLevels_HistoryLevel",
|
||||
schema: "robot",
|
||||
table: "RobotHistories");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_RobotHistories_TaskStatuses_TaskStatusCode",
|
||||
schema: "robot",
|
||||
table: "RobotHistories");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_RobotHistoryLevels",
|
||||
schema: "robot",
|
||||
table: "RobotHistoryLevels");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_RobotHistories",
|
||||
schema: "robot",
|
||||
table: "RobotHistories");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "RobotHistoryLevels",
|
||||
schema: "robot",
|
||||
newName: "HistoryLevels",
|
||||
newSchema: "robot");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "RobotHistories",
|
||||
schema: "robot",
|
||||
newName: "Histories",
|
||||
newSchema: "robot");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_RobotHistories_TaskStatusCode",
|
||||
schema: "robot",
|
||||
table: "Histories",
|
||||
newName: "IX_Histories_TaskStatusCode");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_RobotHistories_RobotConfigurationId_DateCreated",
|
||||
schema: "robot",
|
||||
table: "Histories",
|
||||
newName: "IX_Histories_RobotConfigurationId_DateCreated");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_RobotHistories_HistoryLevel_DateCreated",
|
||||
schema: "robot",
|
||||
table: "Histories",
|
||||
newName: "IX_Histories_HistoryLevel_DateCreated");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_RobotHistories_DateCreated",
|
||||
schema: "robot",
|
||||
table: "Histories",
|
||||
newName: "IX_Histories_DateCreated");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_HistoryLevels",
|
||||
schema: "robot",
|
||||
table: "HistoryLevels",
|
||||
column: "Level");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Histories",
|
||||
schema: "robot",
|
||||
table: "Histories",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Histories_HistoryLevels_HistoryLevel",
|
||||
schema: "robot",
|
||||
table: "Histories",
|
||||
column: "HistoryLevel",
|
||||
principalSchema: "robot",
|
||||
principalTable: "HistoryLevels",
|
||||
principalColumn: "Level",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Histories_RobotConfigurations_RobotConfigurationId",
|
||||
schema: "robot",
|
||||
table: "Histories",
|
||||
column: "RobotConfigurationId",
|
||||
principalTable: "RobotConfigurations",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Histories_TaskStatuses_TaskStatusCode",
|
||||
schema: "robot",
|
||||
table: "Histories",
|
||||
column: "TaskStatusCode",
|
||||
principalSchema: "robot",
|
||||
principalTable: "TaskStatuses",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Histories_HistoryLevels_HistoryLevel",
|
||||
schema: "robot",
|
||||
table: "Histories");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Histories_RobotConfigurations_RobotConfigurationId",
|
||||
schema: "robot",
|
||||
table: "Histories");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Histories_TaskStatuses_TaskStatusCode",
|
||||
schema: "robot",
|
||||
table: "Histories");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_HistoryLevels",
|
||||
schema: "robot",
|
||||
table: "HistoryLevels");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Histories",
|
||||
schema: "robot",
|
||||
table: "Histories");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "HistoryLevels",
|
||||
schema: "robot",
|
||||
newName: "RobotHistoryLevels",
|
||||
newSchema: "robot");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Histories",
|
||||
schema: "robot",
|
||||
newName: "RobotHistories",
|
||||
newSchema: "robot");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_Histories_TaskStatusCode",
|
||||
schema: "robot",
|
||||
table: "RobotHistories",
|
||||
newName: "IX_RobotHistories_TaskStatusCode");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_Histories_RobotConfigurationId_DateCreated",
|
||||
schema: "robot",
|
||||
table: "RobotHistories",
|
||||
newName: "IX_RobotHistories_RobotConfigurationId_DateCreated");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_Histories_HistoryLevel_DateCreated",
|
||||
schema: "robot",
|
||||
table: "RobotHistories",
|
||||
newName: "IX_RobotHistories_HistoryLevel_DateCreated");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_Histories_DateCreated",
|
||||
schema: "robot",
|
||||
table: "RobotHistories",
|
||||
newName: "IX_RobotHistories_DateCreated");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_RobotHistoryLevels",
|
||||
schema: "robot",
|
||||
table: "RobotHistoryLevels",
|
||||
column: "Level");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_RobotHistories",
|
||||
schema: "robot",
|
||||
table: "RobotHistories",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RobotHistories_RobotConfigurations_RobotConfigurationId",
|
||||
schema: "robot",
|
||||
table: "RobotHistories",
|
||||
column: "RobotConfigurationId",
|
||||
principalTable: "RobotConfigurations",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RobotHistories_RobotHistoryLevels_HistoryLevel",
|
||||
schema: "robot",
|
||||
table: "RobotHistories",
|
||||
column: "HistoryLevel",
|
||||
principalSchema: "robot",
|
||||
principalTable: "RobotHistoryLevels",
|
||||
principalColumn: "Level",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RobotHistories_TaskStatuses_TaskStatusCode",
|
||||
schema: "robot",
|
||||
table: "RobotHistories",
|
||||
column: "TaskStatusCode",
|
||||
principalSchema: "robot",
|
||||
principalTable: "TaskStatuses",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
4133
PARR.DAL/Migrations/20260721013444_tblTemplateRenamePendings.Designer.cs
generated
Normal file
4133
PARR.DAL/Migrations/20260721013444_tblTemplateRenamePendings.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblTemplateRenamePendings : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.EnsureSchema(
|
||||
name: "template");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TemplateRenamePendings",
|
||||
schema: "template",
|
||||
columns: table => new
|
||||
{
|
||||
TemplateId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
OldName = table.Column<string>(type: "text", nullable: false, comment: "Старое имя шаблона")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TemplateRenamePendings", x => x.TemplateId);
|
||||
table.ForeignKey(
|
||||
name: "FK_TemplateRenamePendings_Templates_TemplateId",
|
||||
column: x => x.TemplateId,
|
||||
principalTable: "Templates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Шаблоны находящиеся в процессе переименования");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TemplateRenamePendings_OldName",
|
||||
schema: "template",
|
||||
table: "TemplateRenamePendings",
|
||||
column: "OldName",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "TemplateRenamePendings",
|
||||
schema: "template");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -921,44 +921,6 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("Processes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Robot", b =>
|
||||
{
|
||||
b.Property<int>("Code")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Code"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Code");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Robots");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Code = 1,
|
||||
Description = "Робот по созданию/изменению шаблона наряда ЕСПП",
|
||||
Name = "TemplateOrder"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 2,
|
||||
Description = "Робот по созданию/изменению расписания шаблона наряда в ЕСПП",
|
||||
Name = "ScheduleOrder"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -1004,6 +966,44 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("RobotConfigurations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.Robot", b =>
|
||||
{
|
||||
b.Property<int>("Code")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Code"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Code");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Robots", "robot");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Code = 1,
|
||||
Description = "Робот по созданию/изменению шаблона наряда ЕСПП",
|
||||
Name = "TemplateOrder"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 2,
|
||||
Description = "Робот по созданию/изменению расписания шаблона наряда в ЕСПП",
|
||||
Name = "ScheduleOrder"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotConfigurationSnapshot", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -1040,44 +1040,7 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotSnapshot", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.IsRequired()
|
||||
.HasMaxLength(45)
|
||||
.HasColumnType("character varying(45)")
|
||||
.HasComment("Текущий IP-адрес сервера");
|
||||
|
||||
b.Property<int>("MaxRobots")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("Максимально разрешенное количество роботов на сервере");
|
||||
|
||||
b.Property<int>("ScheduleRobotsCount")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("Количество запущенных роботов по расписаниям");
|
||||
|
||||
b.Property<int>("TemplateRobotsCount")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("Количество запущенных роботов по шаблонам");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Ip", "DateCreated");
|
||||
|
||||
b.ToTable("Snapshots", "robot", t =>
|
||||
{
|
||||
t.HasComment("Снимки роботов");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotHistory", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -1119,10 +1082,10 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.HasIndex("RobotConfigurationId", "DateCreated");
|
||||
|
||||
b.ToTable("RobotHistories");
|
||||
b.ToTable("Histories", "robot");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotHistoryLevel", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotHistoryLevel", b =>
|
||||
{
|
||||
b.Property<int>("Level")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -1140,7 +1103,7 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.HasKey("Level");
|
||||
|
||||
b.ToTable("RobotHistoryLevels");
|
||||
b.ToTable("HistoryLevels", "robot");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
@@ -1169,7 +1132,44 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotStatus", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotSnapshot", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Ip")
|
||||
.IsRequired()
|
||||
.HasMaxLength(45)
|
||||
.HasColumnType("character varying(45)")
|
||||
.HasComment("Текущий IP-адрес сервера");
|
||||
|
||||
b.Property<int>("MaxRobots")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("Максимально разрешенное количество роботов на сервере");
|
||||
|
||||
b.Property<int>("ScheduleRobotsCount")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("Количество запущенных роботов по расписаниям");
|
||||
|
||||
b.Property<int>("TemplateRobotsCount")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("Количество запущенных роботов по шаблонам");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Ip", "DateCreated");
|
||||
|
||||
b.ToTable("Snapshots", "robot", t =>
|
||||
{
|
||||
t.HasComment("Снимки роботов");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotStatus", b =>
|
||||
{
|
||||
b.Property<int>("Code")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -1187,7 +1187,7 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.HasKey("Code");
|
||||
|
||||
b.ToTable("RobotStatuses");
|
||||
b.ToTable("RobotStatuses", "robot");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
@@ -1216,6 +1216,47 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.TaskStatus", b =>
|
||||
{
|
||||
b.Property<int>("Code")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Code"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Code");
|
||||
|
||||
b.ToTable("TaskStatuses", "robot");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Code = 10,
|
||||
Description = "Требуется создание объекта в ЕСПП",
|
||||
Name = "Creating"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 20,
|
||||
Description = "Требуется обновление объекта в ЕСПП",
|
||||
Name = "Updating"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 30,
|
||||
Description = "Нормальное состояние объекта в ЕСПП и ПАРР. Объект в ПАРР соответствует объекту в ЕСПП",
|
||||
Name = "Ok"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Role", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -2743,47 +2784,6 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.TaskStatus", b =>
|
||||
{
|
||||
b.Property<int>("Code")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Code"));
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Code");
|
||||
|
||||
b.ToTable("TaskStatuses");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Code = 10,
|
||||
Description = "Требуется создание объекта в ЕСПП",
|
||||
Name = "Creating"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 20,
|
||||
Description = "Требуется обновление объекта в ЕСПП",
|
||||
Name = "Updating"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 30,
|
||||
Description = "Нормальное состояние объекта в ЕСПП и ПАРР. Объект в ПАРР соответствует объекту в ЕСПП",
|
||||
Name = "Ok"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Template", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -2850,6 +2850,30 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("Templates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.TemplateEntities.TemplateRenamePending", b =>
|
||||
{
|
||||
b.Property<Guid>("TemplateId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("OldName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasComment("Старое имя шаблона");
|
||||
|
||||
b.HasKey("TemplateId");
|
||||
|
||||
b.HasIndex("OldName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("TemplateRenamePendings", "template", t =>
|
||||
{
|
||||
t.HasComment("Шаблоны находящиеся в процессе переименования");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.TemplateHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -3516,19 +3540,19 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Robot", "Robot")
|
||||
b.HasOne("PARR.Domain.Entities.RobotEntities.Robot", "Robot")
|
||||
.WithMany("RobotConfigurations")
|
||||
.HasForeignKey("RobotCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.Domain.Entities.RobotStatus", "RobotStatus")
|
||||
b.HasOne("PARR.Domain.Entities.RobotEntities.RobotStatus", "RobotStatus")
|
||||
.WithMany("RobotConfigurations")
|
||||
.HasForeignKey("RobotStatusCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.Domain.Entities.TaskStatus", "TaskStatus")
|
||||
b.HasOne("PARR.Domain.Entities.RobotEntities.TaskStatus", "TaskStatus")
|
||||
.WithMany("RobotConfigurations")
|
||||
.HasForeignKey("TaskStatusCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -3551,19 +3575,19 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotConfigurationSnapshot", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Robot", "Robot")
|
||||
b.HasOne("PARR.Domain.Entities.RobotEntities.Robot", "Robot")
|
||||
.WithMany("ConfigurationSnapshots")
|
||||
.HasForeignKey("RobotCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.Domain.Entities.RobotStatus", "RobotStatus")
|
||||
b.HasOne("PARR.Domain.Entities.RobotEntities.RobotStatus", "RobotStatus")
|
||||
.WithMany("ConfigurationSnapshots")
|
||||
.HasForeignKey("RobotStatusCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.Domain.Entities.TaskStatus", "TaskStatus")
|
||||
b.HasOne("PARR.Domain.Entities.RobotEntities.TaskStatus", "TaskStatus")
|
||||
.WithMany("ConfigurationSnapshots")
|
||||
.HasForeignKey("TaskStatusCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -3576,9 +3600,9 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("TaskStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotHistory", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotHistory", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.RobotHistoryLevel", "RobotHistoryLevel")
|
||||
b.HasOne("PARR.Domain.Entities.RobotEntities.RobotHistoryLevel", "RobotHistoryLevel")
|
||||
.WithMany("RobotHistories")
|
||||
.HasForeignKey("HistoryLevel")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -3590,7 +3614,7 @@ namespace PARR.DAL.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.Domain.Entities.TaskStatus", "StatusTask")
|
||||
b.HasOne("PARR.Domain.Entities.RobotEntities.TaskStatus", "StatusTask")
|
||||
.WithMany("RobotHistories")
|
||||
.HasForeignKey("TaskStatusCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -3728,6 +3752,17 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Unit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.TemplateEntities.TemplateRenamePending", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Template", "Template")
|
||||
.WithOne("TemplateRenamePending")
|
||||
.HasForeignKey("PARR.Domain.Entities.TemplateEntities.TemplateRenamePending", "TemplateId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Template");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.TemplateHistory", b =>
|
||||
{
|
||||
b.HasOne("PARR.Domain.Entities.Template", "Template")
|
||||
@@ -3927,30 +3962,39 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Subprocesses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Robot", b =>
|
||||
{
|
||||
b.Navigation("ConfigurationSnapshots");
|
||||
|
||||
b.Navigation("RobotConfigurations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotConfiguration", b =>
|
||||
{
|
||||
b.Navigation("RobotHistories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotHistoryLevel", b =>
|
||||
{
|
||||
b.Navigation("RobotHistories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotStatus", b =>
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.Robot", b =>
|
||||
{
|
||||
b.Navigation("ConfigurationSnapshots");
|
||||
|
||||
b.Navigation("RobotConfigurations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotHistoryLevel", b =>
|
||||
{
|
||||
b.Navigation("RobotHistories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.RobotStatus", b =>
|
||||
{
|
||||
b.Navigation("ConfigurationSnapshots");
|
||||
|
||||
b.Navigation("RobotConfigurations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.RobotEntities.TaskStatus", b =>
|
||||
{
|
||||
b.Navigation("ConfigurationSnapshots");
|
||||
|
||||
b.Navigation("RobotConfigurations");
|
||||
|
||||
b.Navigation("RobotHistories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Role", b =>
|
||||
{
|
||||
b.Navigation("Users");
|
||||
@@ -4008,15 +4052,6 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.TaskStatus", b =>
|
||||
{
|
||||
b.Navigation("ConfigurationSnapshots");
|
||||
|
||||
b.Navigation("RobotConfigurations");
|
||||
|
||||
b.Navigation("RobotHistories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.Domain.Entities.Template", b =>
|
||||
{
|
||||
b.Navigation("AgentHistories");
|
||||
@@ -4027,6 +4062,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.Navigation("TemplateHistories");
|
||||
|
||||
b.Navigation("TemplateRenamePending");
|
||||
|
||||
b.Navigation("UnitsInTemplate");
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.DAL.Repositories
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.DAL.Repositories
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.DAL.Repositories
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.Domain.Entities;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
|
||||
namespace PARR.DAL.Repositories
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace PARR.DAL.Repositories
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
|
||||
public IQueryable<Domain.Entities.TaskStatus> Get()
|
||||
public IQueryable<Domain.Entities.RobotEntities.TaskStatus> Get()
|
||||
{
|
||||
return dataContext.TaskStatuses;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace PARR.DAL.Repositories
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
|
||||
public IQueryable<Domain.Entities.TaskStatus> Get()
|
||||
public IQueryable<Domain.Entities.RobotEntities.TaskStatus> Get()
|
||||
{
|
||||
return dataContext.TaskStatuses;
|
||||
}
|
||||
|
||||
@@ -32,10 +32,19 @@
|
||||
/// </summary>
|
||||
public const string Task = "task";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Робот
|
||||
/// </summary>
|
||||
public const string Robot = "robot";
|
||||
|
||||
/// <summary>
|
||||
/// Шаблоны
|
||||
/// </summary>
|
||||
public const string Template = "template";
|
||||
|
||||
/// <summary>
|
||||
/// Схема public
|
||||
/// </summary>
|
||||
public const string Public = "public";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Entities.Base;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@@ -53,7 +54,7 @@ namespace PARR.Domain.Entities
|
||||
public Robot? Robot { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TaskStatusCode))]
|
||||
public TaskStatus? TaskStatus { get; set; }
|
||||
public RobotEntities.TaskStatus? TaskStatus { get; set; }
|
||||
|
||||
[ForeignKey(nameof(RobotStatusCode))]
|
||||
public RobotStatus? RobotStatus { get; set; }
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using PARR.Domain.Constants;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities
|
||||
namespace PARR.Domain.Entities.RobotEntities
|
||||
{
|
||||
[Table("Robots")]
|
||||
[Table("Robots", Schema = DatabaseSchemas.Robot)]
|
||||
[Index(nameof(Name), IsUnique = true)]
|
||||
public class Robot
|
||||
{
|
||||
@@ -1,10 +1,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using PARR.Domain.Entities.Base;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities
|
||||
namespace PARR.Domain.Entities.RobotEntities
|
||||
{
|
||||
[Table("RobotHistories")]
|
||||
//[Table("RobotHistories", Schema = DatabaseSchemas.Robot)]
|
||||
[Table("Histories", Schema = DatabaseSchemas.Robot)]
|
||||
[Index(nameof(HistoryLevel), nameof(DateCreated), IsDescending = new[] { false, true })]
|
||||
[Index(nameof(RobotConfigurationId), nameof(DateCreated))]
|
||||
[Index(nameof(DateCreated))]
|
||||
@@ -1,12 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using PARR.Domain.Constants;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities
|
||||
namespace PARR.Domain.Entities.RobotEntities
|
||||
{
|
||||
/// <summary>
|
||||
/// Уровень логов работы робота
|
||||
/// </summary>
|
||||
[Table("RobotHistoryLevels")]
|
||||
//[Table("RobotHistoryLevels", Schema = DatabaseSchemas.Robot)]
|
||||
[Table("HistoryLevels", Schema = DatabaseSchemas.Robot)]
|
||||
public class RobotHistoryLevel
|
||||
{
|
||||
[Key]
|
||||
@@ -18,8 +20,5 @@ namespace PARR.Domain.Entities
|
||||
|
||||
|
||||
public ICollection<RobotHistory> RobotHistories { get; set; } = new HashSet<RobotHistory>();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using PARR.Domain.Constants;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities
|
||||
namespace PARR.Domain.Entities.RobotEntities
|
||||
{
|
||||
/// <summary>
|
||||
/// Статус работы робота
|
||||
/// </summary>
|
||||
[Table("RobotStatuses")]
|
||||
[Table("RobotStatuses", Schema = DatabaseSchemas.Robot)]
|
||||
public class RobotStatus
|
||||
{
|
||||
[Key]
|
||||
@@ -1,13 +1,13 @@
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using PARR.Domain.Constants;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities
|
||||
namespace PARR.Domain.Entities.RobotEntities
|
||||
{
|
||||
/// <summary>
|
||||
/// Статус шаблона. Что нужно сделать роботу в ЕСПП
|
||||
/// </summary>
|
||||
[Table("TaskStatuses")]
|
||||
[Table("TaskStatuses", Schema = DatabaseSchemas.Robot)]
|
||||
public class TaskStatus
|
||||
{
|
||||
[Key]
|
||||
@@ -3,6 +3,7 @@ using PARR.Domain.Entities.Base;
|
||||
using PARR.Domain.Entities.Base.History;
|
||||
using PARR.Domain.Entities.Base.History.Base;
|
||||
using PARR.Domain.Entities.JobEntities;
|
||||
using PARR.Domain.Entities.TemplateEntities;
|
||||
using PARR.Domain.Enums;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
@@ -94,5 +95,7 @@ namespace PARR.Domain.Entities
|
||||
public ICollection<UnitsInTemplate> UnitsInTemplate { get; set; } = new HashSet<UnitsInTemplate>();
|
||||
|
||||
public TemplateStatusType? StatusType { get; set; }
|
||||
|
||||
public TemplateRenamePending? TemplateRenamePending { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities.TemplateEntities
|
||||
{
|
||||
/// <summary>
|
||||
/// Шаблоны находящиеся в процессе переименования
|
||||
/// </summary>
|
||||
[Table("TemplateRenamePendings", Schema = DatabaseSchemas.Template)]
|
||||
[Comment("Шаблоны находящиеся в процессе переименования")]
|
||||
[Index(nameof(OldName), IsUnique = true)]
|
||||
public class TemplateRenamePending
|
||||
{
|
||||
[Key]
|
||||
public Guid TemplateId { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Старое имя шаблона
|
||||
/// </summary>
|
||||
[Comment("Старое имя шаблона")]
|
||||
public required string OldName { get; set; }
|
||||
|
||||
|
||||
[ForeignKey(nameof(TemplateId))]
|
||||
public required Template Template { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user