Introduce Family entity and bootstrap default family on startup
Foundation for the multi-tenant migration: adds the Family table with a unique InviteCode, and a startup hook that bootstraps a single default family from the FamilyCode config when the table is empty. No behavior change yet — the table exists and is seeded but nothing reads it. Also fixes the backend test command in CLAUDE.md: dotnet test on the .NET 10 SDK with MTP rejects the --solution switch and positional project args, so we now use Push-Location + --project. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,12 +35,11 @@ dotnet ef database update --project src/backend/YesChef.Api
|
||||
|
||||
Note: `Program.cs` calls `db.Database.MigrateAsync()` on startup, so running the API auto-applies pending migrations against the configured `ConnectionStrings:DefaultConnection`.
|
||||
|
||||
Backend tests (TUnit on Microsoft.Testing.Platform; integration tests use Testcontainers + Postgres). The `src/backend/global.json` opts `dotnet test` into MTP mode, so use `--solution` / `--project` flags:
|
||||
Backend tests (TUnit on Microsoft.Testing.Platform; integration tests use Testcontainers + Postgres). The `src/backend/global.json` opts `dotnet test` into MTP mode, which means project args must be passed via `--project` (positional project paths are rejected) and `--solution` is NOT a supported switch on the .NET 10 SDK. Run from `src/backend` so `global.json` is in scope — use `Push-Location` to avoid the blocked `cd`:
|
||||
|
||||
```powershell
|
||||
dotnet test --solution src/backend/YesChef.slnx # all tests
|
||||
dotnet test --project src/backend/YesChef.Api.UnitTests/YesChef.Api.UnitTests.csproj
|
||||
dotnet test --project src/backend/YesChef.Api.IntegrationTests/YesChef.Api.IntegrationTests.csproj
|
||||
Push-Location src/backend; try { dotnet test --project YesChef.Api.UnitTests/YesChef.Api.UnitTests.csproj } finally { Pop-Location }
|
||||
Push-Location src/backend; try { dotnet test --project YesChef.Api.IntegrationTests/YesChef.Api.IntegrationTests.csproj } finally { Pop-Location }
|
||||
```
|
||||
|
||||
Integration tests start a single Postgres 17 container per test session, create a migrated `yeschef_template` database, then clone a fresh DB per test via `CREATE DATABASE … TEMPLATE …`. Tests run in parallel (capped by `IntegrationTestParallelLimit`) and require Docker (Rancher Desktop or Docker Desktop).
|
||||
|
||||
Reference in New Issue
Block a user