Phase 1: Custom game system — DB schema extensions
- 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>
This commit is contained in:
@@ -28,6 +28,7 @@ public sealed class GameDbContext : DbContext
|
||||
public DbSet<GameActionLog> ActionLogs => Set<GameActionLog>();
|
||||
public DbSet<GameRuleSet> GameRuleSets => Set<GameRuleSet>();
|
||||
public DbSet<CustomLobby> CustomLobbies => Set<CustomLobby>();
|
||||
public DbSet<LobbyPreset> LobbyPresets => Set<LobbyPreset>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
@@ -86,5 +87,12 @@ public sealed class GameDbContext : DbContext
|
||||
e.HasIndex(l => new { l.Status, l.CreatedAt });
|
||||
e.HasIndex(l => l.HostAccountId);
|
||||
});
|
||||
|
||||
builder.Entity<LobbyPreset>(e =>
|
||||
{
|
||||
e.ToTable("lobby_presets");
|
||||
e.HasKey(p => p.Id);
|
||||
e.HasIndex(p => p.OwnerAccountId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,44 @@ public sealed class CustomLobby
|
||||
public bool? SpHasCapOverride { get; set; }
|
||||
public int? SpCapOverride { get; set; }
|
||||
|
||||
// ── Extended rule overrides ───────────────────────────────────────────────
|
||||
|
||||
/// <summary>Optional password to join this lobby. Null = no password required.</summary>
|
||||
public string? Password { get; set; }
|
||||
|
||||
/// <summary>Max cards in hand. 0 = no cap.</summary>
|
||||
public int? HandSizeCapOverride { get; set; }
|
||||
|
||||
/// <summary>If true, excess cards are auto-discarded when hand is at cap. If false, draw is blocked.</summary>
|
||||
public bool? DiscardOnMaxHandOverride { get; set; }
|
||||
|
||||
/// <summary>Maximum deck size. 0 = no limit.</summary>
|
||||
public int? MaxDeckSizeOverride { get; set; }
|
||||
|
||||
/// <summary>Minimum deck size. 0 = no limit.</summary>
|
||||
public int? MinDeckSizeOverride { get; set; }
|
||||
|
||||
/// <summary>Max copies of a Tier-1 Arch card allowed per deck. 0 = no limit.</summary>
|
||||
public int? MaxArchTier1Override { get; set; }
|
||||
|
||||
/// <summary>Seconds per turn before auto-end. 0 = no timer.</summary>
|
||||
public int? TurnTimerSecondsOverride { get; set; }
|
||||
|
||||
/// <summary>Total game time limit in minutes. 0 = no limit.</summary>
|
||||
public int? TimeLimitMinutesOverride { get; set; }
|
||||
|
||||
/// <summary>Maximum number of turns before game ends. 0 = no limit.</summary>
|
||||
public int? TurnLimitOverride { get; set; }
|
||||
|
||||
/// <summary>Flat MP bonus added to each unit at the start of its owner's turn. 0 = no buff.</summary>
|
||||
public int? MpBuffOverride { get; set; }
|
||||
|
||||
/// <summary>Board width override in columns.</summary>
|
||||
public int? BoardWidthOverride { get; set; }
|
||||
|
||||
/// <summary>Board height override in rows.</summary>
|
||||
public int? BoardHeightOverride { get; set; }
|
||||
|
||||
// ── Timestamps ───────────────────────────────────────────────────────────
|
||||
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
|
||||
@@ -49,6 +49,33 @@ public sealed class GameRuleSet
|
||||
/// <summary>Battlefield height (rows). Default: 8.</summary>
|
||||
public int BoardHeight { get; set; } = 8;
|
||||
|
||||
/// <summary>Max cards in hand. 0 = no cap.</summary>
|
||||
public int HandSizeCap { get; set; } = 0;
|
||||
|
||||
/// <summary>If true, excess cards are auto-discarded when hand is at cap. If false, draw is blocked.</summary>
|
||||
public bool DiscardOnMaxHand { get; set; } = false;
|
||||
|
||||
/// <summary>Maximum deck size. 0 = no limit.</summary>
|
||||
public int MaxDeckSize { get; set; } = 0;
|
||||
|
||||
/// <summary>Minimum deck size. 0 = no limit.</summary>
|
||||
public int MinDeckSize { get; set; } = 0;
|
||||
|
||||
/// <summary>Max copies of a Tier-1 Arch card allowed per deck. 0 = no limit.</summary>
|
||||
public int MaxArchTier1 { get; set; } = 0;
|
||||
|
||||
/// <summary>Seconds per turn before auto-end. 0 = no timer.</summary>
|
||||
public int TurnTimerSeconds { get; set; } = 0;
|
||||
|
||||
/// <summary>Total game time limit in minutes. 0 = no limit.</summary>
|
||||
public int TimeLimitMinutes { get; set; } = 0;
|
||||
|
||||
/// <summary>Maximum number of turns before game ends. 0 = no limit.</summary>
|
||||
public int TurnLimit { get; set; } = 0;
|
||||
|
||||
/// <summary>Flat MP bonus added to each unit at the start of its owner's turn. 0 = no buff.</summary>
|
||||
public int MpBuff { get; set; } = 0;
|
||||
|
||||
// ── Origin Points Rewards ─────────────────────────────────────────────────
|
||||
|
||||
/// <summary>OP awarded to the winner of a ranked game.</summary>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace SOR.Database.Entities.Game;
|
||||
|
||||
/// <summary>
|
||||
/// A named lobby rule preset saved by a player for quick re-use.
|
||||
///
|
||||
/// Rules are stored as serialized JSON (CustomRulesOverride shape).
|
||||
/// Personal only — presets are scoped to the owner's account.
|
||||
/// Cross-schema: OwnerAccountId is a bare Guid — no EF foreign key.
|
||||
/// </summary>
|
||||
public sealed class LobbyPreset
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid OwnerAccountId { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>Serialized CustomRulesOverride JSON (nullable fields = inherit default).</summary>
|
||||
public string RulesJson { get; set; } = "{}";
|
||||
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
}
|
||||
@@ -26,10 +26,10 @@ public enum Affinity
|
||||
Marsh, // Lake + Field
|
||||
Swamp, // Lake + Forest
|
||||
Mountain, // Hill + Hill
|
||||
Steppe, // Field + Forest
|
||||
Steppe, // Field + Hill
|
||||
Fort, // Hill + forest
|
||||
Plains, // Field + Field
|
||||
Grove, // Field + Hill
|
||||
Grove, // Field + Forest
|
||||
Jungle, // Forest + Forest
|
||||
|
||||
// ── Aether combinations ───────────────────────────────────────────────
|
||||
|
||||
Generated
+402
@@ -0,0 +1,402 @@
|
||||
// <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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SOR.Database.Migrations.Game
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddCustomGameExtensions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "DiscardOnMaxHand",
|
||||
schema: "game",
|
||||
table: "game_rule_sets",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "HandSizeCap",
|
||||
schema: "game",
|
||||
table: "game_rule_sets",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MaxArchTier1",
|
||||
schema: "game",
|
||||
table: "game_rule_sets",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MaxDeckSize",
|
||||
schema: "game",
|
||||
table: "game_rule_sets",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MinDeckSize",
|
||||
schema: "game",
|
||||
table: "game_rule_sets",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MpBuff",
|
||||
schema: "game",
|
||||
table: "game_rule_sets",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "TimeLimitMinutes",
|
||||
schema: "game",
|
||||
table: "game_rule_sets",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "TurnLimit",
|
||||
schema: "game",
|
||||
table: "game_rule_sets",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "TurnTimerSeconds",
|
||||
schema: "game",
|
||||
table: "game_rule_sets",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BoardHeightOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BoardWidthOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "DiscardOnMaxHandOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "boolean",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "HandSizeCapOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MaxArchTier1Override",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MaxDeckSizeOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MinDeckSizeOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MpBuffOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Password",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "TimeLimitMinutesOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "TurnLimitOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "TurnTimerSecondsOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "lobby_presets",
|
||||
schema: "game",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
OwnerAccountId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
RulesJson = table.Column<string>(type: "text", nullable: false),
|
||||
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_lobby_presets", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_lobby_presets_OwnerAccountId",
|
||||
schema: "game",
|
||||
table: "lobby_presets",
|
||||
column: "OwnerAccountId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "lobby_presets",
|
||||
schema: "game");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DiscardOnMaxHand",
|
||||
schema: "game",
|
||||
table: "game_rule_sets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HandSizeCap",
|
||||
schema: "game",
|
||||
table: "game_rule_sets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MaxArchTier1",
|
||||
schema: "game",
|
||||
table: "game_rule_sets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MaxDeckSize",
|
||||
schema: "game",
|
||||
table: "game_rule_sets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MinDeckSize",
|
||||
schema: "game",
|
||||
table: "game_rule_sets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MpBuff",
|
||||
schema: "game",
|
||||
table: "game_rule_sets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TimeLimitMinutes",
|
||||
schema: "game",
|
||||
table: "game_rule_sets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TurnLimit",
|
||||
schema: "game",
|
||||
table: "game_rule_sets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TurnTimerSeconds",
|
||||
schema: "game",
|
||||
table: "game_rule_sets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BoardHeightOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BoardWidthOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DiscardOnMaxHandOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HandSizeCapOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MaxArchTier1Override",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MaxDeckSizeOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MinDeckSizeOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MpBuffOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Password",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TimeLimitMinutesOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TurnLimitOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TurnTimerSecondsOverride",
|
||||
schema: "game",
|
||||
table: "custom_lobbies");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,9 +29,18 @@ namespace SOR.Database.Migrations.Game
|
||||
.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");
|
||||
|
||||
@@ -47,12 +56,27 @@ namespace SOR.Database.Migrations.Game
|
||||
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");
|
||||
@@ -60,6 +84,9 @@ namespace SOR.Database.Migrations.Game
|
||||
b.Property<int?>("OpeningHandSizeOverride")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("SpAccumulationPerTurnOverride")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -73,6 +100,15 @@ namespace SOR.Database.Migrations.Game
|
||||
.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");
|
||||
@@ -137,12 +173,18 @@ namespace SOR.Database.Migrations.Game
|
||||
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");
|
||||
|
||||
@@ -152,6 +194,18 @@ namespace SOR.Database.Migrations.Game
|
||||
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");
|
||||
@@ -171,6 +225,15 @@ namespace SOR.Database.Migrations.Game
|
||||
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");
|
||||
|
||||
@@ -251,6 +314,33 @@ namespace SOR.Database.Migrations.Game
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user