Добавлен справочник ResponseArea
This commit is contained in:
1636
PARR.DAL/Migrations/20230928015451_AddResponseAreaEnum.Designer.cs
generated
Normal file
1636
PARR.DAL/Migrations/20230928015451_AddResponseAreaEnum.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
112
PARR.DAL/Migrations/20230928015451_AddResponseAreaEnum.cs
Normal file
112
PARR.DAL/Migrations/20230928015451_AddResponseAreaEnum.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddResponseAreaEnum : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Status",
|
||||
table: "Hosts",
|
||||
newName: "StatusStr");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "ResponseArea",
|
||||
table: "Hosts",
|
||||
newName: "ResponseAreaStr");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ResponseAreaCode",
|
||||
table: "Hosts",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ResponseAreas",
|
||||
columns: table => new
|
||||
{
|
||||
Code = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Name = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ResponseAreas", x => x.Code);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "ResponseAreas",
|
||||
columns: new[] { "Code", "Name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "01-ОКТ" },
|
||||
{ 10, "10-КЛГ" },
|
||||
{ 17, "17-МСК" },
|
||||
{ 24, "24-ГОР" },
|
||||
{ 28, "28-СЕВ" },
|
||||
{ 51, "51-СКВ" },
|
||||
{ 58, "58-ЮВСТ" },
|
||||
{ 61, "61-ПРИВ" },
|
||||
{ 63, "63-КБШ" },
|
||||
{ 76, "76-СВРД" },
|
||||
{ 80, "80-ЮУР" },
|
||||
{ 83, "83-ЗСИБ" },
|
||||
{ 88, "88-КРАСН" },
|
||||
{ 94, "92-ВСИБ" },
|
||||
{ 96, "96-ДВС" },
|
||||
{ 99, "00-ГВЦ" }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Hosts_ResponseAreaCode",
|
||||
table: "Hosts",
|
||||
column: "ResponseAreaCode");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Hosts_ResponseAreas_ResponseAreaCode",
|
||||
table: "Hosts",
|
||||
column: "ResponseAreaCode",
|
||||
principalTable: "ResponseAreas",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Hosts_ResponseAreas_ResponseAreaCode",
|
||||
table: "Hosts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ResponseAreas");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Hosts_ResponseAreaCode",
|
||||
table: "Hosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ResponseAreaCode",
|
||||
table: "Hosts");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "StatusStr",
|
||||
table: "Hosts",
|
||||
newName: "Status");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "ResponseAreaStr",
|
||||
table: "Hosts",
|
||||
newName: "ResponseArea");
|
||||
}
|
||||
}
|
||||
}
|
||||
1630
PARR.DAL/Migrations/20230928042307_TblHostsRemoveResponseAreaColumns.Designer.cs
generated
Normal file
1630
PARR.DAL/Migrations/20230928042307_TblHostsRemoveResponseAreaColumns.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TblHostsRemoveResponseAreaColumns : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ResponseAreaStr",
|
||||
table: "Hosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StatusStr",
|
||||
table: "Hosts");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ResponseAreaStr",
|
||||
table: "Hosts",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "StatusStr",
|
||||
table: "Hosts",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -595,11 +595,8 @@ namespace PARR.DAL.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ResponseArea")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.HasColumnType("text");
|
||||
b.Property<int>("ResponseAreaCode")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("WorkGroup")
|
||||
.HasColumnType("text");
|
||||
@@ -608,6 +605,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.HasIndex("EkStatusCode");
|
||||
|
||||
b.HasIndex("ResponseAreaCode");
|
||||
|
||||
b.ToTable("Hosts");
|
||||
});
|
||||
|
||||
@@ -635,6 +634,105 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("Processes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.ResponseArea", b =>
|
||||
{
|
||||
b.Property<int>("Code")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Code"));
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Code");
|
||||
|
||||
b.ToTable("ResponseAreas");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Code = 96,
|
||||
Name = "96-ДВС"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 94,
|
||||
Name = "92-ВСИБ"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 88,
|
||||
Name = "88-КРАСН"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 83,
|
||||
Name = "83-ЗСИБ"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 80,
|
||||
Name = "80-ЮУР"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 76,
|
||||
Name = "76-СВРД"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 63,
|
||||
Name = "63-КБШ"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 61,
|
||||
Name = "61-ПРИВ"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 58,
|
||||
Name = "58-ЮВСТ"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 51,
|
||||
Name = "51-СКВ"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 28,
|
||||
Name = "28-СЕВ"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 24,
|
||||
Name = "24-ГОР"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 17,
|
||||
Name = "17-МСК"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 10,
|
||||
Name = "10-КЛГ"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 1,
|
||||
Name = "01-ОКТ"
|
||||
},
|
||||
new
|
||||
{
|
||||
Code = 99,
|
||||
Name = "00-ГВЦ"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Setting", b =>
|
||||
{
|
||||
b.Property<string>("Name")
|
||||
@@ -1253,7 +1351,15 @@ namespace PARR.DAL.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.ResponseArea", "ResponseArea")
|
||||
.WithMany("Hosts")
|
||||
.HasForeignKey("ResponseAreaCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EkStatus");
|
||||
|
||||
b.Navigation("ResponseArea");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Subprocess", b =>
|
||||
@@ -1449,6 +1555,11 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Subprocesses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.ResponseArea", b =>
|
||||
{
|
||||
b.Navigation("Hosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.StatusTemplate", b =>
|
||||
{
|
||||
b.Navigation("Templates");
|
||||
|
||||
Reference in New Issue
Block a user