- Home
- Skills
- Data & Databases
- DB Migration Safety Reviewer
Works with the AI Agents 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.
$15
DB Migration Safety Reviewer
Example session with this skill installed
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;
- Read your context and instructions
- Compiled the db migration safety
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.
Connects securely to your tools. The creator never sees your data.
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
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.
• Cannot measure real lock duration or table size without input (assumes large when unknown).
• Advice is version-sensitive — provide PostgreSQL/MySQL/SQLite version when possible.
• Review aid only — not a substitute for staging tests, backups, or DBA review.
• Never connects to or executes against a database.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 20 days ago
Permissions
Read-only review. Does not execute DDL/DML, open DB connections, or apply changes. If auto-detect grants Shell/Write/Network, turn them off.