An already-applied migration file is not editable. Have the agent append a new migration instead of rewriting history, or local, staging and production drift apart.
Dropping a column, changing a type, adding NOT NULL, renaming a table: a human picks the plan. The agent can draft the script and the rollback, but ordering, staged rollout and whether you need dual writes depend on data volume someone actually knows.
Do not wire a production database into the agent's default config. A read-only account is enough to inspect schema; writes go through a reviewed PR and your normal release path, not an MCP apply.
Safe work to hand over: read the schema, draft the migration, generate the rollback, dry-run it on a throwaway database and paste the log. Keep the real execution with people and the pipeline.