feat(inventory): migration for viewer_acquire_history

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-09 14:24:36 -04:00
parent 51595b0c7d
commit f394529c8c
3 changed files with 4391 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class AddViewerAcquireHistory : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ViewerAcquireHistory",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ViewerId = table.Column<long>(type: "bigint", nullable: false),
RewardType = table.Column<int>(type: "integer", nullable: false),
RewardDetailId = table.Column<long>(type: "bigint", nullable: false),
RewardCount = table.Column<int>(type: "integer", nullable: false),
AcquireType = table.Column<int>(type: "integer", nullable: false),
Message = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
AcquireTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ViewerAcquireHistory", x => x.Id);
table.ForeignKey(
name: "FK_ViewerAcquireHistory_Viewers_ViewerId",
column: x => x.ViewerId,
principalTable: "Viewers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_ViewerAcquireHistory_ViewerId_AcquireTime_Id",
table: "ViewerAcquireHistory",
columns: new[] { "ViewerId", "AcquireTime", "Id" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ViewerAcquireHistory");
}
}
}

View File

@@ -2645,6 +2645,44 @@ namespace SVSim.Database.Migrations
b.ToTable("ViewerAchievements");
});
modelBuilder.Entity("SVSim.Database.Models.ViewerAcquireHistoryEntry", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("AcquireTime")
.HasColumnType("timestamp with time zone");
b.Property<int>("AcquireType")
.HasColumnType("integer");
b.Property<string>("Message")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<int>("RewardCount")
.HasColumnType("integer");
b.Property<long>("RewardDetailId")
.HasColumnType("bigint");
b.Property<int>("RewardType")
.HasColumnType("integer");
b.Property<long>("ViewerId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("ViewerId", "AcquireTime", "Id");
b.ToTable("ViewerAcquireHistory");
});
modelBuilder.Entity("SVSim.Database.Models.ViewerArenaTwoPickRun", b =>
{
b.Property<long>("Id")
@@ -4146,6 +4184,15 @@ namespace SVSim.Database.Migrations
.IsRequired();
});
modelBuilder.Entity("SVSim.Database.Models.ViewerAcquireHistoryEntry", b =>
{
b.HasOne("SVSim.Database.Models.Viewer", null)
.WithMany()
.HasForeignKey("ViewerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("SVSim.Database.Models.ViewerEventCounter", b =>
{
b.HasOne("SVSim.Database.Models.Viewer", null)