2 Commits
Author SHA1 Message Date
Warre (hal-developer) 1e7772ad29 fix(db): grant app user permissions on players and games tables
PostgreSQL 15+ revokes CREATE from non-superusers in public schema by default.
Child 1's migration created the tables as postgres superuser, leaving the
txt_game_scores app user with no privileges — causing "permission denied"
on every request in production.

Adds a numbered provision migration to GRANT SELECT/INSERT/UPDATE on players
and games, plus USAGE/SELECT on games_id_seq, to the app user.

Task: d1c49d59-57bd-4eba-9e22-f25a04157ad4
2026-07-09 19:46:14 +02:00
jschoubben cbec696c59 feat(db): provision Postgres and add score schema migration
Wire in the txt_game_scores database provision and create the
players/games tables via a provision-scoped migration so Child 2
can implement the server-side score persistence.

- module.yml: requires postgres database (txt_game_scores) with
  env_map for host/port/user/password/name; empty env keys added
  so env-sync populates them after provisioning
- migrations/package.json: ESM, pg + typescript devdeps
- migrations/provision/postgres/000-init-scores.ts: creates
  players and games tables with idempotent IF NOT EXISTS guards
  and two supporting indexes (scoreboard sort, history lookup)

Server code, Dockerfile, and docker-compose.yml are unchanged —
server integration is deferred to the follow-on child task.

Task: 3dab55e3-9792-47a0-a4a6-ba7757517314
2026-07-09 18:51:18 +02:00