feat(aihitRelationshipsSyncer): Реализована логика синхронизации связей между Unit+CI/CD
This commit is contained in:
3534
PARR.DAL/Migrations/20250522042529_tblUnitInUnits.Designer.cs
generated
Normal file
3534
PARR.DAL/Migrations/20250522042529_tblUnitInUnits.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
59
PARR.DAL/Migrations/20250522042529_tblUnitInUnits.cs
Normal file
59
PARR.DAL/Migrations/20250522042529_tblUnitInUnits.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblUnitInUnits : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UnitInUnits",
|
||||
schema: "unit",
|
||||
columns: table => new
|
||||
{
|
||||
ParentUnitId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChildUnitId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
DateSynced = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UnitInUnits", x => new { x.ParentUnitId, x.ChildUnitId });
|
||||
table.ForeignKey(
|
||||
name: "FK_UnitInUnits_Units_ChildUnitId",
|
||||
column: x => x.ChildUnitId,
|
||||
principalSchema: "unit",
|
||||
principalTable: "Units",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_UnitInUnits_Units_ParentUnitId",
|
||||
column: x => x.ParentUnitId,
|
||||
principalSchema: "unit",
|
||||
principalTable: "Units",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Таблица связей иерархии между ЭК");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UnitInUnits_ChildUnitId",
|
||||
schema: "unit",
|
||||
table: "UnitInUnits",
|
||||
column: "ChildUnitId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "UnitInUnits",
|
||||
schema: "unit");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2651,6 +2651,30 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInUnit", b =>
|
||||
{
|
||||
b.Property<Guid>("ParentUnitId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("ChildUnitId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTimeOffset?>("DateSynced")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.HasKey("ParentUnitId", "ChildUnitId");
|
||||
|
||||
b.HasIndex("ChildUnitId");
|
||||
|
||||
b.ToTable("UnitInUnits", "unit", t =>
|
||||
{
|
||||
t.HasComment("Таблица связей иерархии между ЭК");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInValue", b =>
|
||||
{
|
||||
b.Property<Guid>("UnitId")
|
||||
@@ -3213,6 +3237,25 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("UnitField");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInUnit", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "Child")
|
||||
.WithMany("Parents")
|
||||
.HasForeignKey("ChildUnitId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.Unit.Unit", "Parent")
|
||||
.WithMany("Childs")
|
||||
.HasForeignKey("ParentUnitId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Child");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.UnitInValue", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Unit.UnitField", "Field")
|
||||
@@ -3441,6 +3484,10 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Unit.Unit", b =>
|
||||
{
|
||||
b.Navigation("Childs");
|
||||
|
||||
b.Navigation("Parents");
|
||||
|
||||
b.Navigation("UnitFields");
|
||||
|
||||
b.Navigation("UnitValues");
|
||||
|
||||
Reference in New Issue
Block a user