Turn a risky schema change into a repeatable runbook
Schema migrations are one of the highest-risk things you can do to a production system: get the ordering wrong, skip a backfill, or forget a rollback and you can corrupt data or lock a table for minutes. This builder structures the change into a runbook — pre-checks, steps, validation, and rollback — so the plan is reviewable before anyone runs it.
How it works
You describe the migration name, target table, and engine, then list pre-migration checks, the forward SQL steps, validation queries, and rollback SQL. The tool assembles a Markdown runbook with numbered phases following the expand-and-contract mindset: verify preconditions, apply changes in order, validate the result, and keep a tested rollback ready. The estimated-duration field reminds you to rehearse on staging so the production window is realistic. Nothing is executed — the output is a document you paste into your deployment process.
Tips and example
- Prefer additive steps first:
ALTER TABLE users ADD COLUMN email_verified BOOLEAN DEFAULT false;is safe and non-locking on most engines. - Backfill in batches for large tables to avoid long locks, e.g. update 10,000 rows per statement in a loop.
- Write validation queries that compare counts before and after, such as
SELECT count(*) FROM users WHERE email_verified IS NULL;. - Keep the rollback in the same plan and test it on staging — an untested rollback is not a rollback.