//
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("20260320221447_AddStartingTileRule")]
partial class AddStartingTileRule
{
///
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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("BoardHeightOverride")
.HasColumnType("integer");
b.Property("BoardWidthOverride")
.HasColumnType("integer");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("DiscardOnMaxHandOverride")
.HasColumnType("boolean");
b.Property("DrawPerTurnOverride")
.HasColumnType("integer");
b.Property("FirstPlayerSkipsDrawOverride")
.HasColumnType("boolean");
b.Property("GameSessionId")
.HasColumnType("uuid");
b.Property("GuestAccountId")
.HasColumnType("uuid");
b.Property("GuestDeckId")
.HasColumnType("uuid");
b.Property("GuestFirstTurnPref")
.HasColumnType("text");
b.Property("GuestReady")
.HasColumnType("boolean");
b.Property("HandSizeCapOverride")
.HasColumnType("integer");
b.Property("HostAccountId")
.HasColumnType("uuid");
b.Property("HostDeckId")
.HasColumnType("uuid");
b.Property("HostFirstTurnPref")
.HasColumnType("text");
b.Property("HostReady")
.HasColumnType("boolean");
b.Property("MaxArchTier1Override")
.HasColumnType("integer");
b.Property("MaxDeckSizeOverride")
.HasColumnType("integer");
b.Property("MaxPlayers")
.HasColumnType("integer");
b.Property("MinDeckSizeOverride")
.HasColumnType("integer");
b.Property("MpBuffOverride")
.HasColumnType("integer");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("OpeningHandSizeOverride")
.HasColumnType("integer");
b.Property("Password")
.HasColumnType("text");
b.Property("SpAccumulationPerTurnOverride")
.HasColumnType("integer");
b.Property("SpCapOverride")
.HasColumnType("integer");
b.Property("SpHasCapOverride")
.HasColumnType("boolean");
b.Property("Status")
.IsRequired()
.HasColumnType("text");
b.Property("TimeLimitMinutesOverride")
.HasColumnType("integer");
b.Property("TurnLimitOverride")
.HasColumnType("integer");
b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("ActionType")
.IsRequired()
.HasColumnType("text");
b.Property("ActorAccountId")
.HasColumnType("uuid");
b.Property("GameSessionId")
.HasColumnType("uuid");
b.Property("OccurredAt")
.HasColumnType("timestamp with time zone");
b.Property("PayloadJson")
.HasColumnType("jsonb")
.HasColumnName("payload");
b.Property("ResultJson")
.HasColumnType("jsonb")
.HasColumnName("result");
b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("BoardHeight")
.HasColumnType("integer");
b.Property("BoardWidth")
.HasColumnType("integer");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("DiscardOnMaxHand")
.HasColumnType("boolean");
b.Property("DrawPerTurn")
.HasColumnType("integer");
b.Property("FirstPlayerSkipsDraw")
.HasColumnType("boolean");
b.Property("HandSizeCap")
.HasColumnType("integer");
b.Property("IsCustomDefault")
.HasColumnType("boolean");
b.Property("IsRankedDefault")
.HasColumnType("boolean");
b.Property("LoserOpReward")
.HasColumnType("integer");
b.Property("MaxArchTier1")
.HasColumnType("integer");
b.Property("MaxDeckSize")
.HasColumnType("integer");
b.Property("MinDeckSize")
.HasColumnType("integer");
b.Property("MpBuff")
.HasColumnType("integer");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("OpeningHandSize")
.HasColumnType("integer");
b.Property("RankDiffOpMultiplierPct")
.HasColumnType("integer");
b.Property("SpAccumulationPerTurn")
.HasColumnType("integer");
b.Property("SpCap")
.HasColumnType("integer");
b.Property("SpHasCap")
.HasColumnType("boolean");
b.Property("TimeLimitMinutes")
.HasColumnType("integer");
b.Property("TurnLimit")
.HasColumnType("integer");
b.Property("TurnTimerSeconds")
.HasColumnType("integer");
b.Property("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("EndedAt")
.HasColumnType("timestamp with time zone");
b.Property("LastActionAt")
.HasColumnType("timestamp with time zone");
b.Property("PlayerOneAccountId")
.HasColumnType("uuid");
b.Property("PlayerOneDeckId")
.HasColumnType("uuid");
b.Property("PlayerOneReady")
.HasColumnType("boolean");
b.Property("PlayerTwoAccountId")
.HasColumnType("uuid");
b.Property("PlayerTwoDeckId")
.HasColumnType("uuid");
b.Property("PlayerTwoReady")
.HasColumnType("boolean");
b.Property("RuleSnapshotJson")
.HasColumnType("jsonb")
.HasColumnName("rule_snapshot");
b.Property("StartedAt")
.HasColumnType("timestamp with time zone");
b.Property("StateJson")
.HasColumnType("jsonb")
.HasColumnName("state");
b.Property("Status")
.IsRequired()
.HasColumnType("text");
b.Property("WinCondition")
.HasColumnType("text");
b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("OwnerAccountId")
.HasColumnType("uuid");
b.Property("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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AccountId")
.HasColumnType("uuid");
b.Property("DeckId")
.HasColumnType("uuid");
b.Property("JoinedAt")
.HasColumnType("timestamp with time zone");
b.Property("MatchedGameSessionId")
.HasColumnType("uuid");
b.Property("RankScore")
.HasColumnType("integer");
b.Property("ResolvedAt")
.HasColumnType("timestamp with time zone");
b.Property("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
}
}
}