Add cascading to UserGroup2LanguageDto.cs

This commit is contained in:
Zeegaan
2022-06-23 15:43:27 +02:00
parent ac5f2270ac
commit 551eeda625
2 changed files with 6 additions and 5 deletions

View File

@@ -82,8 +82,8 @@ public class DatabaseSchemaCreator
typeof(LogViewerQueryDto),
typeof(ContentVersionCleanupPolicyDto),
typeof(UserGroup2NodeDto),
typeof(CreatedPackageSchemaDto),
typeof(UserGroup2LanguageDto)
typeof(CreatedPackageSchemaDto),
typeof(UserGroup2LanguageDto)
};
private readonly IUmbracoDatabase _database;

View File

@@ -1,4 +1,5 @@
using NPoco;
using System.Data;
using NPoco;
using Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations;
namespace Umbraco.Cms.Infrastructure.Persistence.Dtos;
@@ -11,10 +12,10 @@ public class UserGroup2LanguageDto
[Column("userGroupId")]
[PrimaryKeyColumn(AutoIncrement = false, Name = "PK_userGroup2language", OnColumns = "userGroupId, languageId")]
[ForeignKey(typeof(UserGroupDto))]
[ForeignKey(typeof(UserGroupDto), OnDelete = Rule.Cascade)]
public int UserGroupId { get; set; }
[Column("languageId")]
[ForeignKey(typeof(LanguageDto))]
[ForeignKey(typeof(LanguageDto), OnDelete = Rule.Cascade)]
public int LanguageId { get; set; }
}