feat(dal): Добавлена таблица WorkGroups и AppInWorkGroups
This commit is contained in:
2728
PARR.DAL/Migrations/20240603051427_TblAddWorkGroup.Designer.cs
generated
Normal file
2728
PARR.DAL/Migrations/20240603051427_TblAddWorkGroup.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
97
PARR.DAL/Migrations/20240603051427_TblAddWorkGroup.cs
Normal file
97
PARR.DAL/Migrations/20240603051427_TblAddWorkGroup.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TblAddWorkGroup : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "WorkGroupId",
|
||||
table: "Hosts",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "WorkGroups",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_WorkGroups", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AppInWorkInWorkGroups",
|
||||
columns: table => new
|
||||
{
|
||||
ApplicationsInWorkId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
WorkGroupId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AppInWorkInWorkGroups", x => new { x.ApplicationsInWorkId, x.WorkGroupId });
|
||||
table.ForeignKey(
|
||||
name: "FK_AppInWorkInWorkGroups_ApplicationsInWorks_ApplicationsInWor~",
|
||||
column: x => x.ApplicationsInWorkId,
|
||||
principalTable: "ApplicationsInWorks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_AppInWorkInWorkGroups_WorkGroups_WorkGroupId",
|
||||
column: x => x.WorkGroupId,
|
||||
principalTable: "WorkGroups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Hosts_WorkGroupId",
|
||||
table: "Hosts",
|
||||
column: "WorkGroupId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AppInWorkInWorkGroups_WorkGroupId",
|
||||
table: "AppInWorkInWorkGroups",
|
||||
column: "WorkGroupId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Hosts_WorkGroups_WorkGroupId",
|
||||
table: "Hosts",
|
||||
column: "WorkGroupId",
|
||||
principalTable: "WorkGroups",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Hosts_WorkGroups_WorkGroupId",
|
||||
table: "Hosts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AppInWorkInWorkGroups");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "WorkGroups");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Hosts_WorkGroupId",
|
||||
table: "Hosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WorkGroupId",
|
||||
table: "Hosts");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,21 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.AppInWorkInWorkGroup", b =>
|
||||
{
|
||||
b.Property<Guid>("ApplicationsInWorkId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("WorkGroupId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("ApplicationsInWorkId", "WorkGroupId");
|
||||
|
||||
b.HasIndex("WorkGroupId");
|
||||
|
||||
b.ToTable("AppInWorkInWorkGroups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -1402,12 +1417,17 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<string>("WorkGroup")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid?>("WorkGroupId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EkStatusCode");
|
||||
|
||||
b.HasIndex("ResponseAreaCode");
|
||||
|
||||
b.HasIndex("WorkGroupId");
|
||||
|
||||
b.HasIndex("Ek", "IP");
|
||||
|
||||
b.ToTable("Hosts");
|
||||
@@ -2201,6 +2221,24 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("Works");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.WorkGroup", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("WorkGroups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.AgentHistory", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.AgentHistoryLevel", "AgentHistoryLevel")
|
||||
@@ -2226,6 +2264,25 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Template");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.AppInWorkInWorkGroup", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork")
|
||||
.WithMany("WorkGroups")
|
||||
.HasForeignKey("ApplicationsInWorkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.WorkGroup", "WorkGroup")
|
||||
.WithMany("AppInWorks")
|
||||
.HasForeignKey("WorkGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicationsInWork");
|
||||
|
||||
b.Navigation("WorkGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
|
||||
@@ -2346,9 +2403,15 @@ namespace PARR.DAL.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.WorkGroup", "WorkGroupItem")
|
||||
.WithMany("Hosts")
|
||||
.HasForeignKey("WorkGroupId");
|
||||
|
||||
b.Navigation("EkStatus");
|
||||
|
||||
b.Navigation("ResponseArea");
|
||||
|
||||
b.Navigation("WorkGroupItem");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Order", b =>
|
||||
@@ -2529,6 +2592,8 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("EsppSchValues");
|
||||
|
||||
b.Navigation("Templates");
|
||||
|
||||
b.Navigation("WorkGroups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.EkStatus", b =>
|
||||
@@ -2647,6 +2712,13 @@ namespace PARR.DAL.Migrations
|
||||
{
|
||||
b.Navigation("ApplicationsInWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.WorkGroup", b =>
|
||||
{
|
||||
b.Navigation("AppInWorks");
|
||||
|
||||
b.Navigation("Hosts");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user