feat(viewer): migration for mypage bg selection

Adds AddViewerMyPageBgSelection migration: two int scalars on Viewers
(MyPageBgId, MyPageBgSelectType default 0) and ViewerMyPageBgRotation
owned table with composite PK (ViewerId, Slot), FK cascade to Viewers.
Also adds ToTable(ViewerMyPageBgRotation) to OwnsMany config so EF
uses the correct table name instead of defaulting to the entity class.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-09 16:33:12 -04:00
parent ee808a60a2
commit 51ef460d39
4 changed files with 4408 additions and 0 deletions

View File

@@ -174,6 +174,7 @@ public class SVSimDbContext : DbContext
});
modelBuilder.Entity<Viewer>().OwnsMany(v => v.MyPageBgRotation, b =>
{
b.ToTable("ViewerMyPageBgRotation");
b.WithOwner().HasForeignKey("ViewerId");
b.HasKey("ViewerId", nameof(MyPageBgRotationEntry.Slot));
b.Property(x => x.Slot).ValueGeneratedNever();