feat(bp): repositories + identity generation for runtime-inserted tables
Add ValueGeneratedOnAdd to ViewerBattlePassProgress.Id and ViewerBattlePassClaims.Id so Postgres generates IDENTITY values at runtime. Regenerate AddBattlePass migration in-place to include the IdentityByDefaultColumn annotations. Add IBattlePassRepository / BattlePassRepository (season lookup + level-curve cache) and IViewerBattlePassRepository / ViewerBattlePassRepository (get-or-create progress, claim reads/writes). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1905,8 +1905,11 @@ namespace SVSim.Database.Migrations
|
||||
modelBuilder.Entity("SVSim.Database.Models.ViewerBattlePassClaimEntry", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<DateTimeOffset>("ClaimedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
@@ -1941,8 +1944,11 @@ namespace SVSim.Database.Migrations
|
||||
modelBuilder.Entity("SVSim.Database.Models.ViewerBattlePassProgressEntry", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<int>("CurrentPoint")
|
||||
.HasColumnType("integer");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user