Safety linting Flyway doesn't have

MigrationPilot vs Flyway

Flyway runs your migrations. MigrationPilot tells you if they're safe to run. 80 static analysis rules catch lock contention, data loss, and downtime risks — before you merge.

npx migrationpilot analyze migrations/
View on GitHub

Different Tools for Different Problems

Flyway

Migration execution engine

  • -Runs SQL migrations in order against your database
  • -Tracks which migrations have been applied (schema_version table)
  • -Java-based — requires JVM on CI runners and developer machines
  • -Configuration via flyway.conf, environment variables, or CLI flags
  • -Does not check whether your DDL is safe to run

MigrationPilot

Migration safety linter

  • +83 rules catch unsafe DDL patterns statically
  • +Lock type analysis — shows exactly which locks each statement takes
  • +Zero config — npx one-liner, no JVM needed
  • +GitHub Action with inline PR annotations
  • +Auto-fix for 12 common issues

They're complementary. Use Flyway to execute your migrations. Use MigrationPilot in CI to lint them before they reach production. MigrationPilot auto-detects Flyway migration directories and versioning patterns.

Feature Comparison

FeatureFlywayMigrationPilot
Primary purposeMigration executionMigration safety linting
DDL safety rulesNone83 rules
Lock type analysisNoYes (per-statement)
Risk scoringNoRED/YELLOW/GREEN
Auto-fixNo12 rules
GitHub ActionCommunityOfficial + inline annotations
SARIF outputNoYes (GitHub Code Scanning)
Runtime requiredJVM (Java 8+)Node.js (or npx)
Configurationflyway.conf + env varsZero-config (optional YAML)
Install size~50MB (JVM + Flyway)npx (zero install)
PostgreSQL parserNo (execution only)Yes (libpg-query)
Schema versioningYes (schema_version table)No (lint only)
Multi-databaseYes (PG, MySQL, Oracle, etc.)PostgreSQL focused
Framework detectionN/A14 frameworks (incl. Flyway)
RLS safetyNoYes (MP057)
Replication safetyNoYes (MP055, MP060)
LicenseApache 2.0 / CommercialMIT

What Flyway Doesn't Catch

Flyway will happily execute any valid SQL. These dangerous patterns pass Flyway validation but cause production incidents:

MP001CREATE INDEX without CONCURRENTLY

Blocks all writes for the entire duration of index creation. On a 50M row table, this can be 10+ minutes of downtime.

Dangerous (Flyway runs this)
CREATE INDEX idx_users_email ON users (email);
Safe (MigrationPilot suggests this)
CREATE INDEX CONCURRENTLY idx_users_email ON users (email);
MP003ADD COLUMN with volatile DEFAULT

Before PG 11, adding a column with a DEFAULT rewrites the entire table under ACCESS EXCLUSIVE lock.

Dangerous (Flyway runs this)
ALTER TABLE orders ADD COLUMN created_at TIMESTAMP DEFAULT now();
Safe (MigrationPilot suggests this)
ALTER TABLE orders ADD COLUMN created_at TIMESTAMP;
-- Backfill in batches, then add default
MP005ADD CONSTRAINT without NOT VALID

Foreign key validation scans the entire table while holding a SHARE ROW EXCLUSIVE lock.

Dangerous (Flyway runs this)
ALTER TABLE orders ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES users(id);
Safe (MigrationPilot suggests this)
ALTER TABLE orders ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES users(id) NOT VALID;
ALTER TABLE orders VALIDATE CONSTRAINT fk_user;
MP007ALTER COLUMN TYPE

Changing a column type rewrites the entire table and all indexes. On large tables this causes extended downtime.

Dangerous (Flyway runs this)
ALTER TABLE users ALTER COLUMN age TYPE bigint;
Safe (MigrationPilot suggests this)
-- Use expand-contract: add new column, backfill, swap

Add MigrationPilot to Your Flyway Workflow

1

Lint Flyway migrations in CI

MigrationPilot auto-detects Flyway's V__*.sql versioning pattern.

# .github/workflows/migration-lint.yml
name: Lint Migrations
on: pull_request
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: mickelsamuel/migrationpilot@v1
        with:
          path: sql/  # Your Flyway migrations directory
2

Or run locally before committing

# Analyze all Flyway migrations
npx migrationpilot analyze sql/

# Auto-fix common issues
npx migrationpilot analyze sql/ --fix --dry-run

# Install pre-commit hook
npx migrationpilot hook install
3

Keep Flyway for execution

MigrationPilot is a linter, not a migration runner. Keep using flyway migrate for execution. MigrationPilot checks your SQL files before Flyway touches the database.

Flyway runs your migrations. MigrationPilot makes them safe.

83 safety rules. Zero config. No JVM required. Add to your Flyway workflow in 30 seconds.