Quick Start
Get started with MigrationPilot in under 2 minutes.
Install
Install MigrationPilot globally or use it directly with npx:
# Run without installing npx migrationpilot analyze migration.sql # Or install globally npm install -g migrationpilot migrationpilot analyze migration.sql
Analyze a Migration
Point MigrationPilot at any SQL file. It parses the DDL using the real PostgreSQL parser and checks against 80 safety rules.
# Analyze a single file migrationpilot analyze migrations/001_add_users.sql # Analyze all migrations in a directory migrationpilot check ./migrations # Read from stdin cat migration.sql | migrationpilot analyze --stdin
Understand the Output
MigrationPilot shows a color-coded summary with risk level (GREEN/YELLOW/RED), violation severity (critical/warning), lock types acquired, and safe alternatives for each issue found.
Auto-fix Issues
Some violations can be fixed automatically. Preview changes first with --dry-run:
# Preview fixes migrationpilot analyze migration.sql --fix --dry-run # Apply fixes migrationpilot analyze migration.sql --fix
Add to CI
Add MigrationPilot to your CI pipeline to catch unsafe migrations before merge. See the GitHub Action, GitLab CI, and Bitbucket Pipelines setup guides for detailed instructions.