Files
SVSimServer/SVSim.Database/Migrations/20260613193716_AddViewerLoginBonusState.cs
gamer147 107ee106a3 feat(viewer): add LastLoginBonusClaimedAt + LoginBonusStreak columns
Drops the unused daily_login_bonuses table in the same migration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 15:42:40 -04:00

59 lines
2.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class AddViewerLoginBonusState : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DailyLoginBonuses");
migrationBuilder.AddColumn<DateTime>(
name: "LastLoginBonusClaimedAt",
table: "Viewers",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "LoginBonusStreak",
table: "Viewers",
type: "integer",
nullable: false,
defaultValue: 0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "LastLoginBonusClaimedAt",
table: "Viewers");
migrationBuilder.DropColumn(
name: "LoginBonusStreak",
table: "Viewers");
migrationBuilder.CreateTable(
name: "DailyLoginBonuses",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
BonusData = table.Column<string>(type: "jsonb", nullable: false),
BonusId = table.Column<int>(type: "integer", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DailyLoginBonuses", x => x.Id);
});
}
}
}