feat(aihitRelationshipsSyncer): полностью переписан класс+добавлены сообщения дл\ отладки
This commit is contained in:
@@ -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 =>
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user