Works with the AI tools you already use
DB Migration Safety Reviewer
Review schema migrations for lock risk, data loss, backfill cost, and rolling-deploy breakage — get a verdict, safe rewrite, and deploy sequence.
Secure checkout via Stripe
See it in action
You say
Database: PostgreSQL 15 Table size: not provided (production; estimate unknown) Deployment: rolling deploy (no maintenance window) Context: billing service; subscriptions table is hot path
Migration SQL
-- migration_2026_03_12_subscriptions.sql
ALTER TABLE subscriptions ADD COLUMN plan_tier TEXT NOT NULL;
CREATE INDEX idx_subscriptions_account_id ON subscriptions(account_id);
UPDATE subscriptions SET trial_ends_at = created_at + INTERVAL '14 days' WHERE trial_ends_at IS NULL;
ALTER TABLE subscriptions DROP COLUMN old_price_cents;
Your agent does
DB Migration Safety Review
1. Risk Summary
| Database | PostgreSQL 15 | | Statements reviewed | 4 | | Migration Risk Verdict | BLOCK | | Risk Score | 0 / 100 | | Critical / High / Medium / Low | 1 / 3 / 0 / 0 | | Table size assumption | large (not provided) |
3. Risk Findings
MIG-01 CRITICAL lock — ADD plan_tier NOT NULL without DEFAULT → Add nullable/DEFAULT, backfill, then SET NOT NULL MIG-02 HIGH lock — CREATE INDEX blocks writes → CREATE INDEX CONCURRENTLY + verify valid MIG-03 HIGH backfill — Unbatched UPDATE on hot table → Batch 1k–10k with statement_timeout MIG-04 HIGH data-loss — DROP old_price_cents irreversible → Stop reading in code first; drop later
6. Deploy Sequence
Expand → Migrate → Contract (destructive last)
JSON: verdict "BLOCK", risk_score 0 Disclaimer: Review aid; not a substitute for staging tests, backups, or DBA review.
What you get
About this skill
The problem
Schema migrations are the quietest way to cause an outage: table locks, failed NOT NULL adds, irreversible drops, and rolling-deploy breaks when old pods still read a column you just removed. Generic “review this SQL” prompts miss database-specific lock behavior and rarely hand you a safe rewrite.
What it does
DB Migration Safety Reviewer is a production-safety review for DDL/DML migrations. It returns:
- A Migration Risk Verdict: SAFE-TO-SHIP / SHIP-WITH-CAUTION / BLOCK
- A deterministic Risk Score (0–100)
- Severity-ranked findings across lock, data-loss, backfill, compatibility, and rollback
- A safe-execution rewrite for every risky statement (e.g. CONCURRENTLY, batched backfill, expand-migrate-contract)
- Rollback plan + rolling-deploy sequence
- Pre-flight checklist + Migration Review JSON for CI/docs
Frameworks & tools
- PostgreSQL, MySQL, and SQLite behavior differences
- Five-dimension risk model + hard verdict gates
- Common patterns: indexes, type changes, NOT NULL, FK validation, drops, large UPDATEs
- Works from pasted SQL or migration files in your agent
Why this beats prompting it yourself
- Database-aware rules (e.g. Postgres CONCURRENTLY vs MySQL online DDL tools)
- Hard gates so CRITICAL issues force BLOCK — not a soft “maybe fine”
- Safe rewrites, not only warnings
- Rolling-deploy compatibility built into the plan
- Assumes large tables when size is unknown (worst case) and labels assumptions
- Read-only: never executes against your database
Use cases
- Backend engineers shipping migrations under rolling deploys
- DBAs reviewing lock and data-loss risk before a release
- Teams adding indexes without a maintenance window
- Destructive or backfill-heavy changes that need a staged plan
Known limitations
- Cannot measure real lock duration or row counts without that input
- Version-sensitive advice is sharper when you state the DB version
- Not a substitute for staging tests, backups, or DBA review on high-risk production changes
- Does not connect to or execute against any database
How to install
Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean today
- 30-day refund guarantee
- One-time purchase, yours forever
- Secure checkout via Stripe