feat(aihitRelationshipsSyncer): полностью переписан класс+добавлены сообщения дл\ отладки

This commit is contained in:
Mikhail Kuznetsov
2025-10-31 17:35:54 +10:00
parent a3e12816c8
commit e716d9649d
11 changed files with 354 additions and 236 deletions

View File

@@ -108,6 +108,17 @@ namespace PARR.DAL.Context
var dateCreated = new DateTimeOffset(2023, 05, 01, 0, 0, 0, new TimeSpan(0));
#region Unit
//Добавляем ограничение по имени ЭК. нельзя писать прописными!!!
modelBuilder.Entity<Unit>(f =>
{
f.ToTable(t => t.HasCheckConstraint(
"CK_Units_Name_Upper",
"\"Name\" = UPPER(\"Name\") AND \"Name\" IS NOT NULL AND LENGTH(\"Name\")>0"
));
});
#endregion
#region ApplicationType
modelBuilder.Entity<ApplicationType>(f =>
{

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
/// <inheritdoc />
public partial class AddUnitNameUppercaseCheck : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddCheckConstraint(
name: "CK_Units_Name_Upper",
schema: "unit",
table: "Units",
sql: "\"Name\" = UPPER(\"Name\") AND \"Name\" IS NOT NULL AND LENGTH(\"Name\")>0");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropCheckConstraint(
name: "CK_Units_Name_Upper",
schema: "unit",
table: "Units");
}
}
}

View File

@@ -2768,6 +2768,8 @@ namespace PARR.DAL.Migrations
b.ToTable("Units", "unit", t =>
{
t.HasComment("Таблица с ЭК");
t.HasCheckConstraint("CK_Units_Name_Upper", "\"Name\" = UPPER(\"Name\") AND \"Name\" IS NOT NULL AND LENGTH(\"Name\")>0");
});
});