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:
@@ -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");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user