- Extend CustomLobby with 12 new rule override columns (Password, HandSizeCap, DiscardOnMaxHand, MaxDeckSize, MinDeckSize, MaxArchTier1, TurnTimerSeconds, TimeLimitMinutes, TurnLimit, MpBuff, BoardWidth/Height) - Extend GameRuleSet with matching non-nullable rule fields (same set) - Extend GameRules record with 9 new rule fields (all default to 0/false) - Add LobbyPreset entity (owner-scoped named rule presets) - Register LobbyPreset in GameDbContext with index on OwnerAccountId - Migration: AddCustomGameExtensions (applied to pg-forge-01) - Add custom-game-system-plan.md with full 8-phase architecture plan and deferred features tracking list - Also includes: AbilityBuilder ValueExpr dropdowns + help panel, Affinity enum/system fixes (from prior sessions) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
403 lines
14 KiB
C#
403 lines
14 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using SOR.Database.Contexts;
|
|
|
|
#nullable disable
|
|
|
|
namespace SOR.Database.Migrations.Game
|
|
{
|
|
[DbContext(typeof(GameDbContext))]
|
|
[Migration("20260319024116_AddCustomGameExtensions")]
|
|
partial class AddCustomGameExtensions
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasDefaultSchema("game")
|
|
.HasAnnotation("ProductVersion", "8.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.CustomLobby", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int?>("BoardHeightOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("BoardWidthOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool?>("DiscardOnMaxHandOverride")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int?>("DrawPerTurnOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool?>("FirstPlayerSkipsDrawOverride")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<Guid?>("GameSessionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("GuestAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("GuestDeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int?>("HandSizeCapOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid>("HostAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("HostDeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int?>("MaxArchTier1Override")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("MaxDeckSizeOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("MinDeckSizeOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("MpBuffOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("OpeningHandSizeOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Password")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("SpAccumulationPerTurnOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("SpCapOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool?>("SpHasCapOverride")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("TimeLimitMinutesOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("TurnLimitOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("TurnTimerSecondsOverride")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("HostAccountId");
|
|
|
|
b.HasIndex("Status", "CreatedAt");
|
|
|
|
b.ToTable("custom_lobbies", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameActionLog", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("ActionType")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("ActorAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("GameSessionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("OccurredAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("PayloadJson")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("payload");
|
|
|
|
b.Property<string>("ResultJson")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("result");
|
|
|
|
b.Property<int>("SequenceNumber")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ActorAccountId");
|
|
|
|
b.HasIndex("GameSessionId", "SequenceNumber")
|
|
.IsUnique();
|
|
|
|
b.ToTable("action_logs", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameRuleSet", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("BoardHeight")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("BoardWidth")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("DiscardOnMaxHand")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("DrawPerTurn")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("FirstPlayerSkipsDraw")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("HandSizeCap")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("IsCustomDefault")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsRankedDefault")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("LoserOpReward")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MaxArchTier1")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MaxDeckSize")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MinDeckSize")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("MpBuff")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("OpeningHandSize")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("RankDiffOpMultiplierPct")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("SpAccumulationPerTurn")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("SpCap")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("SpHasCap")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("TimeLimitMinutes")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("TurnLimit")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("TurnTimerSeconds")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("WinnerOpReward")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("IsCustomDefault");
|
|
|
|
b.HasIndex("IsRankedDefault");
|
|
|
|
b.ToTable("game_rule_sets", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameSession", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTimeOffset?>("EndedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTimeOffset?>("LastActionAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("PlayerOneAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("PlayerOneDeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("PlayerOneReady")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<Guid>("PlayerTwoAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("PlayerTwoDeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("PlayerTwoReady")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("RuleSnapshotJson")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("rule_snapshot");
|
|
|
|
b.Property<DateTimeOffset?>("StartedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("StateJson")
|
|
.HasColumnType("jsonb")
|
|
.HasColumnName("state");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("WinCondition")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid?>("WinnerAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PlayerOneAccountId");
|
|
|
|
b.HasIndex("PlayerTwoAccountId");
|
|
|
|
b.HasIndex("Status", "CreatedAt");
|
|
|
|
b.ToTable("game_sessions", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.LobbyPreset", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<Guid>("OwnerAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("RulesJson")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OwnerAccountId");
|
|
|
|
b.ToTable("lobby_presets", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.MatchmakingEntry", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("DeckId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("JoinedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid?>("MatchedGameSessionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("RankScore")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset?>("ResolvedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountId", "Status");
|
|
|
|
b.HasIndex("Status", "RankScore");
|
|
|
|
b.ToTable("matchmaking_entries", "game");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameActionLog", b =>
|
|
{
|
|
b.HasOne("SOR.Database.Entities.Game.GameSession", "Session")
|
|
.WithMany("ActionLog")
|
|
.HasForeignKey("GameSessionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Session");
|
|
});
|
|
|
|
modelBuilder.Entity("SOR.Database.Entities.Game.GameSession", b =>
|
|
{
|
|
b.Navigation("ActionLog");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|