feat(viewer): add FreePackClaims owned collection for daily-free quota tracking
This commit is contained in:
4217
SVSim.Database/Migrations/20260609013234_AddViewerFreePackClaims.Designer.cs
generated
Normal file
4217
SVSim.Database/Migrations/20260609013234_AddViewerFreePackClaims.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SVSim.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddViewerFreePackClaims : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ViewerFreePackClaim",
|
||||
columns: table => new
|
||||
{
|
||||
FreeGachaCampaignId = table.Column<int>(type: "integer", nullable: false),
|
||||
ViewerId = table.Column<long>(type: "bigint", nullable: false),
|
||||
ClaimCount = table.Column<int>(type: "integer", nullable: false),
|
||||
LastClaimedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ViewerFreePackClaim", x => new { x.ViewerId, x.FreeGachaCampaignId });
|
||||
table.ForeignKey(
|
||||
name: "FK_ViewerFreePackClaim_Viewers_ViewerId",
|
||||
column: x => x.ViewerId,
|
||||
principalTable: "Viewers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ViewerFreePackClaim");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3893,6 +3893,28 @@ namespace SVSim.Database.Migrations
|
||||
.HasForeignKey("ViewerId");
|
||||
});
|
||||
|
||||
b.OwnsMany("SVSim.Database.Models.ViewerFreePackClaim", "FreePackClaims", b1 =>
|
||||
{
|
||||
b1.Property<long>("ViewerId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("FreeGachaCampaignId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("ClaimCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<DateTime>("LastClaimedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b1.HasKey("ViewerId", "FreeGachaCampaignId");
|
||||
|
||||
b1.ToTable("ViewerFreePackClaim");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("ViewerId");
|
||||
});
|
||||
|
||||
b.OwnsMany("SVSim.Database.Models.ViewerGachaPointBalance", "GachaPointBalances", b1 =>
|
||||
{
|
||||
b1.Property<long>("ViewerId")
|
||||
@@ -4069,6 +4091,8 @@ namespace SVSim.Database.Migrations
|
||||
b.Navigation("Currency")
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("FreePackClaims");
|
||||
|
||||
b.Navigation("GachaPointBalances");
|
||||
|
||||
b.Navigation("GachaPointReceived");
|
||||
|
||||
Reference in New Issue
Block a user