diff --git a/API/Schema/PgsqlContext.cs b/API/Schema/PgsqlContext.cs index b3995bb..c7cbbb9 100644 --- a/API/Schema/PgsqlContext.cs +++ b/API/Schema/PgsqlContext.cs @@ -87,6 +87,15 @@ public class PgsqlContext(DbContextOptions options) : DbContext(op modelBuilder.Entity() .Navigation(j => j.Manga) .AutoInclude(); + modelBuilder.Entity() + .HasOne(j => j.Manga) + .WithMany() + .HasForeignKey(j => j.MangaId) + .IsRequired() + .OnDelete(DeleteBehavior.Cascade); + modelBuilder.Entity() + .Navigation(j => j.Manga) + .AutoInclude(); //Job has possible ParentJob modelBuilder.Entity()