feat(dal): Созданы таблицы схемы Job
This commit is contained in:
3708
PARR.DAL/Migrations/20250603012302_tblsWorkInit.Designer.cs
generated
Normal file
3708
PARR.DAL/Migrations/20250603012302_tblsWorkInit.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
146
PARR.DAL/Migrations/20250603012302_tblsWorkInit.cs
Normal file
146
PARR.DAL/Migrations/20250603012302_tblsWorkInit.cs
Normal file
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblsWorkInit : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.EnsureSchema(
|
||||
name: "job");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Jobs",
|
||||
schema: "job",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
IsUmbrella = table.Column<bool>(type: "boolean", nullable: true),
|
||||
MinValueRelationships = table.Column<int>(type: "integer", nullable: true),
|
||||
MaxValueRelationships = table.Column<int>(type: "integer", nullable: true),
|
||||
TemplateNameMask = table.Column<string>(type: "text", nullable: true),
|
||||
TnkId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Jobs", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Jobs_Tnks_TnkId",
|
||||
column: x => x.TnkId,
|
||||
principalTable: "Tnks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Таблица видов работ");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobDetails",
|
||||
schema: "job",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||
UnitFilter = table.Column<string>(type: "text", nullable: false),
|
||||
JobId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ShortDescription = table.Column<string>(type: "text", nullable: false),
|
||||
FullDescription = table.Column<string>(type: "text", nullable: false),
|
||||
Solution = table.Column<string>(type: "text", nullable: false),
|
||||
Duration = table.Column<string>(type: "text", nullable: false),
|
||||
ReferenceDate = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobDetails", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobDetails_Jobs_JobId",
|
||||
column: x => x.JobId,
|
||||
principalSchema: "job",
|
||||
principalTable: "Jobs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Таблица описания критериев выборки ЭК, описание полей в АСУ ЕСПП");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "FieldFilters",
|
||||
schema: "job",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||
JobDetailId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
FieldId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ValueMask = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_FieldFilters", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_FieldFilters_Fields_FieldId",
|
||||
column: x => x.FieldId,
|
||||
principalSchema: "unit",
|
||||
principalTable: "Fields",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_FieldFilters_JobDetails_JobDetailId",
|
||||
column: x => x.JobDetailId,
|
||||
principalSchema: "job",
|
||||
principalTable: "JobDetails",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Таблица описания критериев выборки аттрибутов ЭК");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_FieldFilters_FieldId",
|
||||
schema: "job",
|
||||
table: "FieldFilters",
|
||||
column: "FieldId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_FieldFilters_JobDetailId",
|
||||
schema: "job",
|
||||
table: "FieldFilters",
|
||||
column: "JobDetailId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobDetails_JobId",
|
||||
schema: "job",
|
||||
table: "JobDetails",
|
||||
column: "JobId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Jobs_TnkId",
|
||||
schema: "job",
|
||||
table: "Jobs",
|
||||
column: "TnkId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "FieldFilters",
|
||||
schema: "job");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobDetails",
|
||||
schema: "job");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Jobs",
|
||||
schema: "job");
|
||||
}
|
||||
}
|
||||
}
|
||||
3708
PARR.DAL/Migrations/20250604015348_tblsFieldFiltersRenameColumn.Designer.cs
generated
Normal file
3708
PARR.DAL/Migrations/20250604015348_tblsFieldFiltersRenameColumn.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,72 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblsFieldFiltersRenameColumn : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_FieldFilters_JobDetails_JobDetailId",
|
||||
schema: "job",
|
||||
table: "FieldFilters");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "JobDetailId",
|
||||
schema: "job",
|
||||
table: "FieldFilters",
|
||||
newName: "JobDetailsId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_FieldFilters_JobDetailId",
|
||||
schema: "job",
|
||||
table: "FieldFilters",
|
||||
newName: "IX_FieldFilters_JobDetailsId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_FieldFilters_JobDetails_JobDetailsId",
|
||||
schema: "job",
|
||||
table: "FieldFilters",
|
||||
column: "JobDetailsId",
|
||||
principalSchema: "job",
|
||||
principalTable: "JobDetails",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_FieldFilters_JobDetails_JobDetailsId",
|
||||
schema: "job",
|
||||
table: "FieldFilters");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "JobDetailsId",
|
||||
schema: "job",
|
||||
table: "FieldFilters",
|
||||
newName: "JobDetailId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_FieldFilters_JobDetailsId",
|
||||
schema: "job",
|
||||
table: "FieldFilters",
|
||||
newName: "IX_FieldFilters_JobDetailId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_FieldFilters_JobDetails_JobDetailId",
|
||||
schema: "job",
|
||||
table: "FieldFilters",
|
||||
column: "JobDetailId",
|
||||
principalSchema: "job",
|
||||
principalTable: "JobDetails",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1542,6 +1542,129 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("Hosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.FieldFilter", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTimeOffset?>("DateModified")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<Guid>("FieldId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("JobDetailsId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ValueMask")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("FieldId");
|
||||
|
||||
b.HasIndex("JobDetailsId");
|
||||
|
||||
b.ToTable("FieldFilters", "job", t =>
|
||||
{
|
||||
t.HasComment("Таблица описания критериев выборки аттрибутов ЭК");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.Job", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTimeOffset?>("DateModified")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<bool?>("IsUmbrella")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int?>("MaxValueRelationships")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("MinValueRelationships")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TemplateNameMask")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("TnkId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TnkId");
|
||||
|
||||
b.ToTable("Jobs", "job", t =>
|
||||
{
|
||||
t.HasComment("Таблица видов работ");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.JobDetails", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
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");
|
||||
|
||||
b.Property<Guid>("JobId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("ReferenceDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("ShortDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Solution")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("UnitFilter")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("JobId");
|
||||
|
||||
b.ToTable("JobDetails", "job", t =>
|
||||
{
|
||||
t.HasComment("Таблица описания критериев выборки ЭК, описание полей в АСУ ЕСПП");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobAutoControl", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -3021,6 +3144,47 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("WorkGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.FieldFilter", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Unit.UnitField", "Field")
|
||||
.WithMany()
|
||||
.HasForeignKey("FieldId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.Job.JobDetails", "JobDetails")
|
||||
.WithMany("fieldFilters")
|
||||
.HasForeignKey("JobDetailsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Field");
|
||||
|
||||
b.Navigation("JobDetails");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.Job", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Tnk", "Tnk")
|
||||
.WithMany()
|
||||
.HasForeignKey("TnkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Tnk");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.JobDetails", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Job.Job", "Job")
|
||||
.WithMany("JobDetails")
|
||||
.HasForeignKey("JobId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Job");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobAutoControl", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork")
|
||||
@@ -3239,21 +3403,21 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInUnit", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "Child")
|
||||
.WithMany("Parents")
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "ChildUnit")
|
||||
.WithMany("ParentUnits")
|
||||
.HasForeignKey("ChildUnitId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "Parent")
|
||||
.WithMany("Childs")
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "ParentUnit")
|
||||
.WithMany("ChildUnits")
|
||||
.HasForeignKey("ParentUnitId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Child");
|
||||
b.Navigation("ChildUnit");
|
||||
|
||||
b.Navigation("Parent");
|
||||
b.Navigation("ParentUnit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInValue", b =>
|
||||
@@ -3398,6 +3562,16 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Templates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.Job", b =>
|
||||
{
|
||||
b.Navigation("JobDetails");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.JobDetails", b =>
|
||||
{
|
||||
b.Navigation("fieldFilters");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobAutoControl", b =>
|
||||
{
|
||||
b.Navigation("JobAutoControlInEkStatuses");
|
||||
@@ -3484,9 +3658,9 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.Unit", b =>
|
||||
{
|
||||
b.Navigation("Childs");
|
||||
b.Navigation("ChildUnits");
|
||||
|
||||
b.Navigation("Parents");
|
||||
b.Navigation("ParentUnits");
|
||||
|
||||
b.Navigation("UnitFields");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user