feat(all): ! Критические изменения логики работы всех сервисорв, База Данных имееет неокончательную версию. Template, Scheduler переведены на работу с Unit+Job+JobGroup вместо Host+ApplicationsInWork
This commit is contained in:
3773
PARR.DAL/Migrations/20250625035851_tblTemplatesMigrationFormApplicationInWork.Designer.cs
generated
Normal file
3773
PARR.DAL/Migrations/20250625035851_tblTemplatesMigrationFormApplicationInWork.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,192 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblTemplatesMigrationFormApplicationInWork : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_EsppSchValues_ApplicationsInWorks_ApplicationsInWorkId",
|
||||
table: "EsppSchValues");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Templates_ApplicationsInWorks_ApplicationInWorkId",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Templates_Hosts_HostId",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Templates_ApplicationInWorkId",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Templates_HostId",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ApplicationInWorkId",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HostId",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Duration",
|
||||
schema: "job",
|
||||
table: "Groups",
|
||||
newName: "TemplateDuration");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "ApplicationsInWorkId",
|
||||
table: "EsppSchValues",
|
||||
newName: "JobGroupId");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "AgentName",
|
||||
schema: "job",
|
||||
table: "Groups",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "AgentScript",
|
||||
schema: "job",
|
||||
table: "Groups",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "AgentTimeOutSec",
|
||||
schema: "job",
|
||||
table: "Groups",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAgent",
|
||||
schema: "job",
|
||||
table: "Groups",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAutoDistributionEnabled",
|
||||
schema: "job",
|
||||
table: "Groups",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_EsppSchValues_Groups_JobGroupId",
|
||||
table: "EsppSchValues",
|
||||
column: "JobGroupId",
|
||||
principalSchema: "job",
|
||||
principalTable: "Groups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_EsppSchValues_Groups_JobGroupId",
|
||||
table: "EsppSchValues");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AgentName",
|
||||
schema: "job",
|
||||
table: "Groups");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AgentScript",
|
||||
schema: "job",
|
||||
table: "Groups");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AgentTimeOutSec",
|
||||
schema: "job",
|
||||
table: "Groups");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAgent",
|
||||
schema: "job",
|
||||
table: "Groups");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAutoDistributionEnabled",
|
||||
schema: "job",
|
||||
table: "Groups");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "TemplateDuration",
|
||||
schema: "job",
|
||||
table: "Groups",
|
||||
newName: "Duration");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "JobGroupId",
|
||||
table: "EsppSchValues",
|
||||
newName: "ApplicationsInWorkId");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "ApplicationInWorkId",
|
||||
table: "Templates",
|
||||
type: "uuid",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "HostId",
|
||||
table: "Templates",
|
||||
type: "uuid",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Templates_ApplicationInWorkId",
|
||||
table: "Templates",
|
||||
column: "ApplicationInWorkId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Templates_HostId",
|
||||
table: "Templates",
|
||||
column: "HostId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_EsppSchValues_ApplicationsInWorks_ApplicationsInWorkId",
|
||||
table: "EsppSchValues",
|
||||
column: "ApplicationsInWorkId",
|
||||
principalTable: "ApplicationsInWorks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Templates_ApplicationsInWorks_ApplicationInWorkId",
|
||||
table: "Templates",
|
||||
column: "ApplicationInWorkId",
|
||||
principalTable: "ApplicationsInWorks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Templates_Hosts_HostId",
|
||||
table: "Templates",
|
||||
column: "HostId",
|
||||
principalTable: "Hosts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1477,7 +1477,7 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.EsppSchValue", b =>
|
||||
{
|
||||
b.Property<Guid>("ApplicationsInWorkId")
|
||||
b.Property<Guid>("JobGroupId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("TypeValueId")
|
||||
@@ -1486,7 +1486,7 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<Guid>("TypeConfigId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("ApplicationsInWorkId", "TypeValueId", "TypeConfigId");
|
||||
b.HasKey("JobGroupId", "TypeValueId", "TypeConfigId");
|
||||
|
||||
b.HasIndex("TypeConfigId");
|
||||
|
||||
@@ -1629,16 +1629,21 @@ namespace PARR.DAL.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AgentName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("AgentScript")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("AgentTimeOutSec")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTimeOffset?>("DateModified")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Duration")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FullDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
@@ -1647,6 +1652,12 @@ namespace PARR.DAL.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsAgent")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("IsAutoDistributionEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool?>("IsUmbrella")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
@@ -1661,6 +1672,10 @@ namespace PARR.DAL.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TemplateDuration")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Groups", "job", t =>
|
||||
@@ -2559,18 +2574,12 @@ namespace PARR.DAL.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("ApplicationInWorkId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTimeOffset?>("DateModified")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<Guid>("HostId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("InitiatorComment")
|
||||
.HasColumnType("text");
|
||||
|
||||
@@ -2607,10 +2616,6 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationInWorkId");
|
||||
|
||||
b.HasIndex("HostId");
|
||||
|
||||
b.HasIndex("JobId");
|
||||
|
||||
b.HasIndex("Name")
|
||||
@@ -3143,9 +3148,9 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.EsppSchValue", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork")
|
||||
b.HasOne("PARR.DAL.Models.Job.JobGroup", "JobGroup")
|
||||
.WithMany("EsppSchValues")
|
||||
.HasForeignKey("ApplicationsInWorkId")
|
||||
.HasForeignKey("JobGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
@@ -3161,11 +3166,11 @@ namespace PARR.DAL.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicationsInWork");
|
||||
|
||||
b.Navigation("EsppSchTypeConfig");
|
||||
|
||||
b.Navigation("EsppSchTypeValue");
|
||||
|
||||
b.Navigation("JobGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
||||
@@ -3215,7 +3220,7 @@ namespace PARR.DAL.Migrations
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.Job", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Job.JobGroup", "Group")
|
||||
.WithMany("Job")
|
||||
.WithMany("Jobs")
|
||||
.HasForeignKey("GroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
@@ -3381,18 +3386,6 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Template", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork")
|
||||
.WithMany("Templates")
|
||||
.HasForeignKey("ApplicationInWorkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.Host", "Host")
|
||||
.WithMany("Templates")
|
||||
.HasForeignKey("HostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.Job.Job", "Job")
|
||||
.WithMany()
|
||||
.HasForeignKey("JobId")
|
||||
@@ -3400,15 +3393,11 @@ namespace PARR.DAL.Migrations
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "Unit")
|
||||
.WithMany()
|
||||
.WithMany("Templates")
|
||||
.HasForeignKey("UnitId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicationsInWork");
|
||||
|
||||
b.Navigation("Host");
|
||||
|
||||
b.Navigation("Job");
|
||||
|
||||
b.Navigation("Unit");
|
||||
@@ -3580,12 +3569,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b =>
|
||||
{
|
||||
b.Navigation("EsppSchValues");
|
||||
|
||||
b.Navigation("JobAutoControl");
|
||||
|
||||
b.Navigation("Templates");
|
||||
|
||||
b.Navigation("WorkGroups");
|
||||
});
|
||||
|
||||
@@ -3631,8 +3616,6 @@ namespace PARR.DAL.Migrations
|
||||
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
||||
{
|
||||
b.Navigation("ApplicationsInHosts");
|
||||
|
||||
b.Navigation("Templates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.Job", b =>
|
||||
@@ -3642,7 +3625,9 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.JobGroup", b =>
|
||||
{
|
||||
b.Navigation("Job");
|
||||
b.Navigation("EsppSchValues");
|
||||
|
||||
b.Navigation("Jobs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.JobUnitFilter", b =>
|
||||
@@ -3740,6 +3725,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.Navigation("ParentUnits");
|
||||
|
||||
b.Navigation("Templates");
|
||||
|
||||
b.Navigation("UnitFields");
|
||||
|
||||
b.Navigation("UnitValues");
|
||||
|
||||
Reference in New Issue
Block a user