fix: restore-db.sh takes the target database name #4

Merged
dan-claude-bot merged 1 commit from fix/restore-db-target-db into main 2026-07-12 09:09:14 +00:00
dan-claude-bot commented 2026-07-11 20:25:17 +00:00 (Migrated from github.com)

Summary

restore-db.sh piped into psql -U postgres with no -d, so unless the app database is literally named postgres, restored objects land in the maintenance DB. This was flagged as finding #6 in the incubator prod-migration plan's final review, with the fix owed before the Task 9 restore drill.

  • Fourth required argument <db-name>, passed as -d (the error hint shows the psql -lqt command that lists candidates)
  • -v ON_ERROR_STOP=1 so a mid-stream failure aborts the restore instead of continuing silently
  • Confirmation prompt now names the target database as well

Call sites (incubator runbooks restore-drill.md / prod-migration.md) gain the fourth argument — infra-repo doc patch prepared separately.

🤖 Generated with Claude Code

## Summary `restore-db.sh` piped into `psql -U postgres` with no `-d`, so unless the app database is literally named `postgres`, restored objects land in the maintenance DB. This was flagged as finding #6 in the incubator prod-migration plan's final review, with the fix owed before the Task 9 restore drill. - Fourth **required** argument `<db-name>`, passed as `-d` (the error hint shows the `psql -lqt` command that lists candidates) - `-v ON_ERROR_STOP=1` so a mid-stream failure aborts the restore instead of continuing silently - Confirmation prompt now names the target database as well Call sites (incubator runbooks `restore-drill.md` / `prod-migration.md`) gain the fourth argument — infra-repo doc patch prepared separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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: heavy-duty/cast#4
No description provided.