Revert "Unify ChapterRating with Rating"

This wasn't working out, there is still some duplicate code. But not
that much, and from the API, there is no different. Hooray!
This commit is contained in:
Amelia 2025-04-28 17:11:39 +02:00
parent 052b3f9fe4
commit 184cf46533
No known key found for this signature in database
GPG key ID: D6D0ECE365407EAA
21 changed files with 389 additions and 87 deletions

View file

@ -195,6 +195,41 @@ namespace API.Data.Migrations
b.ToTable("AppUserBookmark");
});
modelBuilder.Entity("API.Entities.AppUserChapterRating", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("AppUserId")
.HasColumnType("INTEGER");
b.Property<int>("ChapterId")
.HasColumnType("INTEGER");
b.Property<bool>("HasBeenRated")
.HasColumnType("INTEGER");
b.Property<float>("Rating")
.HasColumnType("REAL");
b.Property<string>("Review")
.HasColumnType("TEXT");
b.Property<int>("SeriesId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("AppUserId");
b.HasIndex("ChapterId");
b.HasIndex("SeriesId");
b.ToTable("AppUserChapterRating");
});
modelBuilder.Entity("API.Entities.AppUserCollection", b =>
{
b.Property<int>("Id")
@ -550,9 +585,6 @@ namespace API.Data.Migrations
b.Property<int>("AppUserId")
.HasColumnType("INTEGER");
b.Property<int?>("ChapterId")
.HasColumnType("INTEGER");
b.Property<bool>("HasBeenRated")
.HasColumnType("INTEGER");
@ -572,8 +604,6 @@ namespace API.Data.Migrations
b.HasIndex("AppUserId");
b.HasIndex("ChapterId");
b.HasIndex("SeriesId");
b.ToTable("AppUserRating");
@ -2702,6 +2732,33 @@ namespace API.Data.Migrations
b.Navigation("AppUser");
});
modelBuilder.Entity("API.Entities.AppUserChapterRating", b =>
{
b.HasOne("API.Entities.AppUser", "AppUser")
.WithMany("ChapterRatings")
.HasForeignKey("AppUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("API.Entities.Chapter", "Chapter")
.WithMany("Ratings")
.HasForeignKey("ChapterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("API.Entities.Series", "Series")
.WithMany()
.HasForeignKey("SeriesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AppUser");
b.Navigation("Chapter");
b.Navigation("Series");
});
modelBuilder.Entity("API.Entities.AppUserCollection", b =>
{
b.HasOne("API.Entities.AppUser", "AppUser")
@ -2808,10 +2865,6 @@ namespace API.Data.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("API.Entities.Chapter", "Chapter")
.WithMany("Ratings")
.HasForeignKey("ChapterId");
b.HasOne("API.Entities.Series", "Series")
.WithMany("Ratings")
.HasForeignKey("SeriesId")
@ -2820,8 +2873,6 @@ namespace API.Data.Migrations
b.Navigation("AppUser");
b.Navigation("Chapter");
b.Navigation("Series");
});
@ -3446,6 +3497,8 @@ namespace API.Data.Migrations
{
b.Navigation("Bookmarks");
b.Navigation("ChapterRatings");
b.Navigation("Collections");
b.Navigation("DashboardStreams");