An AI coding agent can generate a migration in seconds. It can also choose the shortest path: rename a live column, rebuild an index at the wrong time, or point a reset command at the wrong database. The SQL may look tidy in a pull request while the operational change is unsafe.
The useful boundary is simple: let the agent propose and prove a migration, but do not let it decide when or where production DDL runs. This guide gives you a repeatable workflow for AI coding agent database migrations : plan the change, test it in an isolated database, use an expand-contract rollout, and apply it only through a constrained deployment path.
That is not distrust of the agent. It is how you preserve the advantage of fast implementation without treating production state as a disposable test fixture.
Why a migration needs a different agent policy
Application code is usually easy to roll back: deploy the previous artifact. A schema migration changes shared state.…