feat(dal,api,nextRun,templateGenerator,templateActivator): IsUnused вынесена в TemplateStatusType
This commit is contained in:
4026
PARR.DAL/Migrations/20251201045923_tblTemplateStatusType.Designer.cs
generated
Normal file
4026
PARR.DAL/Migrations/20251201045923_tblTemplateStatusType.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
101
PARR.DAL/Migrations/20251201045923_tblTemplateStatusType.cs
Normal file
101
PARR.DAL/Migrations/20251201045923_tblTemplateStatusType.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblTemplateStatusType : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsUnused",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "StatusTypeId",
|
||||
table: "Templates",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "StatusTypeId",
|
||||
table: "TemplateHistories",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TemplateStatusTypes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TemplateStatusTypes", x => x.Id);
|
||||
},
|
||||
comment: "Таблица описания критериев выборки аттрибутов ЭК");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "TemplateStatusTypes",
|
||||
columns: new[] { "Id", "Description", "Name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 0, "В работе", "Used" },
|
||||
{ 1, "Не используется", "Unused" },
|
||||
{ 2, "Обновляется", "Updating" }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Templates_StatusTypeId",
|
||||
table: "Templates",
|
||||
column: "StatusTypeId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Templates_TemplateStatusTypes_StatusTypeId",
|
||||
table: "Templates",
|
||||
column: "StatusTypeId",
|
||||
principalTable: "TemplateStatusTypes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Templates_TemplateStatusTypes_StatusTypeId",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TemplateStatusTypes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Templates_StatusTypeId",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StatusTypeId",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StatusTypeId",
|
||||
table: "TemplateHistories");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsUnused",
|
||||
table: "Templates",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2693,9 +2693,6 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<bool>("IsActiveTemplate")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("IsUnused")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("JobId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
@@ -2712,6 +2709,9 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<string>("ScheduleEsppId")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("StatusTypeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<Guid>("UnitId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
@@ -2719,6 +2719,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.HasIndex("JobId");
|
||||
|
||||
b.HasIndex("StatusTypeId");
|
||||
|
||||
b.HasIndex("UnitId");
|
||||
|
||||
b.HasIndex("Name", "Index")
|
||||
@@ -2767,6 +2769,9 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<Guid>("ParentId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("StatusTypeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ParentId");
|
||||
@@ -2774,6 +2779,47 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("TemplateHistories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.TemplateStatusType", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("TemplateStatusTypes", t =>
|
||||
{
|
||||
t.HasComment("Таблица описания критериев выборки аттрибутов ЭК");
|
||||
});
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 0,
|
||||
Description = "В работе",
|
||||
Name = "Used"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Description = "Не используется",
|
||||
Name = "Unused"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Description = "Обновляется",
|
||||
Name = "Updating"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Tnk", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -3552,6 +3598,12 @@ namespace PARR.DAL.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.TemplateStatusType", "StatusType")
|
||||
.WithMany("Templates")
|
||||
.HasForeignKey("StatusTypeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "Unit")
|
||||
.WithMany("Templates")
|
||||
.HasForeignKey("UnitId")
|
||||
@@ -3560,6 +3612,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.Navigation("Job");
|
||||
|
||||
b.Navigation("StatusType");
|
||||
|
||||
b.Navigation("Unit");
|
||||
});
|
||||
|
||||
@@ -3904,6 +3958,11 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("UnitsInTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.TemplateStatusType", b =>
|
||||
{
|
||||
b.Navigation("Templates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Tnk", b =>
|
||||
{
|
||||
b.Navigation("Works");
|
||||
|
||||
Reference in New Issue
Block a user