feat(replay): add ViewerBattleHistory entity + migration
New table backs /replay/info; composite PK (ViewerId, BattleId), index on (ViewerId, CreateTime) for the newest-first list query. 50-row per-viewer retention enforced by BattleHistoryWriter (next commit). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -2843,6 +2843,83 @@ namespace SVSim.Database.Migrations
|
||||
b.ToTable("ViewerArenaTwoPickRuns");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Models.ViewerBattleHistory", b =>
|
||||
{
|
||||
b.Property<long>("ViewerId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("BattleId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("BattleStartTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("BattleType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("DeckFormat")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("IsLimitTurn")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("IsWin")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("OpponentCharaId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("OpponentClassId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("OpponentCountryCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<long>("OpponentDegreeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("OpponentEmblemId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("OpponentName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("OpponentRotationId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("OpponentSubClassId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("SelfCharaId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("SelfClassId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("SelfRotationId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SelfSubClassId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("TwoPickType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("ViewerId", "BattleId");
|
||||
|
||||
b.HasIndex("ViewerId", "CreateTime")
|
||||
.HasDatabaseName("IX_ViewerBattleHistories_ViewerId_CreateTime");
|
||||
|
||||
b.ToTable("ViewerBattleHistories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Models.ViewerBattlePassClaimEntry", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
|
||||
Reference in New Issue
Block a user