From 7a62d657475b33ed9996f9e26f48528bcc30613e Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 12:24:08 +0900 Subject: [PATCH 01/14] =?UTF-8?q?feat:=20AppDbContextFactory=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20DB=20=EC=84=A4=EC=A0=95=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Config/DatabaseConfig.cs | 2 +- .../Infrastructure/AppDbContextFactory.cs | 15 ++ ...19_AddRoomStatusCreatedAtIndex.Designer.cs | 151 ------------------ ...60312060119_AddRoomStatusCreatedAtIndex.cs | 31 ---- .../Migrations/AppDbContextModelSnapshot.cs | 148 ----------------- PushAndPull/PushAndPull/PushAndPull.csproj | 4 + 6 files changed, 20 insertions(+), 331 deletions(-) create mode 100644 PushAndPull/PushAndPull/Global/Infrastructure/AppDbContextFactory.cs delete mode 100644 PushAndPull/PushAndPull/Migrations/20260312060119_AddRoomStatusCreatedAtIndex.Designer.cs delete mode 100644 PushAndPull/PushAndPull/Migrations/20260312060119_AddRoomStatusCreatedAtIndex.cs delete mode 100644 PushAndPull/PushAndPull/Migrations/AppDbContextModelSnapshot.cs diff --git a/PushAndPull/PushAndPull/Global/Config/DatabaseConfig.cs b/PushAndPull/PushAndPull/Global/Config/DatabaseConfig.cs index 381e885..2c4cd10 100644 --- a/PushAndPull/PushAndPull/Global/Config/DatabaseConfig.cs +++ b/PushAndPull/PushAndPull/Global/Config/DatabaseConfig.cs @@ -16,7 +16,7 @@ public static IServiceCollection AddDatabase( services.AddDbContext(options => { options.UseNpgsql(connectionString, npgsql => - npgsql.MigrationsHistoryTable("__EFMigrationsHistory", "room")); + npgsql.MigrationsHistoryTable("__EFMigrationsHistory", "public")); }); return services; diff --git a/PushAndPull/PushAndPull/Global/Infrastructure/AppDbContextFactory.cs b/PushAndPull/PushAndPull/Global/Infrastructure/AppDbContextFactory.cs new file mode 100644 index 0000000..fc40c5e --- /dev/null +++ b/PushAndPull/PushAndPull/Global/Infrastructure/AppDbContextFactory.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; + +namespace PushAndPull.Global.Infrastructure; + +public class AppDbContextFactory : IDesignTimeDbContextFactory +{ + public AppDbContext CreateDbContext(string[] args) + { + var optionsBuilder = new DbContextOptionsBuilder(); + optionsBuilder.UseNpgsql("Host=localhost;Database=pushpull;Username=postgres;Password=postgres"); + + return new AppDbContext(optionsBuilder.Options); + } +} diff --git a/PushAndPull/PushAndPull/Migrations/20260312060119_AddRoomStatusCreatedAtIndex.Designer.cs b/PushAndPull/PushAndPull/Migrations/20260312060119_AddRoomStatusCreatedAtIndex.Designer.cs deleted file mode 100644 index ecc8385..0000000 --- a/PushAndPull/PushAndPull/Migrations/20260312060119_AddRoomStatusCreatedAtIndex.Designer.cs +++ /dev/null @@ -1,151 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using PushAndPull.Global.Infrastructure; - -#nullable disable - -namespace PushAndPull.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20260312060119_AddRoomStatusCreatedAtIndex")] - partial class AddRoomStatusCreatedAtIndex - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Server.Domain.Entity.Room", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamptz") - .HasColumnName("created_at"); - - b.Property("CurrentPlayers") - .HasColumnType("integer") - .HasColumnName("current_players"); - - b.Property("ExpiresAt") - .HasColumnType("timestamptz") - .HasColumnName("expires_at"); - - b.Property("HostSteamId") - .HasColumnType("numeric(20,0)") - .HasColumnName("host_steam_id"); - - b.Property("IsPrivate") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_private"); - - b.Property("MaxPlayers") - .HasColumnType("integer") - .HasColumnName("max_players"); - - b.Property("PasswordHash") - .HasColumnType("text") - .HasColumnName("password_hash"); - - b.Property("RoomCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("room_code"); - - b.Property("RoomName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("room_name"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("status"); - - b.Property("SteamLobbyId") - .HasColumnType("numeric(20,0)") - .HasColumnName("steam_lobby_id"); - - b.HasKey("Id"); - - b.HasIndex("ExpiresAt") - .HasDatabaseName("idx_room_expires_at"); - - b.HasIndex("HostSteamId") - .HasDatabaseName("idx_room_host_steam_id"); - - b.HasIndex("RoomCode") - .IsUnique() - .HasDatabaseName("idx_room_room_code"); - - b.HasIndex("Status") - .HasDatabaseName("idx_room_status"); - - b.HasIndex("Status", "CreatedAt") - .HasDatabaseName("idx_room_status_created_at"); - - b.HasIndex("Status", "IsPrivate") - .HasDatabaseName("idx_room_status_private"); - - b.ToTable("room", "room"); - }); - - modelBuilder.Entity("Server.Domain.Entity.User", b => - { - b.Property("SteamId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("steam_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamptz") - .HasColumnName("created_at"); - - b.Property("LastLoginAt") - .HasColumnType("timestamptz") - .HasColumnName("last_login_at"); - - b.Property("Nickname") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("nickname"); - - b.HasKey("SteamId"); - - b.ToTable("user", "user"); - }); - - modelBuilder.Entity("Server.Domain.Entity.Room", b => - { - b.HasOne("Server.Domain.Entity.User", "Host") - .WithMany() - .HasForeignKey("HostSteamId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Host"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PushAndPull/PushAndPull/Migrations/20260312060119_AddRoomStatusCreatedAtIndex.cs b/PushAndPull/PushAndPull/Migrations/20260312060119_AddRoomStatusCreatedAtIndex.cs deleted file mode 100644 index 4f29912..0000000 --- a/PushAndPull/PushAndPull/Migrations/20260312060119_AddRoomStatusCreatedAtIndex.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace PushAndPull.Migrations -{ - /// - public partial class AddRoomStatusCreatedAtIndex : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateIndex( - name: "idx_room_status_created_at", - schema: "room", - table: "room", - columns: new[] { "status", "created_at" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "idx_room_status_created_at", - schema: "room", - table: "room"); - } - } -} diff --git a/PushAndPull/PushAndPull/Migrations/AppDbContextModelSnapshot.cs b/PushAndPull/PushAndPull/Migrations/AppDbContextModelSnapshot.cs deleted file mode 100644 index d0da5e0..0000000 --- a/PushAndPull/PushAndPull/Migrations/AppDbContextModelSnapshot.cs +++ /dev/null @@ -1,148 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using PushAndPull.Global.Infrastructure; - -#nullable disable - -namespace PushAndPull.Migrations -{ - [DbContext(typeof(AppDbContext))] - partial class AppDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Server.Domain.Entity.Room", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamptz") - .HasColumnName("created_at"); - - b.Property("CurrentPlayers") - .HasColumnType("integer") - .HasColumnName("current_players"); - - b.Property("ExpiresAt") - .HasColumnType("timestamptz") - .HasColumnName("expires_at"); - - b.Property("HostSteamId") - .HasColumnType("numeric(20,0)") - .HasColumnName("host_steam_id"); - - b.Property("IsPrivate") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_private"); - - b.Property("MaxPlayers") - .HasColumnType("integer") - .HasColumnName("max_players"); - - b.Property("PasswordHash") - .HasColumnType("text") - .HasColumnName("password_hash"); - - b.Property("RoomCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("room_code"); - - b.Property("RoomName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("room_name"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("status"); - - b.Property("SteamLobbyId") - .HasColumnType("numeric(20,0)") - .HasColumnName("steam_lobby_id"); - - b.HasKey("Id"); - - b.HasIndex("ExpiresAt") - .HasDatabaseName("idx_room_expires_at"); - - b.HasIndex("HostSteamId") - .HasDatabaseName("idx_room_host_steam_id"); - - b.HasIndex("RoomCode") - .IsUnique() - .HasDatabaseName("idx_room_room_code"); - - b.HasIndex("Status") - .HasDatabaseName("idx_room_status"); - - b.HasIndex("Status", "CreatedAt") - .HasDatabaseName("idx_room_status_created_at"); - - b.HasIndex("Status", "IsPrivate") - .HasDatabaseName("idx_room_status_private"); - - b.ToTable("room", "room"); - }); - - modelBuilder.Entity("Server.Domain.Entity.User", b => - { - b.Property("SteamId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("steam_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamptz") - .HasColumnName("created_at"); - - b.Property("LastLoginAt") - .HasColumnType("timestamptz") - .HasColumnName("last_login_at"); - - b.Property("Nickname") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("nickname"); - - b.HasKey("SteamId"); - - b.ToTable("user", "user"); - }); - - modelBuilder.Entity("Server.Domain.Entity.Room", b => - { - b.HasOne("Server.Domain.Entity.User", "Host") - .WithMany() - .HasForeignKey("HostSteamId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Host"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PushAndPull/PushAndPull/PushAndPull.csproj b/PushAndPull/PushAndPull/PushAndPull.csproj index b574c0d..d68a219 100644 --- a/PushAndPull/PushAndPull/PushAndPull.csproj +++ b/PushAndPull/PushAndPull/PushAndPull.csproj @@ -32,4 +32,8 @@ + + + + From 16353088655cacfde043d8acc07fc27cc358bc1e Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 14:06:17 +0900 Subject: [PATCH 02/14] =?UTF-8?q?chore:=20Docker=20=EB=B9=8C=EB=93=9C=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=EB=B0=8F=20CI=20=EC=9B=8C=ED=81=AC?= =?UTF-8?q?=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Deploy-Server.yaml | 4 +-- PushAndPull/PushAndPull/Dockerfile | 19 ------------- PushAndPull/deploy/compose.dev.yaml | 40 ++++++++++++++++++++++++++++ PushAndPull/deploy/compose.prod.yaml | 40 ++++++++++++++++++++++++++++ PushAndPull/deploy/dev.dockerfile | 6 +++++ PushAndPull/deploy/prod.dockerfile | 12 +++++++++ 6 files changed, 100 insertions(+), 21 deletions(-) delete mode 100644 PushAndPull/PushAndPull/Dockerfile create mode 100644 PushAndPull/deploy/compose.dev.yaml create mode 100644 PushAndPull/deploy/compose.prod.yaml create mode 100644 PushAndPull/deploy/dev.dockerfile create mode 100644 PushAndPull/deploy/prod.dockerfile diff --git a/.github/workflows/Deploy-Server.yaml b/.github/workflows/Deploy-Server.yaml index 043625e..48c2f28 100644 --- a/.github/workflows/Deploy-Server.yaml +++ b/.github/workflows/Deploy-Server.yaml @@ -17,8 +17,8 @@ jobs: run: | docker build \ -t seanyee1227/pushandpull-server:latest \ - -f PushAndPull/PushAndPull/Dockerfile \ - PushAndPull/PushAndPull + -f PushAndPull/deploy/prod.dockerfile \ + PushAndPull - name: Push Docker image run: docker push seanyee1227/pushandpull-server:latest diff --git a/PushAndPull/PushAndPull/Dockerfile b/PushAndPull/PushAndPull/Dockerfile deleted file mode 100644 index 7b97a9c..0000000 --- a/PushAndPull/PushAndPull/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base -WORKDIR /app -EXPOSE 8080 - -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build -ARG BUILD_CONFIGURATION=Release -WORKDIR /src - -COPY ["PushAndPull.csproj", "./"] -RUN dotnet restore "PushAndPull.csproj" - -COPY . . -RUN dotnet publish "PushAndPull.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false - -FROM base AS final -WORKDIR /app -COPY --from=build /app/publish . -ENV ASPNETCORE_URLS=http://+:8080 -ENTRYPOINT ["dotnet", "PushAndPull.dll"] diff --git a/PushAndPull/deploy/compose.dev.yaml b/PushAndPull/deploy/compose.dev.yaml new file mode 100644 index 0000000..3dad6fa --- /dev/null +++ b/PushAndPull/deploy/compose.dev.yaml @@ -0,0 +1,40 @@ +name: pushandpull-dev + +services: + pushandpull-db: + image: postgres:17 + environment: + POSTGRES_DB: pushandpull_dev + POSTGRES_USER: pushandpull + POSTGRES_PASSWORD: pushandpull + ports: + - "5434:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + + pushandpull-redis: + image: redis:7-alpine + ports: + - "6381:6379" + + pushandpull-server: + image: pushpull.server + build: + context: .. + dockerfile: deploy/dev.dockerfile + ports: + - "8081:8080" + environment: + - ASPNETCORE_ENVIRONMENT=Development + - DOTNET_USE_POLLING_FILE_WATCHER=1 + - ConnectionStrings__Default=Host=pushandpull-db;Port=5432;Database=pushandpull_dev;Username=pushandpull;Password=pushandpull + - Redis__ConnectionString=pushpull-redis:6379,abortConnect=false + - Steam__WebApiKey=Steam-ApiKey + volumes: + - ..:/src + depends_on: + - pushandpull-db + - pushandpull-redis + +volumes: + postgres_data: diff --git a/PushAndPull/deploy/compose.prod.yaml b/PushAndPull/deploy/compose.prod.yaml new file mode 100644 index 0000000..a8de0fd --- /dev/null +++ b/PushAndPull/deploy/compose.prod.yaml @@ -0,0 +1,40 @@ +name: pushandpull-prod + +services: + pushpull-db: + image: postgres:17 + container_name: pushpull-db + environment: + POSTGRES_DB: pushpull + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + volumes: + - postgres_data:/var/lib/postgresql/data + restart: unless-stopped + + pushpull-redis: + image: redis:7-alpine + container_name: pushpull-redis + volumes: + - redis_data:/data + restart: unless-stopped + + pushpull-server: + image: seanyee1227/pushandpull-server:latest + container_name: pushpull-server + ports: + - "21754:80" + environment: + - ASPNETCORE_ENVIRONMENT=Production + - ASPNETCORE_URLS=http://+:80 + - ConnectionStrings__Default=${DB_CONNECTION_STRING} + - Redis__ConnectionString=${REDIS_CONNECTION_STRING} + - Steam__WebApiKey=${STEAM_WEB_API_KEY} + depends_on: + - pushpull-db + - pushpull-redis + restart: unless-stopped + +volumes: + postgres_data: + redis_data: diff --git a/PushAndPull/deploy/dev.dockerfile b/PushAndPull/deploy/dev.dockerfile new file mode 100644 index 0000000..cd12e10 --- /dev/null +++ b/PushAndPull/deploy/dev.dockerfile @@ -0,0 +1,6 @@ +FROM mcr.microsoft.com/dotnet/sdk:9.0 +WORKDIR /src +COPY . . +WORKDIR /src/PushAndPull +RUN dotnet restore +ENTRYPOINT ["dotnet", "watch", "run", "--urls", "http://+:8080"] diff --git a/PushAndPull/deploy/prod.dockerfile b/PushAndPull/deploy/prod.dockerfile new file mode 100644 index 0000000..914961e --- /dev/null +++ b/PushAndPull/deploy/prod.dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +WORKDIR /src +COPY . . +RUN dotnet publish PushAndPull/PushAndPull.csproj \ + --configuration Release \ + --output /app/publish \ + /p:UseAppHost=false + +FROM mcr.microsoft.com/dotnet/aspnet:9.0 +WORKDIR /app +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "PushAndPull.dll"] From d362067c7ef951ffe5fa049ed9a152af882ba467 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 14:15:14 +0900 Subject: [PATCH 03/14] =?UTF-8?q?chore:=20AppDbContextFactory=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20=EB=B0=8F=20=EA=B0=9C=EB=B0=9C=20=ED=99=98=EA=B2=BD?= =?UTF-8?q?=20DB=20=EC=97=B0=EA=B2=B0=20=EB=AC=B8=EC=9E=90=EC=97=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Infrastructure/AppDbContextFactory.cs | 15 --------------- .../PushAndPull/appsettings.Development.json | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 PushAndPull/PushAndPull/Global/Infrastructure/AppDbContextFactory.cs diff --git a/PushAndPull/PushAndPull/Global/Infrastructure/AppDbContextFactory.cs b/PushAndPull/PushAndPull/Global/Infrastructure/AppDbContextFactory.cs deleted file mode 100644 index fc40c5e..0000000 --- a/PushAndPull/PushAndPull/Global/Infrastructure/AppDbContextFactory.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace PushAndPull.Global.Infrastructure; - -public class AppDbContextFactory : IDesignTimeDbContextFactory -{ - public AppDbContext CreateDbContext(string[] args) - { - var optionsBuilder = new DbContextOptionsBuilder(); - optionsBuilder.UseNpgsql("Host=localhost;Database=pushpull;Username=postgres;Password=postgres"); - - return new AppDbContext(optionsBuilder.Options); - } -} diff --git a/PushAndPull/PushAndPull/appsettings.Development.json b/PushAndPull/PushAndPull/appsettings.Development.json index 87d5b2c..de74356 100644 --- a/PushAndPull/PushAndPull/appsettings.Development.json +++ b/PushAndPull/PushAndPull/appsettings.Development.json @@ -13,6 +13,6 @@ "ConnectionString": "127.0.0.1:6379,abortConnect=false" }, "ConnectionStrings": { - "Default": "" + "Default": "Host=pushandpull-db;Port=5432;Database=pushandpull_dev;Username=pushandpull;Password=pushandpull" } } \ No newline at end of file From 5a3024773df5364cf81d0a22b4a969d6d705b9b2 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 14:23:30 +0900 Subject: [PATCH 04/14] =?UTF-8?q?chore:=20dotnet=20tool=20=EB=AA=85?= =?UTF-8?q?=EB=A0=B9=EC=96=B4=20=ED=97=88=EC=9A=A9=20=EB=AA=A9=EB=A1=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PushAndPull/.claude/settings.local.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PushAndPull/.claude/settings.local.json b/PushAndPull/.claude/settings.local.json index 09b37a3..ae28f23 100644 --- a/PushAndPull/.claude/settings.local.json +++ b/PushAndPull/.claude/settings.local.json @@ -27,7 +27,9 @@ "Skill(db-migrate)", "WebFetch(domain:github.com)", "WebFetch(domain:raw.githubusercontent.com)", - "Skill(pr)" + "Skill(pr)", + "Bash(dotnet tool update:*)", + "Bash(dotnet tool:*)" ] } } From cd17f18f7fa6a21782a42565f5816d26b640ec34 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 14:33:10 +0900 Subject: [PATCH 05/14] =?UTF-8?q?chore:=20gemini=20commit/pr=20=ED=85=9C?= =?UTF-8?q?=ED=94=8C=EB=A6=BF=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PushAndPull/.gemini/commands/commit.toml | 71 ++++++++++ PushAndPull/.gemini/commands/pr.toml | 157 +++++++++++++++++++++++ 2 files changed, 228 insertions(+) create mode 100644 PushAndPull/.gemini/commands/commit.toml create mode 100644 PushAndPull/.gemini/commands/pr.toml diff --git a/PushAndPull/.gemini/commands/commit.toml b/PushAndPull/.gemini/commands/commit.toml new file mode 100644 index 0000000..7dcac02 --- /dev/null +++ b/PushAndPull/.gemini/commands/commit.toml @@ -0,0 +1,71 @@ +description = "Git 변경사항을 논리적 단위로 분리하여 커밋합니다." + +prompt = """ +Create Git commits following the project's commit conventions. + +## Current Changes + +### git status +!{git status} + +### git diff (unstaged) +!{git diff} + +### git diff (staged) +!{git diff --cached} + +--- + +## Commit Message Format + +{type}: {Korean description} + +**Types:** +| Type | When to use | +|--------|-------------| +| feat | New file(s) added (new service / controller / entity / test class / migration) | +| fix | Broken behavior fixed, or missing DI registration / config corrected | +| update | Existing file(s) modified — rename, restructure, method added to existing class | +| docs | Documentation changes only | +| chore | Tooling, CI/CD, dependency updates, config changes with no behavior change | + +**Boundary rules:** +- New .cs service/repository/controller file added → `feat` +- New method added to an existing .cs file → `update` +- DI registration line added alone (no new service file) → `fix` +- New service file + its DI registration together → `feat` (one logical unit) +- New migration file → `feat` +- Existing migration corrected → `fix` +- New test class → `feat` +- Test method added to existing test class → `update` +- Refactoring without behavior change → `update` + +**Description rules:** +- Written in **Korean** +- Short and imperative (단문) +- No trailing punctuation (`.`, `!`, etc.) +- Prefer verb style over noun style + +**Examples:** +- feat: 방 생성 API 추가 +- fix: 세션 DI 누락 수정 +- update: Room 엔터티 수정 +- chore: 의존성 버전 업데이트 + +**Do NOT:** +- Add Claude/Gemini as co-author +- Write descriptions in English +- Add a commit body — subject line only + +--- + +## Steps + +1. Analyze all changes from the git status and diff above. +2. Categorize changes into **logical units** — group files that belong to the same feature or fix. +3. For each logical unit: + a. Stage only the relevant files with `git add ` + b. Write a concise commit message following the format above + c. Execute `git commit -m "message"` +4. After all commits, verify with `git log --oneline -n {number of commits made}`. +""" diff --git a/PushAndPull/.gemini/commands/pr.toml b/PushAndPull/.gemini/commands/pr.toml new file mode 100644 index 0000000..ada4fd3 --- /dev/null +++ b/PushAndPull/.gemini/commands/pr.toml @@ -0,0 +1,157 @@ +description = "현재 브랜치 기반으로 GitHub PR을 생성합니다. 사용법: /pr 또는 /pr {base-branch}" + +prompt = """ +Generate and create a GitHub Pull Request based on the current branch. + +## Runtime Context + +### Current branch +!{git branch --show-current} + +### Recent tags +!{git tag --sort=-v:refname | head -10} + +### Existing release branches +!{git branch -a | grep release} + +### User-provided argument (base branch override) +{{args}} + +--- + +## Step 0. Determine behavior + +- If `{{args}}` is **not empty**: set Base Branch = `{{args}}`, skip to **Case 3** immediately. +- If `{{args}}` is **empty**: check the current branch name and follow the rules below. + +--- + +## Case 1: Current branch is `develop` + +**Step 1.** Determine the latest version from tags and release branches. + +**Step 2.** Analyze changes from `main`: +- `git log main..HEAD --oneline` +- `git diff main...HEAD --stat` + +**Step 3.** Recommend a version bump (Major / Minor / Patch) and explain why briefly. + +**Step 4.** Ask the user: "현재 버전: {current_version} / 추천: {recommended_version} ({reason}) — 사용할 버전 번호를 입력해주세요. (예: 1.0.1)" + +**Step 5.** After the user replies with a version number: +- Run: `git checkout -b release/{version}` +- Analyze changes from `main` for the PR body + +**Step 6.** Write the PR body following the **PR Body Template** below. Save to `PR_BODY.md`. + +**Step 7.** Run: +``` +gh pr create --title "release/{version}" --body-file PR_BODY.md --base main +``` + +**Step 8.** Run: `rm PR_BODY.md` + +--- + +## Case 2: Current branch matches `release/x.x.x` + +**Step 1.** Extract version from branch name (e.g., `release/1.2.0` → `1.2.0`). + +**Step 2.** Analyze changes from `main`: +- `git log main..HEAD --oneline` +- `git diff main...HEAD --stat` + +**Step 3.** Write PR body following the **PR Body Template** below. Save to `PR_BODY.md`. + +**Step 4.** Run: +``` +gh pr create --title "release/{version}" --body-file PR_BODY.md --base main +``` + +**Step 5.** Run: `rm PR_BODY.md` + +--- + +## Case 3: Any other branch (or base branch was specified via argument) + +**Step 1.** Set Base Branch: +- If `{{args}}` is not empty → Base Branch = `{{args}}` +- Otherwise → Base Branch = `develop` + +**Step 2.** Analyze changes from Base Branch: +- `git log {Base Branch}..HEAD --oneline` +- `git diff {Base Branch}...HEAD --stat` +- `git diff {Base Branch}...HEAD` + +**Step 3.** Suggest **three PR title options** following the **PR Title Convention** below. + +**Step 4.** Write the PR body following the **PR Body Template** below. Save to `PR_BODY.md`. + +**Step 5.** Show the PR body preview and the three title options to the user. Ask: +"PR 제목을 선택해주세요. (1 / 2 / 3 / 직접 입력)" + +**Step 6.** After the user selects or types a title: +``` +gh pr create --title "{chosen title}" --body-file PR_BODY.md --base {Base Branch} +``` + +**Step 7.** Run: `rm PR_BODY.md` + +--- + +## PR Title Convention + +Format: `{type}: {Korean description}` + +**Types:** +- `feature` — new feature added +- `fix` — bug fix or missing configuration/DI registration +- `update` — modification to existing code +- `refactor` — refactoring without behavior change +- `docs` — documentation changes +- `chore` — tooling, CI/CD, dependency updates + +**Rules:** +- Description in Korean +- Short and imperative (단문) +- No trailing punctuation + +**Examples:** +- `feature: 방 생성 API 추가` +- `fix: 세션 DI 누락 수정` +- `refactor: Room 서비스 리팩토링` + +--- + +## PR Body Template + +Use this exact structure (keep the emoji headers): + +``` +## 📚작업 내용 + +- {change item 1} +- {change item 2} + +## ◀️참고 사항 + +{additional notes, context, before/after comparisons if relevant. Write "." if nothing to add.} + +## ✅체크리스트 + +> `[ ]`안에 x를 작성하면 체크박스를 체크할 수 있습니다. + +- [x] 현재 의도하고자 하는 기능이 정상적으로 작동하나요? +- [x] 변경한 기능이 다른 기능을 깨뜨리지 않나요? + + +> *추후 필요한 체크리스트는 업데이트 될 예정입니다.* +``` + +**Writing rules:** +- Fill `작업 내용` bullets by grouping commits meaningfully — not one bullet per commit +- `참고 사항`: configuration notes, before/after comparisons, etc. Write `"."` if nothing to add +- Keep total body under 2500 characters +- All text content in Korean (keep section header emojis as-is) +- No emojis in body text — section headers only +""" From c4f8bd11e1c9e8982ad82515e9c389e0f359d7ec Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 17:00:06 +0900 Subject: [PATCH 06/14] =?UTF-8?q?chore:=20dotnet=20SDK=209.0.201=20?= =?UTF-8?q?=EB=B2=84=EC=A0=84=20=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- global.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 global.json diff --git a/global.json b/global.json new file mode 100644 index 0000000..f99d233 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "9.0.201", + "rollForward": "latestPatch" + } +} From 3cdb67050291ec47381dc57161998caceafbe158 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 17:00:13 +0900 Subject: [PATCH 07/14] =?UTF-8?q?fix:=20nullable=20=EC=B0=B8=EC=A1=B0=20?= =?UTF-8?q?=EA=B2=BD=EA=B3=A0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs | 2 +- PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs | 2 +- PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs | 4 ++-- .../PushAndPull/Global/Auth/SteamAuthTicketValidator.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs b/PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs index 9e1f410..6c34f8e 100644 --- a/PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs +++ b/PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs @@ -2,7 +2,7 @@ namespace PushAndPull.Domain.Auth.Entity; public class PlayerSession { - public string SessionId { get; private set; } + public string SessionId { get; private set; } = null!; public ulong SteamId { get; private set; } public TimeSpan Ttl { get; private set; } diff --git a/PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs b/PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs index 393e233..50e0fbf 100644 --- a/PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs +++ b/PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs @@ -3,7 +3,7 @@ namespace PushAndPull.Domain.Auth.Entity; public class User { public ulong SteamId { get; private set; } - public string Nickname { get; private set; } + public string Nickname { get; private set; } = null!; public DateTime CreatedAt { get; private set; } public DateTime LastLoginAt { get; private set; } diff --git a/PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs b/PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs index 3cb9fab..1f80e13 100644 --- a/PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs +++ b/PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs @@ -3,12 +3,12 @@ namespace PushAndPull.Domain.Room.Entity; public class Room { public long Id { get; set; } - public string RoomName { get; set; } + public string RoomName { get; set; } = null!; public string RoomCode { get; set; } = null!; public ulong SteamLobbyId { get; set; } - public Auth.Entity.User Host { get; private set; } + public Auth.Entity.User Host { get; private set; } = null!; public ulong HostSteamId { get; set; } public int CurrentPlayers { get; set; } diff --git a/PushAndPull/PushAndPull/Global/Auth/SteamAuthTicketValidator.cs b/PushAndPull/PushAndPull/Global/Auth/SteamAuthTicketValidator.cs index 00b4238..b704a57 100644 --- a/PushAndPull/PushAndPull/Global/Auth/SteamAuthTicketValidator.cs +++ b/PushAndPull/PushAndPull/Global/Auth/SteamAuthTicketValidator.cs @@ -101,7 +101,7 @@ private static async Task ParseResponseAsync( private static AuthTicketValidationResult ValidateAndCreateResult( SteamAuthResponse steamResponse) { - var param = steamResponse.Response.Params; + var param = steamResponse.Response.Params!; if (param.Result != "OK") throw new InvalidTicketException($"FAIL_TO_VALIDATE: {param.Result}"); From 3a1e7ee720a86ad16ac20be3dda83d0d8a8f5166 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 17:00:21 +0900 Subject: [PATCH 08/14] =?UTF-8?q?feat:=20=EC=B4=88=EA=B8=B0=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20=EC=83=9D=EC=84=B1=20=EB=A7=88=EC=9D=B4?= =?UTF-8?q?=EA=B7=B8=EB=A0=88=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0402065544_InitialCreateTables.Designer.cs | 151 ++++++++++++++++++ .../20260402065544_InitialCreateTables.cs | 117 ++++++++++++++ 2 files changed, 268 insertions(+) create mode 100644 PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.Designer.cs create mode 100644 PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.cs diff --git a/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.Designer.cs b/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.Designer.cs new file mode 100644 index 0000000..afd3a3c --- /dev/null +++ b/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.Designer.cs @@ -0,0 +1,151 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using PushAndPull.Global.Infrastructure; + +#nullable disable + +namespace PushAndPull.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20260402065544_InitialCreateTables")] + partial class InitialCreateTables + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.12") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("PushAndPull.Domain.Auth.Entity.User", b => + { + b.Property("SteamId") + .ValueGeneratedOnAdd() + .HasColumnType("numeric(20,0)") + .HasColumnName("steam_id"); + + b.Property("CreatedAt") + .HasColumnType("timestamptz") + .HasColumnName("created_at"); + + b.Property("LastLoginAt") + .HasColumnType("timestamptz") + .HasColumnName("last_login_at"); + + b.Property("Nickname") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("nickname"); + + b.HasKey("SteamId"); + + b.ToTable("user", "game_user"); + }); + + modelBuilder.Entity("PushAndPull.Domain.Room.Entity.Room", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamptz") + .HasColumnName("created_at"); + + b.Property("CurrentPlayers") + .HasColumnType("integer") + .HasColumnName("current_players"); + + b.Property("ExpiresAt") + .HasColumnType("timestamptz") + .HasColumnName("expires_at"); + + b.Property("HostSteamId") + .HasColumnType("numeric(20,0)") + .HasColumnName("host_steam_id"); + + b.Property("IsPrivate") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_private"); + + b.Property("MaxPlayers") + .HasColumnType("integer") + .HasColumnName("max_players"); + + b.Property("PasswordHash") + .HasColumnType("text") + .HasColumnName("password_hash"); + + b.Property("RoomCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("room_code"); + + b.Property("RoomName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("room_name"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("status"); + + b.Property("SteamLobbyId") + .HasColumnType("numeric(20,0)") + .HasColumnName("steam_lobby_id"); + + b.HasKey("Id"); + + b.HasIndex("ExpiresAt") + .HasDatabaseName("idx_room_expires_at"); + + b.HasIndex("HostSteamId") + .HasDatabaseName("idx_room_host_steam_id"); + + b.HasIndex("RoomCode") + .IsUnique() + .HasDatabaseName("idx_room_room_code"); + + b.HasIndex("Status") + .HasDatabaseName("idx_room_status"); + + b.HasIndex("Status", "CreatedAt") + .HasDatabaseName("idx_room_status_created_at"); + + b.HasIndex("Status", "IsPrivate") + .HasDatabaseName("idx_room_status_private"); + + b.ToTable("room", "room"); + }); + + modelBuilder.Entity("PushAndPull.Domain.Room.Entity.Room", b => + { + b.HasOne("PushAndPull.Domain.Auth.Entity.User", "Host") + .WithMany() + .HasForeignKey("HostSteamId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Host"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.cs b/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.cs new file mode 100644 index 0000000..d0faf20 --- /dev/null +++ b/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.cs @@ -0,0 +1,117 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace PushAndPull.Migrations +{ + /// + public partial class InitialCreateTables : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.EnsureSchema( + name: "room"); + + migrationBuilder.EnsureSchema( + name: "game_user"); + + migrationBuilder.CreateTable( + name: "user", + schema: "game_user", + columns: table => new + { + steam_id = table.Column(type: "numeric(20,0)", nullable: false), + nickname = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), + created_at = table.Column(type: "timestamptz", nullable: false), + last_login_at = table.Column(type: "timestamptz", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_user", x => x.steam_id); + }); + + migrationBuilder.CreateTable( + name: "room", + schema: "room", + columns: table => new + { + id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + room_name = table.Column(type: "text", nullable: false), + room_code = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), + steam_lobby_id = table.Column(type: "numeric(20,0)", nullable: false), + host_steam_id = table.Column(type: "numeric(20,0)", nullable: false), + current_players = table.Column(type: "integer", nullable: false), + max_players = table.Column(type: "integer", nullable: false), + is_private = table.Column(type: "boolean", nullable: false, defaultValue: false), + password_hash = table.Column(type: "text", nullable: true), + status = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), + created_at = table.Column(type: "timestamptz", nullable: false), + expires_at = table.Column(type: "timestamptz", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_room", x => x.id); + table.ForeignKey( + name: "FK_room_user_host_steam_id", + column: x => x.host_steam_id, + principalSchema: "game_user", + principalTable: "user", + principalColumn: "steam_id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "idx_room_expires_at", + schema: "room", + table: "room", + column: "expires_at"); + + migrationBuilder.CreateIndex( + name: "idx_room_host_steam_id", + schema: "room", + table: "room", + column: "host_steam_id"); + + migrationBuilder.CreateIndex( + name: "idx_room_room_code", + schema: "room", + table: "room", + column: "room_code", + unique: true); + + migrationBuilder.CreateIndex( + name: "idx_room_status", + schema: "room", + table: "room", + column: "status"); + + migrationBuilder.CreateIndex( + name: "idx_room_status_created_at", + schema: "room", + table: "room", + columns: new[] { "status", "created_at" }); + + migrationBuilder.CreateIndex( + name: "idx_room_status_private", + schema: "room", + table: "room", + columns: new[] { "status", "is_private" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "room", + schema: "room"); + + migrationBuilder.DropTable( + name: "user", + schema: "game_user"); + } + } +} From 0c2e696900fc151d6e11d9fb81c4110ea9d8fcc7 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 17:00:26 +0900 Subject: [PATCH 09/14] =?UTF-8?q?update:=20User=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=EC=8A=A4=ED=82=A4=EB=A7=88=EB=A5=BC=20auth?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Domain/Auth/Entity/Config/UserConfig.cs | 2 +- ...2071639_RenameUserSchemaToAuth.Designer.cs | 151 ++++++++++++++++++ .../20260402071639_RenameUserSchemaToAuth.cs | 66 ++++++++ .../Migrations/AppDbContextModelSnapshot.cs | 148 +++++++++++++++++ 4 files changed, 366 insertions(+), 1 deletion(-) create mode 100644 PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.Designer.cs create mode 100644 PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.cs create mode 100644 PushAndPull/PushAndPull/Migrations/AppDbContextModelSnapshot.cs diff --git a/PushAndPull/PushAndPull/Domain/Auth/Entity/Config/UserConfig.cs b/PushAndPull/PushAndPull/Domain/Auth/Entity/Config/UserConfig.cs index c6f7adf..24b9250 100644 --- a/PushAndPull/PushAndPull/Domain/Auth/Entity/Config/UserConfig.cs +++ b/PushAndPull/PushAndPull/Domain/Auth/Entity/Config/UserConfig.cs @@ -7,7 +7,7 @@ public class UserConfig : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { - builder.ToTable("user", "game_user"); + builder.ToTable("user", "auth"); builder.HasKey(x => x.SteamId); diff --git a/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.Designer.cs b/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.Designer.cs new file mode 100644 index 0000000..d8ea6e2 --- /dev/null +++ b/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.Designer.cs @@ -0,0 +1,151 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using PushAndPull.Global.Infrastructure; + +#nullable disable + +namespace PushAndPull.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20260402071639_RenameUserSchemaToAuth")] + partial class RenameUserSchemaToAuth + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.12") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("PushAndPull.Domain.Auth.Entity.User", b => + { + b.Property("SteamId") + .ValueGeneratedOnAdd() + .HasColumnType("numeric(20,0)") + .HasColumnName("steam_id"); + + b.Property("CreatedAt") + .HasColumnType("timestamptz") + .HasColumnName("created_at"); + + b.Property("LastLoginAt") + .HasColumnType("timestamptz") + .HasColumnName("last_login_at"); + + b.Property("Nickname") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("nickname"); + + b.HasKey("SteamId"); + + b.ToTable("user", "auth"); + }); + + modelBuilder.Entity("PushAndPull.Domain.Room.Entity.Room", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamptz") + .HasColumnName("created_at"); + + b.Property("CurrentPlayers") + .HasColumnType("integer") + .HasColumnName("current_players"); + + b.Property("ExpiresAt") + .HasColumnType("timestamptz") + .HasColumnName("expires_at"); + + b.Property("HostSteamId") + .HasColumnType("numeric(20,0)") + .HasColumnName("host_steam_id"); + + b.Property("IsPrivate") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_private"); + + b.Property("MaxPlayers") + .HasColumnType("integer") + .HasColumnName("max_players"); + + b.Property("PasswordHash") + .HasColumnType("text") + .HasColumnName("password_hash"); + + b.Property("RoomCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("room_code"); + + b.Property("RoomName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("room_name"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("status"); + + b.Property("SteamLobbyId") + .HasColumnType("numeric(20,0)") + .HasColumnName("steam_lobby_id"); + + b.HasKey("Id"); + + b.HasIndex("ExpiresAt") + .HasDatabaseName("idx_room_expires_at"); + + b.HasIndex("HostSteamId") + .HasDatabaseName("idx_room_host_steam_id"); + + b.HasIndex("RoomCode") + .IsUnique() + .HasDatabaseName("idx_room_room_code"); + + b.HasIndex("Status") + .HasDatabaseName("idx_room_status"); + + b.HasIndex("Status", "CreatedAt") + .HasDatabaseName("idx_room_status_created_at"); + + b.HasIndex("Status", "IsPrivate") + .HasDatabaseName("idx_room_status_private"); + + b.ToTable("room", "room"); + }); + + modelBuilder.Entity("PushAndPull.Domain.Room.Entity.Room", b => + { + b.HasOne("PushAndPull.Domain.Auth.Entity.User", "Host") + .WithMany() + .HasForeignKey("HostSteamId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Host"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.cs b/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.cs new file mode 100644 index 0000000..c1ee326 --- /dev/null +++ b/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.cs @@ -0,0 +1,66 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace PushAndPull.Migrations +{ + /// + public partial class RenameUserSchemaToAuth : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_room_user_host_steam_id", + schema: "room", + table: "room"); + + migrationBuilder.EnsureSchema( + name: "auth"); + + migrationBuilder.RenameTable( + name: "user", + schema: "game_user", + newName: "user", + newSchema: "auth"); + + migrationBuilder.AddForeignKey( + name: "FK_room_user_host_steam_id", + schema: "room", + table: "room", + column: "host_steam_id", + principalSchema: "auth", + principalTable: "user", + principalColumn: "steam_id", + onDelete: ReferentialAction.Restrict); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_room_user_host_steam_id", + schema: "room", + table: "room"); + + migrationBuilder.EnsureSchema( + name: "game_user"); + + migrationBuilder.RenameTable( + name: "user", + schema: "auth", + newName: "user", + newSchema: "game_user"); + + migrationBuilder.AddForeignKey( + name: "FK_room_user_host_steam_id", + schema: "room", + table: "room", + column: "host_steam_id", + principalSchema: "game_user", + principalTable: "user", + principalColumn: "steam_id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/PushAndPull/PushAndPull/Migrations/AppDbContextModelSnapshot.cs b/PushAndPull/PushAndPull/Migrations/AppDbContextModelSnapshot.cs new file mode 100644 index 0000000..8511547 --- /dev/null +++ b/PushAndPull/PushAndPull/Migrations/AppDbContextModelSnapshot.cs @@ -0,0 +1,148 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using PushAndPull.Global.Infrastructure; + +#nullable disable + +namespace PushAndPull.Migrations +{ + [DbContext(typeof(AppDbContext))] + partial class AppDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.12") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("PushAndPull.Domain.Auth.Entity.User", b => + { + b.Property("SteamId") + .ValueGeneratedOnAdd() + .HasColumnType("numeric(20,0)") + .HasColumnName("steam_id"); + + b.Property("CreatedAt") + .HasColumnType("timestamptz") + .HasColumnName("created_at"); + + b.Property("LastLoginAt") + .HasColumnType("timestamptz") + .HasColumnName("last_login_at"); + + b.Property("Nickname") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .HasColumnName("nickname"); + + b.HasKey("SteamId"); + + b.ToTable("user", "auth"); + }); + + modelBuilder.Entity("PushAndPull.Domain.Room.Entity.Room", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("timestamptz") + .HasColumnName("created_at"); + + b.Property("CurrentPlayers") + .HasColumnType("integer") + .HasColumnName("current_players"); + + b.Property("ExpiresAt") + .HasColumnType("timestamptz") + .HasColumnName("expires_at"); + + b.Property("HostSteamId") + .HasColumnType("numeric(20,0)") + .HasColumnName("host_steam_id"); + + b.Property("IsPrivate") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_private"); + + b.Property("MaxPlayers") + .HasColumnType("integer") + .HasColumnName("max_players"); + + b.Property("PasswordHash") + .HasColumnType("text") + .HasColumnName("password_hash"); + + b.Property("RoomCode") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("room_code"); + + b.Property("RoomName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("room_name"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("status"); + + b.Property("SteamLobbyId") + .HasColumnType("numeric(20,0)") + .HasColumnName("steam_lobby_id"); + + b.HasKey("Id"); + + b.HasIndex("ExpiresAt") + .HasDatabaseName("idx_room_expires_at"); + + b.HasIndex("HostSteamId") + .HasDatabaseName("idx_room_host_steam_id"); + + b.HasIndex("RoomCode") + .IsUnique() + .HasDatabaseName("idx_room_room_code"); + + b.HasIndex("Status") + .HasDatabaseName("idx_room_status"); + + b.HasIndex("Status", "CreatedAt") + .HasDatabaseName("idx_room_status_created_at"); + + b.HasIndex("Status", "IsPrivate") + .HasDatabaseName("idx_room_status_private"); + + b.ToTable("room", "room"); + }); + + modelBuilder.Entity("PushAndPull.Domain.Room.Entity.Room", b => + { + b.HasOne("PushAndPull.Domain.Auth.Entity.User", "Host") + .WithMany() + .HasForeignKey("HostSteamId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Host"); + }); +#pragma warning restore 612, 618 + } + } +} From b2b3d04f9abf853cfeaec0de67166da6d339e367 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 17:00:30 +0900 Subject: [PATCH 10/14] =?UTF-8?q?chore:=20=EA=B0=9C=EB=B0=9C=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=20DB=20=EB=B0=8F=20Redis=20=ED=8F=AC=ED=8A=B8=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PushAndPull/PushAndPull/appsettings.Development.json | 4 ++-- PushAndPull/deploy/compose.dev.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PushAndPull/PushAndPull/appsettings.Development.json b/PushAndPull/PushAndPull/appsettings.Development.json index de74356..b2d1017 100644 --- a/PushAndPull/PushAndPull/appsettings.Development.json +++ b/PushAndPull/PushAndPull/appsettings.Development.json @@ -10,9 +10,9 @@ "AppId": 480 }, "Redis": { - "ConnectionString": "127.0.0.1:6379,abortConnect=false" + "ConnectionString": "127.0.0.1:6381,abortConnect=false" }, "ConnectionStrings": { - "Default": "Host=pushandpull-db;Port=5432;Database=pushandpull_dev;Username=pushandpull;Password=pushandpull" + "Default": "Host=localhost;Port=5434;Database=pushandpull_dev;Username=pushandpull;Password=pushandpull" } } \ No newline at end of file diff --git a/PushAndPull/deploy/compose.dev.yaml b/PushAndPull/deploy/compose.dev.yaml index 3dad6fa..91f5a03 100644 --- a/PushAndPull/deploy/compose.dev.yaml +++ b/PushAndPull/deploy/compose.dev.yaml @@ -27,8 +27,8 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - DOTNET_USE_POLLING_FILE_WATCHER=1 - - ConnectionStrings__Default=Host=pushandpull-db;Port=5432;Database=pushandpull_dev;Username=pushandpull;Password=pushandpull - - Redis__ConnectionString=pushpull-redis:6379,abortConnect=false + - ConnectionStrings__Default=Host=localhost;Port=5434;Database=pushandpull_dev;Username=pushandpull;Password=pushandpull + - Redis__ConnectionString=localhost:6381,abortConnect=false - Steam__WebApiKey=Steam-ApiKey volumes: - ..:/src From fb54ca9091b5bc2964a3f380796784cbcb8d9f98 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 17:00:38 +0900 Subject: [PATCH 11/14] =?UTF-8?q?chore:=20cmd.exe=20=EB=B0=8F=20dotnet=20S?= =?UTF-8?q?DK=20=EB=AA=85=EB=A0=B9=EC=96=B4=20=ED=97=88=EC=9A=A9=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PushAndPull/.claude/settings.local.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PushAndPull/.claude/settings.local.json b/PushAndPull/.claude/settings.local.json index ae28f23..f72cddc 100644 --- a/PushAndPull/.claude/settings.local.json +++ b/PushAndPull/.claude/settings.local.json @@ -29,7 +29,10 @@ "WebFetch(domain:raw.githubusercontent.com)", "Skill(pr)", "Bash(dotnet tool update:*)", - "Bash(dotnet tool:*)" + "Bash(dotnet tool:*)", + "Bash(cmd.exe:*)", + "Bash(dotnet --list-sdks)", + "Bash(dotnet list:*)" ] } } From efa14a0a36bb0fa8faf9acf47b8d0387ca3d856f Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 17:03:01 +0900 Subject: [PATCH 12/14] =?UTF-8?q?Revert=20"fix:=20nullable=20=EC=B0=B8?= =?UTF-8?q?=EC=A1=B0=20=EA=B2=BD=EA=B3=A0=20=EC=88=98=EC=A0=95"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3cdb67050291ec47381dc57161998caceafbe158. --- PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs | 2 +- PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs | 2 +- PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs | 4 ++-- .../PushAndPull/Global/Auth/SteamAuthTicketValidator.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs b/PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs index 6c34f8e..9e1f410 100644 --- a/PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs +++ b/PushAndPull/PushAndPull/Domain/Auth/Entity/PlayerSession.cs @@ -2,7 +2,7 @@ namespace PushAndPull.Domain.Auth.Entity; public class PlayerSession { - public string SessionId { get; private set; } = null!; + public string SessionId { get; private set; } public ulong SteamId { get; private set; } public TimeSpan Ttl { get; private set; } diff --git a/PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs b/PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs index 50e0fbf..393e233 100644 --- a/PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs +++ b/PushAndPull/PushAndPull/Domain/Auth/Entity/User.cs @@ -3,7 +3,7 @@ namespace PushAndPull.Domain.Auth.Entity; public class User { public ulong SteamId { get; private set; } - public string Nickname { get; private set; } = null!; + public string Nickname { get; private set; } public DateTime CreatedAt { get; private set; } public DateTime LastLoginAt { get; private set; } diff --git a/PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs b/PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs index 1f80e13..3cb9fab 100644 --- a/PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs +++ b/PushAndPull/PushAndPull/Domain/Room/Entity/Room.cs @@ -3,12 +3,12 @@ namespace PushAndPull.Domain.Room.Entity; public class Room { public long Id { get; set; } - public string RoomName { get; set; } = null!; + public string RoomName { get; set; } public string RoomCode { get; set; } = null!; public ulong SteamLobbyId { get; set; } - public Auth.Entity.User Host { get; private set; } = null!; + public Auth.Entity.User Host { get; private set; } public ulong HostSteamId { get; set; } public int CurrentPlayers { get; set; } diff --git a/PushAndPull/PushAndPull/Global/Auth/SteamAuthTicketValidator.cs b/PushAndPull/PushAndPull/Global/Auth/SteamAuthTicketValidator.cs index b704a57..00b4238 100644 --- a/PushAndPull/PushAndPull/Global/Auth/SteamAuthTicketValidator.cs +++ b/PushAndPull/PushAndPull/Global/Auth/SteamAuthTicketValidator.cs @@ -101,7 +101,7 @@ private static async Task ParseResponseAsync( private static AuthTicketValidationResult ValidateAndCreateResult( SteamAuthResponse steamResponse) { - var param = steamResponse.Response.Params!; + var param = steamResponse.Response.Params; if (param.Result != "OK") throw new InvalidTicketException($"FAIL_TO_VALIDATE: {param.Result}"); From a316eb9d18316347ea6e578da3eeac327e519325 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 17:16:07 +0900 Subject: [PATCH 13/14] =?UTF-8?q?fix:=20Docker=20Compose=20=EC=BB=A8?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=84=88=20=EA=B0=84=20=ED=86=B5=EC=8B=A0=20?= =?UTF-8?q?=ED=98=B8=EC=8A=A4=ED=8A=B8=EB=AA=85=20=EB=B0=8F=20=ED=8F=AC?= =?UTF-8?q?=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PushAndPull/deploy/compose.dev.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PushAndPull/deploy/compose.dev.yaml b/PushAndPull/deploy/compose.dev.yaml index 91f5a03..301d857 100644 --- a/PushAndPull/deploy/compose.dev.yaml +++ b/PushAndPull/deploy/compose.dev.yaml @@ -27,8 +27,8 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - DOTNET_USE_POLLING_FILE_WATCHER=1 - - ConnectionStrings__Default=Host=localhost;Port=5434;Database=pushandpull_dev;Username=pushandpull;Password=pushandpull - - Redis__ConnectionString=localhost:6381,abortConnect=false + - ConnectionStrings__Default=Host=pushandpull-db;Port=5432;Database=pushandpull_dev;Username=pushandpull;Password=pushandpull + - Redis__ConnectionString=pushandpull-redis:6379,abortConnect=false - Steam__WebApiKey=Steam-ApiKey volumes: - ..:/src From 4a8c827418c905238c1894294c860f6f84a85cf7 Mon Sep 17 00:00:00 2001 From: Sean-mn Date: Thu, 2 Apr 2026 17:16:15 +0900 Subject: [PATCH 14/14] =?UTF-8?q?update:=20=EC=B4=88=EA=B8=B0=20=EB=A7=88?= =?UTF-8?q?=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4=EC=85=98=EC=97=90=20auth?= =?UTF-8?q?=20=EC=8A=A4=ED=82=A4=EB=A7=88=20=ED=86=B5=ED=95=A9=20=EB=B0=8F?= =?UTF-8?q?=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20=EC=8A=A4=ED=82=A4?= =?UTF-8?q?=EB=A7=88=20=EB=B3=80=EA=B2=BD=20=EB=A7=88=EC=9D=B4=EA=B7=B8?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0402065544_InitialCreateTables.Designer.cs | 2 +- .../20260402065544_InitialCreateTables.cs | 8 +- ...2071639_RenameUserSchemaToAuth.Designer.cs | 151 ------------------ .../20260402071639_RenameUserSchemaToAuth.cs | 66 -------- 4 files changed, 5 insertions(+), 222 deletions(-) delete mode 100644 PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.Designer.cs delete mode 100644 PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.cs diff --git a/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.Designer.cs b/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.Designer.cs index afd3a3c..518affe 100644 --- a/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.Designer.cs +++ b/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.Designer.cs @@ -48,7 +48,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("SteamId"); - b.ToTable("user", "game_user"); + b.ToTable("user", "auth"); }); modelBuilder.Entity("PushAndPull.Domain.Room.Entity.Room", b => diff --git a/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.cs b/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.cs index d0faf20..25b2546 100644 --- a/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.cs +++ b/PushAndPull/PushAndPull/Migrations/20260402065544_InitialCreateTables.cs @@ -16,11 +16,11 @@ protected override void Up(MigrationBuilder migrationBuilder) name: "room"); migrationBuilder.EnsureSchema( - name: "game_user"); + name: "auth"); migrationBuilder.CreateTable( name: "user", - schema: "game_user", + schema: "auth", columns: table => new { steam_id = table.Column(type: "numeric(20,0)", nullable: false), @@ -58,7 +58,7 @@ protected override void Up(MigrationBuilder migrationBuilder) table.ForeignKey( name: "FK_room_user_host_steam_id", column: x => x.host_steam_id, - principalSchema: "game_user", + principalSchema: "auth", principalTable: "user", principalColumn: "steam_id", onDelete: ReferentialAction.Restrict); @@ -111,7 +111,7 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "user", - schema: "game_user"); + schema: "auth"); } } } diff --git a/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.Designer.cs b/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.Designer.cs deleted file mode 100644 index d8ea6e2..0000000 --- a/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.Designer.cs +++ /dev/null @@ -1,151 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using PushAndPull.Global.Infrastructure; - -#nullable disable - -namespace PushAndPull.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20260402071639_RenameUserSchemaToAuth")] - partial class RenameUserSchemaToAuth - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("PushAndPull.Domain.Auth.Entity.User", b => - { - b.Property("SteamId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("steam_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamptz") - .HasColumnName("created_at"); - - b.Property("LastLoginAt") - .HasColumnType("timestamptz") - .HasColumnName("last_login_at"); - - b.Property("Nickname") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("nickname"); - - b.HasKey("SteamId"); - - b.ToTable("user", "auth"); - }); - - modelBuilder.Entity("PushAndPull.Domain.Room.Entity.Room", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamptz") - .HasColumnName("created_at"); - - b.Property("CurrentPlayers") - .HasColumnType("integer") - .HasColumnName("current_players"); - - b.Property("ExpiresAt") - .HasColumnType("timestamptz") - .HasColumnName("expires_at"); - - b.Property("HostSteamId") - .HasColumnType("numeric(20,0)") - .HasColumnName("host_steam_id"); - - b.Property("IsPrivate") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("is_private"); - - b.Property("MaxPlayers") - .HasColumnType("integer") - .HasColumnName("max_players"); - - b.Property("PasswordHash") - .HasColumnType("text") - .HasColumnName("password_hash"); - - b.Property("RoomCode") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("room_code"); - - b.Property("RoomName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("room_name"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("status"); - - b.Property("SteamLobbyId") - .HasColumnType("numeric(20,0)") - .HasColumnName("steam_lobby_id"); - - b.HasKey("Id"); - - b.HasIndex("ExpiresAt") - .HasDatabaseName("idx_room_expires_at"); - - b.HasIndex("HostSteamId") - .HasDatabaseName("idx_room_host_steam_id"); - - b.HasIndex("RoomCode") - .IsUnique() - .HasDatabaseName("idx_room_room_code"); - - b.HasIndex("Status") - .HasDatabaseName("idx_room_status"); - - b.HasIndex("Status", "CreatedAt") - .HasDatabaseName("idx_room_status_created_at"); - - b.HasIndex("Status", "IsPrivate") - .HasDatabaseName("idx_room_status_private"); - - b.ToTable("room", "room"); - }); - - modelBuilder.Entity("PushAndPull.Domain.Room.Entity.Room", b => - { - b.HasOne("PushAndPull.Domain.Auth.Entity.User", "Host") - .WithMany() - .HasForeignKey("HostSteamId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Host"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.cs b/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.cs deleted file mode 100644 index c1ee326..0000000 --- a/PushAndPull/PushAndPull/Migrations/20260402071639_RenameUserSchemaToAuth.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace PushAndPull.Migrations -{ - /// - public partial class RenameUserSchemaToAuth : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_room_user_host_steam_id", - schema: "room", - table: "room"); - - migrationBuilder.EnsureSchema( - name: "auth"); - - migrationBuilder.RenameTable( - name: "user", - schema: "game_user", - newName: "user", - newSchema: "auth"); - - migrationBuilder.AddForeignKey( - name: "FK_room_user_host_steam_id", - schema: "room", - table: "room", - column: "host_steam_id", - principalSchema: "auth", - principalTable: "user", - principalColumn: "steam_id", - onDelete: ReferentialAction.Restrict); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_room_user_host_steam_id", - schema: "room", - table: "room"); - - migrationBuilder.EnsureSchema( - name: "game_user"); - - migrationBuilder.RenameTable( - name: "user", - schema: "auth", - newName: "user", - newSchema: "game_user"); - - migrationBuilder.AddForeignKey( - name: "FK_room_user_host_steam_id", - schema: "room", - table: "room", - column: "host_steam_id", - principalSchema: "game_user", - principalTable: "user", - principalColumn: "steam_id", - onDelete: ReferentialAction.Restrict); - } - } -}