refactor(bp): flatten BattlePassLevelEntry — drop misnamed RewardData jsonb
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2808
SVSim.Database/Migrations/20260527015510_RefactorBattlePassLevels.Designer.cs
generated
Normal file
2808
SVSim.Database/Migrations/20260527015510_RefactorBattlePassLevels.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,26 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SVSim.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RefactorBattlePassLevels : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(name: "RewardData", table: "BattlePassLevels");
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "RequiredPoint", table: "BattlePassLevels",
|
||||
type: "integer", nullable: false, defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(name: "RequiredPoint", table: "BattlePassLevels");
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "RewardData", table: "BattlePassLevels",
|
||||
type: "jsonb", nullable: false, defaultValue: "{}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -508,9 +508,8 @@ namespace SVSim.Database.Migrations
|
||||
b.Property<int>("Level")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("RewardData")
|
||||
.IsRequired()
|
||||
.HasColumnType("jsonb");
|
||||
b.Property<int>("RequiredPoint")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using SVSim.Database.Common;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
/// <summary>
|
||||
/// One battle pass level (1-100). RewardData jsonb holds the per-level reward blob from
|
||||
/// /load/index data.battle_pass_level_info[level]. Shape varies per level so we preserve verbatim.
|
||||
/// One battle pass level (1..100). Mirrors a single entry in /load/index.battle_pass_level_info.
|
||||
/// Curve is global, immutable per deploy; cached by IBattlePassService.
|
||||
/// </summary>
|
||||
public class BattlePassLevelEntry : BaseEntity<int>
|
||||
{
|
||||
public int Level { get => Id; set => Id = value; }
|
||||
|
||||
[Column(TypeName = "jsonb")]
|
||||
public string RewardData { get; set; } = "{}";
|
||||
public int RequiredPoint { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user