#3 feat(db): provision Postgres and add score schema migration

Unito
jschoubben ha unito 1 commit da feat/postgres-provision a main 1 mese fa
jschoubben 1 mese fa ha commentato

Summary

  • module.yml: adds a requires: block for a postgres database provision named txt_game_scores, with a full env_map covering host/port/user/password/database; matching empty env keys added so env-sync populates them after provisioning
  • migrations/package.json: ESM package with pg dep and typescript/@types/node/@types/pg devDeps
  • migrations/provision/postgres/000-init-scores.ts: creates players and games tables with idempotent IF NOT EXISTS DDL, plus two supporting indexes (scoreboard sort, player history lookup)

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

What happens after merge

  1. Pipeline rebuilds the module image
  2. Coordinator dispatches cmd.module.provision → hypothalamus creates txt_game_scores DB on ace's postgres, writes credentials to mesh_provisions + module_env
  3. Env-sync regenerates the txt-game .env
  4. Migration runner executes 000-init-scores.ts, connects with PROVISION_* env, creates players + games tables
  5. txt-game restarts — still serving the existing in-memory game unchanged

Test plan

  • Review module.yml diff: requires: entry present, version: unchanged at 1.0.0, no hardcoded credentials
  • Review migrations/package.json: "type": "module", pg in deps, typescript/@types/node/@types/pg in devDeps
  • Review migrations/provision/postgres/000-init-scores.ts: uses PROVISION_* env vars, all DDL guarded with IF NOT EXISTS
  • Confirm server.mjs, docker-compose.yml, Dockerfile are untouched in this diff
  • After merge + pipeline: verify mesh_provisions shows txt-game postgres provision on ace, and txt_game_scores DB contains players + games tables
  • Confirm https://txt.zurag.be still serves the number-guessing game unchanged

Task: 3dab55e3-9792-47a0-a4a6-ba7757517314

## Summary - `module.yml`: adds a `requires:` block for a `postgres` `database` provision named `txt_game_scores`, with a full `env_map` covering host/port/user/password/database; matching empty env keys added so env-sync populates them after provisioning - `migrations/package.json`: ESM package with `pg` dep and `typescript`/`@types/node`/`@types/pg` devDeps - `migrations/provision/postgres/000-init-scores.ts`: creates `players` and `games` tables with idempotent `IF NOT EXISTS` DDL, plus two supporting indexes (scoreboard sort, player history lookup) Server code, `docker-compose.yml`, and `Dockerfile` are **unchanged** — server integration is deferred to the follow-on child task. ## What happens after merge 1. Pipeline rebuilds the module image 2. Coordinator dispatches `cmd.module.provision` → hypothalamus creates `txt_game_scores` DB on ace's postgres, writes credentials to `mesh_provisions` + `module_env` 3. Env-sync regenerates the txt-game `.env` 4. Migration runner executes `000-init-scores.ts`, connects with `PROVISION_*` env, creates `players` + `games` tables 5. txt-game restarts — still serving the existing in-memory game unchanged ## Test plan - [ ] Review `module.yml` diff: `requires:` entry present, `version:` unchanged at `1.0.0`, no hardcoded credentials - [ ] Review `migrations/package.json`: `"type": "module"`, `pg` in deps, `typescript`/`@types/node`/`@types/pg` in devDeps - [ ] Review `migrations/provision/postgres/000-init-scores.ts`: uses `PROVISION_*` env vars, all DDL guarded with `IF NOT EXISTS` - [ ] Confirm `server.mjs`, `docker-compose.yml`, `Dockerfile` are untouched in this diff - [ ] After merge + pipeline: verify `mesh_provisions` shows txt-game postgres provision on ace, and `txt_game_scores` DB contains `players` + `games` tables - [ ] Confirm https://txt.zurag.be still serves the number-guessing game unchanged Task: 3dab55e3-9792-47a0-a4a6-ba7757517314
The pull request has been merged as 4a6ae87ed3.
Effettua l'accesso per partecipare alla conversazione.
Nessuna etichetta
Nessuna milestone
No Assignees
1 Partecipanti
Data di scadenza

Nessuna data di scadenza impostata.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
Annulla
Salva
Non ci sono ancora contenuti.