feat(dal): создана связь между JobGroup & UnitField. Отключено каскадное удаление для этой связи

This commit is contained in:
Mikhail Trubnikov
2025-12-19 09:31:25 +10:00
parent 5256b434a3
commit cef0e15077
6 changed files with 4011 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using PARR.DAL.Context;
using PARR.DAL.Models.Base;
using PARR.DAL.Models.Unit;
using PARR.DAL.Settings;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -127,6 +128,11 @@ namespace PARR.DAL.Models.Job
/// </summary>
public Guid? GroupingUnitFieldId { get; set; }
/// <summary>
/// Поле по которому группируется (!!!отключено каскадное удаление!!!)
/// </summary>
[ForeignKey(nameof(GroupingUnitFieldId))]
public UnitField? GroupingUnitField { get; set; }
[ForeignKey(nameof(GroupTypeId))]
public JobGroupType? GroupType { get; set; }

View File

@@ -60,5 +60,11 @@ namespace PARR.DAL.Models.Unit
public ICollection<UnitFieldInUnitFieldValue> UnitFieldValues { get; set; } = new HashSet<UnitFieldInUnitFieldValue>();
public ICollection<JobRelationshipFilter> RelationshipFilters { get; set; } = new HashSet<JobRelationshipFilter>();
/// <summary>
/// JobGroup которые группируются по этому полю (!!!отключено каскадное удаление!!!)
/// </summary>
public ICollection<JobGroup> JobGroupWithGrouping { get; set; } = new HashSet<JobGroup>();
}
}