chore(auth): drop the Postgres provider, run SQLite only #44

Closed
opened 2026-07-18 16:55:35 +02:00 by marco · 0 comments
Owner

Decision (design review): Auth stays on EF Core but commits to SQLite only. Moving Auth to binary files was rejected — Auth genuinely queries by username, needs atomic world-wide uniqueness (it already relies on the DB unique index for the character-name race), is security-sensitive, and is deeply coupled to ASP.NET Identity; its schema is stable so there is no recurring migration tax to escape. SQLite (a single embedded file, no server) captures the whole no-DB-server benefit at zero risk, and removing the second provider also ends the dual-provider migration ceremony.

Scope

  • Remove PostgresAuthDbContext + its Data/Migrations/Postgres/ tree.
  • Drop the Npgsql.EntityFrameworkCore.PostgreSQL package.
  • Program.cs: remove the Database:Provider switch — always register SQLite (AddDbContext<AuthDbContext, SqliteAuthDbContext> + Database.Migrate() unchanged).
  • Remove the Database:Provider config from appsettings.
  • just migrate-auth: generate a single SQLite migration (drop the Postgres line).
  • Docs: CLAUDE.md (Persistence), docs/architecture.md, docs/deploy.md, README.md — stop claiming dual-provider / Postgres-in-prod.

Keep AuthDbContext (abstract model) + SqliteAuthDbContext (concrete, existing migrations) as-is — no migration regeneration, so the existing SQLite migrations and the :memory: test factory keep working untouched.

Definition of Done

  • A repo-wide grep for postgres/npgsql/Database:Provider (excluding this issues history) returns nothing outside deleted files.
  • just migrate-auth <Name> produces exactly one migration under Data/Migrations/Sqlite and nothing else.
  • Auth boots, Database.Migrate() creates/updates isommo-auth.db, silent-account-creation + character-uniqueness still work (all Auth integration tests green against SQLite :memory:).
  • Startup no longer reads a Database:Provider key; removing it from config changes nothing.
  • CLAUDE.md, docs/architecture.md, docs/deploy.md, README.md describe Auth as SQLite-only (no dual-provider claims).
Decision (design review): Auth stays on EF Core but commits to **SQLite only**. Moving Auth to binary files was rejected — Auth genuinely queries by username, needs atomic world-wide uniqueness (it already relies on the DB unique index for the character-name race), is security-sensitive, and is deeply coupled to ASP.NET Identity; its schema is stable so there is no recurring migration tax to escape. SQLite (a single embedded file, no server) captures the whole no-DB-server benefit at zero risk, and removing the second provider also ends the dual-provider migration ceremony. ## Scope - Remove `PostgresAuthDbContext` + its `Data/Migrations/Postgres/` tree. - Drop the `Npgsql.EntityFrameworkCore.PostgreSQL` package. - Program.cs: remove the `Database:Provider` switch — always register SQLite (`AddDbContext<AuthDbContext, SqliteAuthDbContext>` + `Database.Migrate()` unchanged). - Remove the `Database:Provider` config from appsettings. - `just migrate-auth`: generate a single SQLite migration (drop the Postgres line). - Docs: `CLAUDE.md` (Persistence), `docs/architecture.md`, `docs/deploy.md`, `README.md` — stop claiming dual-provider / Postgres-in-prod. Keep `AuthDbContext` (abstract model) + `SqliteAuthDbContext` (concrete, existing migrations) as-is — no migration regeneration, so the existing SQLite migrations and the `:memory:` test factory keep working untouched. ## Definition of Done - [ ] A repo-wide grep for `postgres`/`npgsql`/`Database:Provider` (excluding this issues history) returns nothing outside deleted files. - [ ] `just migrate-auth <Name>` produces exactly one migration under `Data/Migrations/Sqlite` and nothing else. - [ ] Auth boots, `Database.Migrate()` creates/updates `isommo-auth.db`, silent-account-creation + character-uniqueness still work (all Auth integration tests green against SQLite `:memory:`). - [ ] Startup no longer reads a `Database:Provider` key; removing it from config changes nothing. - [ ] `CLAUDE.md`, `docs/architecture.md`, `docs/deploy.md`, `README.md` describe Auth as SQLite-only (no dual-provider claims).
marco closed this issue 2026-07-18 17:02:17 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo#44
No description provided.