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

Merged
marco merged 1 commit from chore/auth-sqlite-only into main 2026-07-18 17:02:17 +02:00
Owner

Closes #44.

Auth commits to SQLite only (a single embedded file, no server) instead of the dual-provider setup. Design review concluded that moving Auth to binary files was not worth it (queries by username, needs atomic world-wide uniqueness, security-sensitive, deeply coupled to ASP.NET Identity, stable schema so no migration tax to escape) — but the second DB provider was pure overhead, so dropping Postgres captures the whole no-DB-server benefit at zero risk.

  • Removed PostgresAuthDbContext + its Data/Migrations/Postgres/ tree and the Npgsql package.
  • Program.cs: removed the Database:Provider switch — always SQLite (Database.Migrate() unchanged).
  • Removed the Database:Provider config key.
  • just migrate-auth: one SQLite migration (verified it generates exactly one, no Postgres).
  • Kept AuthDbContext (abstract) + SqliteAuthDbContext (concrete, existing migrations) — no migration regeneration, so the :memory: test factory and existing migrations work untouched.
  • Docs updated: CLAUDE.md, docs/architecture.md (also fixed a stale GameDbContext mention), docs/deploy.md, README.md.

Whole suite green (Auth 12/12 on SQLite :memory:), 0 warnings, csharpier clean.

Definition of Done

  • No postgres/npgsql/Database:Provider references remain (only a historical note in architecture.md).
  • just migrate-auth <Name> produces exactly one SQLite migration, no Postgres.
  • Auth boots, Database.Migrate() creates isommo-auth.db; silent account creation + character uniqueness still pass (Auth integration tests green on SQLite :memory:).
  • Startup no longer reads Database:Provider.
  • CLAUDE.md, docs/architecture.md, docs/deploy.md, README.md describe Auth as SQLite-only.
Closes #44. Auth commits to **SQLite only** (a single embedded file, no server) instead of the dual-provider setup. Design review concluded that moving Auth to binary files was **not** worth it (queries by username, needs atomic world-wide uniqueness, security-sensitive, deeply coupled to ASP.NET Identity, stable schema so no migration tax to escape) — but the second DB provider was pure overhead, so dropping Postgres captures the whole no-DB-server benefit at zero risk. - Removed `PostgresAuthDbContext` + its `Data/Migrations/Postgres/` tree and the `Npgsql` package. - Program.cs: removed the `Database:Provider` switch — always SQLite (`Database.Migrate()` unchanged). - Removed the `Database:Provider` config key. - `just migrate-auth`: one SQLite migration (verified it generates exactly one, no Postgres). - Kept `AuthDbContext` (abstract) + `SqliteAuthDbContext` (concrete, existing migrations) — no migration regeneration, so the `:memory:` test factory and existing migrations work untouched. - Docs updated: `CLAUDE.md`, `docs/architecture.md` (also fixed a stale `GameDbContext` mention), `docs/deploy.md`, `README.md`. Whole suite green (Auth 12/12 on SQLite `:memory:`), 0 warnings, csharpier clean. ## Definition of Done - [x] No `postgres`/`npgsql`/`Database:Provider` references remain (only a historical note in architecture.md). - [x] `just migrate-auth <Name>` produces exactly one SQLite migration, no Postgres. - [x] Auth boots, `Database.Migrate()` creates `isommo-auth.db`; silent account creation + character uniqueness still pass (Auth integration tests green on SQLite `:memory:`). - [x] Startup no longer reads `Database:Provider`. - [x] `CLAUDE.md`, `docs/architecture.md`, `docs/deploy.md`, `README.md` describe Auth as SQLite-only.
chore(auth): drop the Postgres provider, run SQLite only
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m55s
96e8ed25c3
Auth commits to SQLite (a single embedded file, no server) instead of a
dual-provider setup. Removes PostgresAuthDbContext + its migrations, the Npgsql
package, and the Database:Provider switch — startup always uses SQLite and runs
Database.Migrate(). Binary files were considered for Auth and rejected: it queries
by username, needs atomic world-wide uniqueness (it relies on the DB unique index
for the character-name race), and is security-sensitive. Closes #44.
marco merged commit c51a6a40b3 into main 2026-07-18 17:02:17 +02:00
marco deleted branch chore/auth-sqlite-only 2026-07-18 17:02:17 +02:00
Sign in to join this conversation.
No reviewers
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!45
No description provided.