Know what your migration
will do to production
83 safety rules powered by the real PostgreSQL parser. Lock analysis, risk scoring, auto-fix, and safe alternatives — all without touching your database. Works as a CLI, GitHub Action, and Node.js library.
Install in 30 seconds
npx migrationpilot analyze migrations/*.sql83 rules (80 free). Pro adds production context.
MigrationPilot — migrations/002_alter_users.sql Risk: RED Score: 80/100 ┌───┬────────────────────────────────────────┬──────────────────┬────────┬───────┐ │ # │ Statement │ Lock Type │ Risk │ Long? │ ├───┼────────────────────────────────────────┼──────────────────┼────────┼───────┤ │ 1 │ CREATE INDEX idx_users_email ON us... │ SHARE │ RED │ YES │ │ 2 │ ALTER TABLE users ADD CONSTRAINT u... │ ACCESS EXCLUSIVE │ RED │ YES │ └───┴────────────────────────────────────────┴──────────────────┴────────┴───────┘ Violations: ✗ [MP001] CRITICAL CREATE INDEX blocks writes on "users". Use CREATE INDEX CONCURRENTLY. Why: Blocks all INSERT/UPDATE/DELETE for the entire duration of index creation. Safe alternative: CREATE INDEX CONCURRENTLY idx_users_email ON users (email); ✗ [MP027] CRITICAL UNIQUE constraint without USING INDEX scans full table under ACCESS EXCLUSIVE. ⚠ [MP004] WARNING No SET lock_timeout before DDL on "users". Auto-fixable: run with --fix 83 rules checked in 23ms
Everything you need for safe migrations
Static analysis powered by the real PostgreSQL parser (libpg-query). No regex heuristics. PG-version-aware advice.
Lock Analysis
Know exactly which PostgreSQL lock each DDL statement acquires — SHARE through ACCESS EXCLUSIVE — and whether it blocks reads, writes, or both.
80 Safety Rules
From missing CONCURRENTLY to type narrowing. Catches the patterns that cause production outages. More rules than any competitor.
Auto-fix
12 rules can be automatically fixed with --fix. Missing CONCURRENTLY, lock_timeout, statement_timeout, NOT VALID, IF NOT EXISTS, VARCHAR→TEXT, TIMESTAMP→TIMESTAMPTZ — applied in-place.
Risk Scoring
RED / YELLOW / GREEN scores (0-100) based on lock severity, table size, and query frequency. Production context powers Pro scoring.
GitHub Action
Posts safety reports as PR comments. Auto-updates on each push. SARIF output for GitHub Code Scanning integration.
14 Framework Detection
Auto-detects Prisma, Django, Rails, Flyway, Alembic, Knex, TypeORM, Drizzle, Sequelize, goose, dbmate, Sqitch, Liquibase, Ecto.
Watch Mode
Watch migration files and re-analyze on change. Plus git pre-commit hook integration for catching issues before they leave your machine.
Config + Presets
5 built-in presets (recommended, strict, ci, startup, enterprise). Per-rule severity overrides, custom thresholds, inline disable comments, .migrationpilotrc.yml.
6 Output Formats
Text, JSON (versioned schema), SARIF v2.1.0, Markdown, quiet (gcc-style), verbose. Pipe from stdin, output to any CI system.
Real incidents MigrationPilot prevents
These production outages happened to well-funded engineering teams. Each one would have been caught by a single MigrationPilot rule.
GoCardless
Foreign key constraint locked both parent and child tables during a migration
MP069warn-fk-lock-both-tablesGitHub
Schema migration acquired ACCESS EXCLUSIVE lock on a hot table
MP004require-lock-timeoutResend
Accidental DROP in production migration without safety checks
MP026ban-drop-table83 rules. Zero false positives.
Built from real production incidents. More free rules than Squawk (31) and Atlas (~15). Every rule catches a specific dangerous pattern.
Lock Safety
Data Safety
Best Practices
Simple, transparent pricing
83 rules (80 free). Pro when you need production context.
Free
Static analysis for every team
- 77 safety rules
- CLI + GitHub Action
- 3 production analyses / month
- 6 output formats (text, JSON, SARIF, markdown)
- Auto-fix (12 rules)
- PR comments
- Config file + 5 presets
- Watch mode + pre-commit hooks
- 14 framework auto-detection
Pro
Production context for critical apps
- Everything in Free
- Unlimited production analyses
- Production context queries (pg_stat_*, pg_class)
- Table size + query frequency scoring
- 3 production rules (MP013, MP014, MP019)
- Affected queries in PR comments
- Enhanced risk scoring (0-100)
- Priority support
Team
For growing teams with shared workflows
- Everything in Pro
- Up to 10 seats
- Team license management
- Custom rules engine (plugin API)
- Shareable config presets
- Audit logging
- Priority email support
Enterprise
For large teams and compliance
- Everything in Team
- Unlimited seats
- SSO / SAML
- Air-gapped deployment
- Dedicated support engineer
- Custom integrations
- SLA with guaranteed response times
Stop shipping dangerous migrations
Add MigrationPilot to your CI in 30 seconds. 83 rules catch lock issues before they reach production.
# .github/workflows/migration-check.yml
- uses: mickelsamuel/migrationpilot@v1
with:
migration-path: "migrations/*.sql"
fail-on: critical