feat(db): add gacha-point balance + received tables

This commit is contained in:
gamer147
2026-05-28 22:50:22 -04:00
parent 261ce67cee
commit 21adc68e28
7 changed files with 3968 additions and 0 deletions

View File

@@ -167,6 +167,16 @@ public class SVSimDbContext : DbContext
b.HasIndex("ViewerId", "ProductId").IsUnique();
});
modelBuilder.Entity<Viewer>().OwnsMany(v => v.GachaPointBalances, b =>
{
b.HasIndex("ViewerId", "PackId").IsUnique();
});
modelBuilder.Entity<Viewer>().OwnsMany(v => v.GachaPointReceived, b =>
{
b.HasIndex("ViewerId", "PackId", "CardId").IsUnique();
});
// A given social account links to exactly one viewer — two viewers cannot share the same
// Steam (or Facebook, etc.) account. This is the dedup backstop the auth handler's find-
// or-link path (SteamSessionAuthenticationHandler) relies on: two concurrent first-Steam-