feat(inventory): migration for viewer_acquire_history
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
4291
SVSim.Database/Migrations/20260609182346_AddViewerAcquireHistory.Designer.cs
generated
Normal file
4291
SVSim.Database/Migrations/20260609182346_AddViewerAcquireHistory.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2645,6 +2645,44 @@ namespace SVSim.Database.Migrations
|
|||||||
b.ToTable("ViewerAchievements");
|
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 =>
|
modelBuilder.Entity("SVSim.Database.Models.ViewerArenaTwoPickRun", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<long>("Id")
|
||||||
@@ -4146,6 +4184,15 @@ namespace SVSim.Database.Migrations
|
|||||||
.IsRequired();
|
.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 =>
|
modelBuilder.Entity("SVSim.Database.Models.ViewerEventCounter", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("SVSim.Database.Models.Viewer", null)
|
b.HasOne("SVSim.Database.Models.Viewer", null)
|
||||||
|
|||||||
Reference in New Issue
Block a user