- Home
- Skills
- Data & Databases
- SaaS Database Migration Risk Analyzer
More screenshots
Works with the AI Agents you already use
SaaS Database Migration Risk Analyzer
A senior database reliability engineer for auditing schema changes, detecting locks, and planning safe migrations.
$34.99
SaaS Database Migration Risk Analyzer
Example session with this skill installed
Analyze this Postgres 15 migration: adding a NOT NULL column 'user_type' with a default value to the 'accounts' table which has 5 million rows. Use an expand-migrate-contract strategy.
- Read your context and instructions
- Compiled the saas database migration
The migration of the accounts table involves a high-risk metadata lock during the column addition and a potentially long-running data update for existing rows.
1. Migration Overview
This migration adds a NOT NULL column to a 5M row table in PostgreSQL 15. While Postgres 11+ handles DEFAULT values efficiently, the application compatibility during a rolling deploy requires a multi-stage approach to avoid write failures.
2. Schema Comparison
| Object | Current state | Proposed state | Change type | Risk |
|---|---|---|---|---|
accounts.user_type | Does not exist | VARCHAR(50) NOT NULL | ADD | Medium (Locking) |
3. Destructive Change Detection
- Finding: Adding
NOT NULLto an existing column. - Severity: High (Application Compatibility).
Impact: Old application versions will attempt to insert rows without this column, causing null value violates not-null constraint errors.
7. Proposed Migration Script
-- STAGE 1: Add column as nullable
ALTER TABLE accounts ADD COLUMN user_type VARCHAR(50);
-- STAGE 2: Backfill data in batches to avoid replication lag
-- Execute via application task or background worker
UPDATE accounts
SET user_type = 'standard'
WHERE id IN (SELECT id FROM accounts WHERE user_type IS NULL LIMIT 5000);
-- STAGE 3: Add constraint after backfill is verified
ALTER TABLE accounts ALTER COLUMN user_type SET NOT NULL;
10. Deployment Runbook
- Preflight: Verify disk headroom for WAL growth during backfill.
- Execution: Apply Stage 1. Deploy code that handles null
user_type. - Monitoring: Track
pg_stat_activityfor long-held AccessExclusiveLocks. - Validation:
SELECT count(*) FROM accounts WHERE user_type IS NULL;must return 0 before Stage 3.
Next steps
- Provide the application-level query patterns to check index requirements for the new column.
- Verify if 'standard' is the correct business logic default for all 5M historical rows.
Connects securely to your tools. The creator never sees your data.
About this skill
Database migrations are high-stakes operations where a single locking index or dropped column can cause data loss or extended outages. This skill acts as a senior database reliability engineer to audit schema changes before they hit production.
What it does
- Detects destructive operations such as table drops, type narrowing, or lossy casts that threaten data integrity.
- Analyzes engine-specific locks to predict downtime risks and resource spikes based on specific database versions.
- Evaluates application compatibility to ensure rolling deployments do not break when old code meets the new schema.
- Generates safe migration scripts including idempotent backfills, batching strategies, and transaction boundaries.
- Designs rollback strategies by distinguishing between fully reversible changes and those requiring compensating actions.
How it works
- Scope definition: The user provides the database engine, version, current schema, and proposed migration files.
- Schema comparison: The agent generates a structured diff of tables, constraints, and indexes.
- Risk assessment: It classifies findings from Low to Critical based on locking behavior and data loss potential.
- Validation design: It produces a pre-deployment runbook with specific integrity checks and go/no-go criteria.
Frameworks & tools
Works with any major SQL engine including PostgreSQL, MySQL, SQL Server, and Oracle. It understands ORM behaviors from tools like Prisma, TypeORM, SQLAlchemy, and Django Migrations.
Why this beats prompting it yourself
Generic prompts often ignore the nuance of engine-specific locking or the "expand-migrate-contract" pattern needed for zero-downtime deploys. This skill enforces a 10-step reliability workflow that accounts for replication lag, WAL growth, and application version overlap.
Use cases
- Reviewing a complex PR that renames columns in a high-traffic production table.
- Planning a multi-stage migration for adding a
NOT NULLconstraint to a million-row table. - Auditing third-party ORM-generated SQL for hidden
ALTER TABLElocks.
Known limitations
Does not execute scripts or connect to live databases. Risk estimates are based on provided schema and volume data rather than real-time telemetry.
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 execute SQL or connect to live DBs. Requires manual input of schema/volume metadata. Rollback scripts cannot recover data lost via DROP commands.
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 16 days ago