feat(dal): Созданы таблицы JobGroupTypes+UnitsInTemplates, обновлен ключ уникального индекса шаблонов

This commit is contained in:
Mikhail Kuznetsov
2025-11-14 14:48:56 +10:00
parent 334595e81c
commit 48c8741395
19 changed files with 12199 additions and 16 deletions

View File

@@ -1557,6 +1557,9 @@ namespace PARR.DAL.Migrations
b.Property<Guid>("GroupId")
.HasColumnType("uuid");
b.Property<bool?>("IsParentRelationships")
.HasColumnType("boolean");
b.Property<int?>("MaxValueRelationships")
.HasColumnType("integer");
@@ -1582,9 +1585,6 @@ namespace PARR.DAL.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<bool?>("isParentRelationships")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("GroupId");
@@ -1660,6 +1660,9 @@ namespace PARR.DAL.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("GroupTypeId")
.HasColumnType("uuid");
b.Property<bool>("IsAgent")
.HasColumnType("boolean");
@@ -1686,12 +1689,61 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.HasIndex("GroupTypeId");
b.ToTable("Groups", "job", t =>
{
t.HasComment("Таблица описания групп работ, для реализации зонтиков");
});
});
modelBuilder.Entity("PARR.DAL.Models.Job.JobGroupType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("Code")
.HasColumnType("integer");
b.Property<DateTimeOffset>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("GroupTypes", "job", t =>
{
t.HasComment("Таблица типов групп работ");
});
b.HasData(
new
{
Id = new Guid("4fa62e79-86bb-47c2-be1a-72a716a170fa"),
Code = 0,
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Name = "Simple"
},
new
{
Id = new Guid("6ec58b1a-5c40-47b9-b036-4fa490e8d503"),
Code = 1,
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Name = "Umbrella"
},
new
{
Id = new Guid("318625e5-f833-436a-99df-2a382a1e71c7"),
Code = 2,
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
Name = "Group"
});
});
modelBuilder.Entity("PARR.DAL.Models.Job.JobRelationshipFilter", b =>
{
b.Property<Guid>("UnitFilterId")
@@ -2619,6 +2671,9 @@ namespace PARR.DAL.Migrations
b.Property<DateTimeOffset?>("DateModified")
.HasColumnType("timestamp with time zone");
b.Property<int?>("Index")
.HasColumnType("integer");
b.Property<string>("InitiatorComment")
.HasColumnType("text");
@@ -2634,6 +2689,9 @@ namespace PARR.DAL.Migrations
b.Property<bool>("IsActiveTemplate")
.HasColumnType("boolean");
b.Property<bool>("IsUnused")
.HasColumnType("boolean");
b.Property<Guid>("JobId")
.HasColumnType("uuid");
@@ -2657,11 +2715,11 @@ namespace PARR.DAL.Migrations
b.HasIndex("JobId");
b.HasIndex("Name")
.IsUnique();
b.HasIndex("UnitId");
b.HasIndex("Name", "Index")
.IsUnique();
b.ToTable("Templates");
});
@@ -2925,6 +2983,27 @@ namespace PARR.DAL.Migrations
});
});
modelBuilder.Entity("PARR.DAL.Models.UnitsInTemplate", b =>
{
b.Property<Guid>("TemplateId")
.HasColumnType("uuid");
b.Property<Guid>("UnitId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("DateCreated")
.HasColumnType("timestamp with time zone");
b.HasKey("TemplateId", "UnitId");
b.HasIndex("UnitId");
b.ToTable("UnitsInTemplates", "job", t =>
{
t.HasComment("Таблица связи ЭК в шаблонах");
});
});
modelBuilder.Entity("PARR.DAL.Models.User", b =>
{
b.Property<Guid>("Id")
@@ -3280,6 +3359,17 @@ namespace PARR.DAL.Migrations
b.Navigation("UnitFilter");
});
modelBuilder.Entity("PARR.DAL.Models.Job.JobGroup", b =>
{
b.HasOne("PARR.DAL.Models.Job.JobGroupType", "GroupType")
.WithMany("JobGroups")
.HasForeignKey("GroupTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("GroupType");
});
modelBuilder.Entity("PARR.DAL.Models.Job.JobRelationshipFilter", b =>
{
b.HasOne("PARR.DAL.Models.Unit.UnitField", "UnitField")
@@ -3572,6 +3662,25 @@ namespace PARR.DAL.Migrations
b.Navigation("Value");
});
modelBuilder.Entity("PARR.DAL.Models.UnitsInTemplate", b =>
{
b.HasOne("PARR.DAL.Models.Template", "Template")
.WithMany("UnitsInTemplate")
.HasForeignKey("TemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.Unit.Unit", "Unit")
.WithMany("TemplatesInUnit")
.HasForeignKey("UnitId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Template");
b.Navigation("Unit");
});
modelBuilder.Entity("PARR.DAL.Models.UsersInRole", b =>
{
b.HasOne("PARR.DAL.Models.Role", "Role")
@@ -3695,6 +3804,11 @@ namespace PARR.DAL.Migrations
b.Navigation("Jobs");
});
modelBuilder.Entity("PARR.DAL.Models.Job.JobGroupType", b =>
{
b.Navigation("JobGroups");
});
modelBuilder.Entity("PARR.DAL.Models.Job.JobUnitFilter", b =>
{
b.Navigation("FieldFilters");
@@ -3779,6 +3893,8 @@ namespace PARR.DAL.Migrations
b.Navigation("RobotConfigurations");
b.Navigation("TemplateHistories");
b.Navigation("UnitsInTemplate");
});
modelBuilder.Entity("PARR.DAL.Models.Tnk", b =>
@@ -3794,6 +3910,8 @@ namespace PARR.DAL.Migrations
b.Navigation("Templates");
b.Navigation("TemplatesInUnit");
b.Navigation("UnitFields");
b.Navigation("UnitValues");