Fix Job has ParentJob -> ParentJob has Job

This commit is contained in:
2025-04-02 01:58:17 +02:00
parent 99a3f2614d
commit 31beeeffae
5 changed files with 857 additions and 12 deletions

View File

@ -50,9 +50,8 @@ public class PgsqlContext(DbContextOptions<PgsqlContext> options) : DbContext(op
.HasValue<RetrieveChaptersJob>(JobType.RetrieveChaptersJob)
.HasValue<UpdateFilesDownloadedJob>(JobType.UpdateFilesDownloadedJob);
modelBuilder.Entity<Job>()
.HasOne<Job>(j => j.ParentJob)
.WithMany()
.HasForeignKey(j => j.ParentJobId)
.HasMany<Job>()
.WithOne(j => j.ParentJob)
.OnDelete(DeleteBehavior.Cascade);
modelBuilder.Entity<Job>()
.HasMany<Job>(j => j.DependsOnJobs)