From 21a99853c1ef8a8895ae0bbf89ff3b44ef7a0355 Mon Sep 17 00:00:00 2001 From: JohnnyT Date: Sun, 11 Oct 2026 02:18:05 -0600 Subject: [PATCH] Names how to drop leftover test databases Each checkout's test database stays on the local server after the checkout is removed, and the old shared statifier_persistence_test database stays too. CLAUDE.md now says how to list them by their prefix and drop the ones no checkout uses, and how to do it through the docker compose db service. A paragraph rather than a mix alias, decided by the conductor under a standing consent, 2026-10-10. CLAUDE.md only: no gated path changes, so there is no gate to run and the commit rests on review of the diff. Bead: sp-g2wq --- CLAUDE.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index e65221e..ac82765 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -191,6 +191,27 @@ their own database, created on first run by `test/test_helper.exs`, and can run it at the same time. Never point two checkouts at one database by exporting the same `PGDATABASE` in both; CI sets `PGDATABASE` itself. +Nothing drops these databases: a removed worktree leaves its database on +the local server. Its name cannot be recomputed once the checkout is gone +(the hash covers the full path), so list the test databases by their +prefix and drop the ones (with any `_p` siblings) whose `` names +no checkout still on disk (the host and user are the suite's defaults; +export `PGPASSWORD=postgres` if the server asks for one): + +```bash +psql -h localhost -U postgres -lqt | cut -d '|' -f1 | tr -d ' ' | grep statifier_persistence_test +dropdb -h localhost -U postgres +``` + +The same list shows `statifier_persistence_test` with no suffix: the one +shared local database every checkout used before the names were per +checkout. Drop it the same way unless you export `PGDATABASE` to that name +yourself. The CI database with that name lives in CI's own service +container, not on your server. With the docker compose `db` service and no +local client, run each command inside the container instead +(`docker compose exec db psql -U postgres -lqt`, +`docker compose exec db dropdb -U postgres `). + ## ExQuality (`mix quality`)