OctoWiki
Memory Appendix

No Running Migrations

Never run migrations yourself — write them, let the user apply

Source memory file: feedback_no_running_migrations.md · Category: Feedback / working-preference This is a verbatim dump of Claude's persistent memory for the Octopus project. Rendered inside a code block so nothing is altered.

---
name: feedback_no_running_migrations
description: "Never run migrations yourself — write them, let the user apply"
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 52ba8573-fbaa-485f-85e6-7e487f5f247e
---

Never run database migrations or seeds yourself. Banned commands (do NOT run, ever): `bun run migrate:local`, `bun run migrate:remote`, `bun run db:seed`, `bun run db:seed:remote`, `bun run db:reset`, `wrangler d1 migrations apply`, `wrangler d1 execute ... --file`, `go run main.go migrate up/down`, `goose up/down`. The user gave explicit, repeated, angry correction on this — treat it as a hard stop equal to the no-INSERT/UPDATE/DELETE rule.

**The trap that keeps catching me:** I bundle `migrate:local`/`db:seed` into a "reset to clean state" or "verify build" Bash command reflexively — often chained with harmless `go build`/`tsc`. STItch them apart. Before running ANY Bash command, scan it for the banned substrings above; if present, do not run it — output the command for the user to run instead. A migrate/seed is never "cleanup" I get to do myself, even to undo my own test mutations.

**Why:** Applying migrations/seeds mutates shared/stateful DB — same class as the no-INSERT/UPDATE/DELETE rule. The user stays in control of DB state.

**How to apply:** Write the migration file and seed SQL, run `tsc`/`go build`/`go vet` to verify it compiles, then hand off — print the exact `bun run migrate:local && bun run db:seed` (or Goose) command for the user to run. Do NOT auto-apply to verify. If end-to-end verification needs a migrated/seeded DB (e.g. contract tests against mocky), ASK the user to apply + start the server first, or note verification is pending their apply. If I mutated a local DB during testing, do NOT reset it myself — tell the user the reset command and let them decide.

Related: [[feedback_no_git_commands.md]] and the DB-safety critical rule in MEMORY.md.