Added additional voice work update logic.

This commit is contained in:
2025-10-11 17:28:39 -04:00
parent db0c3349a2
commit 278b6df650
38 changed files with 56745 additions and 64 deletions

View File

@@ -12,7 +12,7 @@ public sealed class VoiceWorkCreatorConfiguration : IEntityTypeConfiguration<Voi
builder.HasKey(x => new { x.VoiceWorkId, x.CreatorId });
builder.HasOne(x => x.VoiceWork)
.WithMany(v => v.VoiceWorkCreators)
.WithMany(v => v.Creators)
.HasForeignKey(x => x.VoiceWorkId)
.OnDelete(DeleteBehavior.Cascade);

View File

@@ -0,0 +1,24 @@
using JSMR.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace JSMR.Infrastructure.Data.Configuration;
public sealed class VoiceWorkSupportedLanguageConfiguration : IEntityTypeConfiguration<VoiceWorkSupportedLanguage>
{
public void Configure(EntityTypeBuilder<VoiceWorkSupportedLanguage> builder)
{
builder.ToTable("voice_work_supported_languages");
builder.HasKey(x => x.VoiceWorkSupportedLanguageId);
builder.Property(x => x.Language).IsRequired().HasMaxLength(10);
builder.HasOne(x => x.VoiceWork)
.WithMany(v => v.SupportedLanguages)
.HasForeignKey(x => x.VoiceWorkId)
.OnDelete(DeleteBehavior.Cascade);
builder.HasIndex(x => new { x.VoiceWorkId, x.Language }).IsUnique();
builder.HasIndex(x => x.VoiceWorkId);
}
}

View File

@@ -12,7 +12,7 @@ public sealed class VoiceWorkTagConfiguration : IEntityTypeConfiguration<VoiceWo
builder.HasKey(x => new { x.VoiceWorkId, x.TagId });
builder.HasOne(x => x.VoiceWork)
.WithMany(v => v.VoiceWorkTags)
.WithMany(v => v.Tags)
.HasForeignKey(x => x.VoiceWorkId)
.OnDelete(DeleteBehavior.Cascade);