migration-strategist
Migration Strategist Protocol
This skill focuses on taking a database from State A to State B without causing downtime, locks, or data loss in production. Direct ALTER TABLE operations on large tables are dangerous and often require a multi-step rollout.
Core assumption: You cannot lock the table. You cannot break the old version of the application while the new version is deploying.
0. Context Intake
Before designing, make sure you have the inputs below. Read the previous workflow step's artifact first if it exists. Ask only for what is missing, in a single message, and state any assumption you make instead of blocking.
- Current and target schema, or
schema-diff-output.json. - Table sizes, write traffic, and acceptable lock time.
- Deployment model (rolling deploys, number of app versions live at once) and migration tool (Prisma, Flyway, Alembic, raw SQL).
1. The Zero-Downtime Pipeline
When asked "How do I rename this column?" or "How do I split this table?", standard ALTER TABLE RENAME breaks the app.
Always enforce a backward-compatible migration strategy: