feat(rank): add ViewerRankProgress owned entity + migration

One row per (viewer, format) tracking accumulated Point + MasterPoint.
Unique index on (ViewerId, Format) enforces one row per format per viewer
(mirrors owned-collection precedent per project_owned_collection_unique_index).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-04 10:13:50 -04:00
parent 94ed6734c7
commit 9f97837211
5 changed files with 5184 additions and 0 deletions

View File

@@ -4837,6 +4837,34 @@ namespace SVSim.Database.Migrations
.HasForeignKey("ViewerId");
});
b.OwnsMany("SVSim.Database.Models.ViewerRankProgress", "RankProgress", b1 =>
{
b1.Property<long>("ViewerId")
.HasColumnType("bigint");
b1.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));
b1.Property<int>("Format")
.HasColumnType("integer");
b1.Property<int>("MasterPoint")
.HasColumnType("integer");
b1.Property<int>("Point")
.HasColumnType("integer");
b1.HasKey("ViewerId", "Id");
b1.ToTable("ViewerRankProgress");
b1.WithOwner()
.HasForeignKey("ViewerId");
});
b.Navigation("BuildDeckPurchases");
b.Navigation("Cards");
@@ -4868,6 +4896,8 @@ namespace SVSim.Database.Migrations
b.Navigation("PackStarterClasses");
b.Navigation("RankProgress");
b.Navigation("SocialAccountConnections");
});