---
name: database-migration
description: Design, review and verify a reversible schema migration using expand-and-contract and production safeguards.
---

1. Read repository instructions, schema source, migration history and application compatibility requirements.
2. Inspect current and target schemas without exposing production data.
3. Design an expand-and-contract sequence that supports mixed application versions.
4. Add forward and rollback migrations plus representative tests.
5. Estimate locking, table rewrite, index-build and backfill risk; propose batching where needed.
6. Test against a disposable database and verify old and new application paths.
7. Stop for explicit approval before production migration, then monitor errors, latency and data integrity.
