feat(dal, domain): Удалена таблица UnitInFields. Удалены DateModified из таблиц JobFieldFilter, JobUnitFilter
This commit is contained in:
@@ -83,8 +83,6 @@ namespace PARR.DAL.Context
|
|||||||
|
|
||||||
public DbSet<UnitFieldValue> UnitFieldValues { get; set; }
|
public DbSet<UnitFieldValue> UnitFieldValues { get; set; }
|
||||||
|
|
||||||
public DbSet<UnitInField> UnitInFields { get; set; }
|
|
||||||
|
|
||||||
public DbSet<UnitInValue> UnitInValues { get; set; }
|
public DbSet<UnitInValue> UnitInValues { get; set; }
|
||||||
|
|
||||||
public DbSet<UnitFieldInUnitFieldValue> UnitFieldInUnitFieldValues { get; set; }
|
public DbSet<UnitFieldInUnitFieldValue> UnitFieldInUnitFieldValues { get; set; }
|
||||||
|
|||||||
3778
PARR.DAL/Migrations/20260529003718_tblUnitInFieldsRemove.Designer.cs
generated
Normal file
3778
PARR.DAL/Migrations/20260529003718_tblUnitInFieldsRemove.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
58
PARR.DAL/Migrations/20260529003718_tblUnitInFieldsRemove.cs
Normal file
58
PARR.DAL/Migrations/20260529003718_tblUnitInFieldsRemove.cs
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace PARR.DAL.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class tblUnitInFieldsRemove : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "UnitInFields",
|
||||||
|
schema: "unit");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "UnitInFields",
|
||||||
|
schema: "unit",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
UnitId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
FieldId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_UnitInFields", x => new { x.UnitId, x.FieldId });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UnitInFields_Fields_FieldId",
|
||||||
|
column: x => x.FieldId,
|
||||||
|
principalSchema: "unit",
|
||||||
|
principalTable: "Fields",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UnitInFields_Units_UnitId",
|
||||||
|
column: x => x.UnitId,
|
||||||
|
principalSchema: "unit",
|
||||||
|
principalTable: "Units",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
},
|
||||||
|
comment: "Справочник полей ЭК");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_UnitInFields_FieldId",
|
||||||
|
schema: "unit",
|
||||||
|
table: "UnitInFields",
|
||||||
|
column: "FieldId");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3772
PARR.DAL/Migrations/20260529005802_tbkJobsNotMappedDateModified.Designer.cs
generated
Normal file
3772
PARR.DAL/Migrations/20260529005802_tbkJobsNotMappedDateModified.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,43 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace PARR.DAL.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class tbkJobsNotMappedDateModified : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DateModified",
|
||||||
|
schema: "job",
|
||||||
|
table: "UnitFilters");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DateModified",
|
||||||
|
schema: "job",
|
||||||
|
table: "FieldFilters");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<DateTimeOffset>(
|
||||||
|
name: "DateModified",
|
||||||
|
schema: "job",
|
||||||
|
table: "UnitFilters",
|
||||||
|
type: "timestamp with time zone",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<DateTimeOffset>(
|
||||||
|
name: "DateModified",
|
||||||
|
schema: "job",
|
||||||
|
table: "FieldFilters",
|
||||||
|
type: "timestamp with time zone",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -265,9 +265,6 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Property<DateTimeOffset>("DateCreated")
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("FieldId")
|
b.Property<Guid>("FieldId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
@@ -499,9 +496,6 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Property<DateTimeOffset>("DateCreated")
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("JobId")
|
b.Property<Guid>("JobId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
@@ -2882,27 +2876,6 @@ namespace PARR.DAL.Migrations
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInField", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("UnitId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("FieldId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.HasKey("UnitId", "FieldId");
|
|
||||||
|
|
||||||
b.HasIndex("FieldId");
|
|
||||||
|
|
||||||
b.ToTable("UnitInFields", "unit", t =>
|
|
||||||
{
|
|
||||||
t.HasComment("Справочник полей ЭК");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b =>
|
modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("ParentUnitId")
|
b.Property<Guid>("ParentUnitId")
|
||||||
@@ -3493,25 +3466,6 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Navigation("FieldValue");
|
b.Navigation("FieldValue");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInField", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("PARR.Domain.Entities.Unit.UnitField", "UnitField")
|
|
||||||
.WithMany("Units")
|
|
||||||
.HasForeignKey("FieldId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("PARR.Domain.Entities.Unit.Unit", "Unit")
|
|
||||||
.WithMany("UnitFields")
|
|
||||||
.HasForeignKey("UnitId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Unit");
|
|
||||||
|
|
||||||
b.Navigation("UnitField");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b =>
|
modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitInUnit", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("PARR.Domain.Entities.Unit.Unit", "ChildUnit")
|
b.HasOne("PARR.Domain.Entities.Unit.Unit", "ChildUnit")
|
||||||
@@ -3778,8 +3732,6 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.Navigation("TemplatesInUnit");
|
b.Navigation("TemplatesInUnit");
|
||||||
|
|
||||||
b.Navigation("UnitFields");
|
|
||||||
|
|
||||||
b.Navigation("UnitKii");
|
b.Navigation("UnitKii");
|
||||||
|
|
||||||
b.Navigation("UnitValues");
|
b.Navigation("UnitValues");
|
||||||
@@ -3794,8 +3746,6 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Navigation("UnitFieldValues");
|
b.Navigation("UnitFieldValues");
|
||||||
|
|
||||||
b.Navigation("UnitInValues");
|
b.Navigation("UnitInValues");
|
||||||
|
|
||||||
b.Navigation("Units");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldValue", b =>
|
modelBuilder.Entity("PARR.Domain.Entities.Unit.UnitFieldValue", b =>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace PARR.Domain.Entities.Job
|
|||||||
|
|
||||||
public DateTimeOffset DateCreated { get; set; }
|
public DateTimeOffset DateCreated { get; set; }
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
public DateTimeOffset? DateModified { get; set; }
|
public DateTimeOffset? DateModified { get; set; }
|
||||||
|
|
||||||
public Guid UnitFilterId { get; set; }
|
public Guid UnitFilterId { get; set; }
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace PARR.Domain.Entities.Job
|
|||||||
|
|
||||||
public DateTimeOffset DateCreated { get; set; }
|
public DateTimeOffset DateCreated { get; set; }
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
public DateTimeOffset? DateModified { get; set; }
|
public DateTimeOffset? DateModified { get; set; }
|
||||||
|
|
||||||
public required string UnitFilter { get; set; }
|
public required string UnitFilter { get; set; }
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ namespace PARR.Domain.Entities.Unit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICollection<UnitInField> UnitFields { get; set; } = new HashSet<UnitInField>();
|
|
||||||
|
|
||||||
public ICollection<UnitInValue> UnitValues { get; set; } = new HashSet<UnitInValue>();
|
public ICollection<UnitInValue> UnitValues { get; set; } = new HashSet<UnitInValue>();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -51,9 +51,6 @@ namespace PARR.Domain.Entities.Unit
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool? IsMultipleValue { get; set; }
|
public bool? IsMultipleValue { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public ICollection<UnitInField> Units { get; set; } = new HashSet<UnitInField>();
|
|
||||||
|
|
||||||
public ICollection<UnitInValue> UnitInValues { get; set; } = new HashSet<UnitInValue>();
|
public ICollection<UnitInValue> UnitInValues { get; set; } = new HashSet<UnitInValue>();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using PARR.Domain.Constants;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace PARR.Domain.Entities.Unit
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Связь Unit in Field
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
[Table("UnitInFields", Schema = DatabaseSchemas.Unit)]
|
|
||||||
[Comment("Справочник полей ЭК")]
|
|
||||||
[PrimaryKey(nameof(UnitId), nameof(FieldId))]
|
|
||||||
public class UnitInField
|
|
||||||
{
|
|
||||||
public Guid UnitId { get; set; }
|
|
||||||
|
|
||||||
public Guid FieldId { get; set; }
|
|
||||||
|
|
||||||
public DateTimeOffset DateCreated { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
[ForeignKey(nameof(UnitId))]
|
|
||||||
public Unit? Unit { get; set; }
|
|
||||||
|
|
||||||
[ForeignKey(nameof(FieldId))]
|
|
||||||
public UnitField? UnitField { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user