Product / for PostgreSQL

Postgres Migration Safety Auditor.

Catch the database migration that locks or rewrites your production table, before it ships. A static auditor for Flyway and Liquibase that flags each production hazard with the exact reason and the safe rewrite, run as a CLI, a CI gate, or a Claude Code skill. It never connects to your database.

Auditor output flagging a SET NOT NULL migration as a blocker, with the safe rewrite
What it catches

Most migration reviews are a generalist reading a diff. That misses the specific ways a PostgreSQL migration takes your site down. The auditor checks 33 rules, parses your actual migration with the real PostgreSQL parser (not regex), and flags each hazard with an official citation:

The free cheatsheet

The ten schema changes most likely to take a live PostgreSQL database down, and the safe rewrite for each. A migration is dangerous when it holds a strong lock (ACCESS EXCLUSIVE blocks reads and writes; SHARE blocks writes) while it scans or rewrites a big table. On a small table you never notice; on a hot production table it is an outage. Flyway and Liquibase wrap each migration in a transaction by default, which matters for several of these.

  1. CREATE INDEX (without CONCURRENTLY) takes a SHARE lock that blocks every write for the whole build. Safe: CREATE INDEX CONCURRENTLY ... outside a transaction.
  2. SET NOT NULL (directly) scans the whole table under ACCESS EXCLUSIVE. Safe: ADD CONSTRAINT c CHECK (col IS NOT NULL) NOT VALID, then VALIDATE CONSTRAINT c, then SET NOT NULL (scan skipped on PG12+).
  3. ADD CHECK (without NOT VALID) scans the whole table under ACCESS EXCLUSIVE. Safe: add it NOT VALID, then VALIDATE.
  4. ADD FOREIGN KEY (without NOT VALID) validates every row while holding a write-blocking lock on both tables. Safe: add it NOT VALID, then VALIDATE.
  5. ADD COLUMN with a volatile DEFAULT or SERIAL rewrites the entire table (gen_random_uuid(), random(), SERIAL). now() / CURRENT_TIMESTAMP is safe. Safe: add nullable, backfill in batches, then SET DEFAULT.
  6. ALTER COLUMN ... TYPE rewrites the table, except binary-coercible changes like varchar to text. Safe: new column, backfill, swap, drop the old one.
  7. ADD PRIMARY KEY / UNIQUE (directly) builds the index under ACCESS EXCLUSIVE. Safe: CREATE UNIQUE INDEX CONCURRENTLY, then ADD CONSTRAINT ... USING INDEX.
  8. Backfills in the wrong order or one giant statement fail or bloat. Safe: add nullable, batch-backfill, validate, then tighten, across separate deploys.
  9. Lock-taking DDL with no lock_timeout can stall traffic queued behind it. Safe: SET lock_timeout = '2s'; before risky DDL, and retry on timeout.
  10. Destructive operations (DROP / TRUNCATE / DROP COLUMN) are irreversible and break rolling deploys. Safe: expand/contract, stop referencing the object first, drop it in a later deploy.

Gotcha: CREATE INDEX CONCURRENTLY cannot run inside a transaction, which is how Flyway and Liquibase wrap migrations by default, so a bare concurrent-index migration errors out. Disable the wrapping transaction for that one migration. The auditor catches this too, and 22 more rules beyond these ten.

What you get

The tool

The Claude Code skill and the CLI, built on libpg_query (the parser PostgreSQL itself uses), with all 5 platform binaries bundled. Python 3 only, nothing to pip install. Linux, macOS, Windows.

Built for CI

Machine-readable JSON against a documented schema, exit codes keyed to severity so it drops into a pipeline, and a config file for your Postgres version and large-table threshold.

Cited and tested

Every rule points at an official Postgres, Flyway, or Liquibase source. Ships with a 202-case worked-example regression suite you can run yourself.

The rule catalog: 33 rules across Flyway and Liquibase Machine-readable JSON output and a CI exit code that fails the build on a blocker

By design, pure static analysis: it reads the migration text and never connects to your database, so it needs no credentials and runs identically in CI or on your laptop, with nothing leaving your machine. It reasons from the Postgres version and row counts you give it (or auto-filled via the optional local read-only introspection), and catches the common, high-impact hazards a diff review misses.

Get it

Ship migrations without the 3am outage.

One-time purchase, €14.99. Sold through Polar (merchant of record, VAT handled). Instant download, all platforms.