Know which migration will lock your biggest table, before you merge it.

Migration Guard is a planned GitHub check for Postgres migrations. Like a linter, it finds the statements that take heavy locks. Unlike a linter, it reads your table sizes, so it can tell an index build on a 40 GB table from the same statement on a 200-row table, and puts the statements that need a fix before merge first.

Status: Early access. The GitHub check is not built yet; the demo runs the rules it will use.

Try it on your migration Join early access

Who it is for

Backend engineers and tech leads who review Postgres migration .sql files in GitHub pull requests.

How it will work

  1. Add the GitHub Action to your repo.
  2. Give it your table sizes: a database role with no access to your tables that reads table statistics from the Postgres catalog, never rows, or a nightly size snapshot from your own job.
  3. On a pull request that changes migration .sql files, read one comment: statements that need a fix before merge come first, each with its lock, what that lock blocks, the table's size and a lower-risk rewrite.

Why not a free linter or an AI reviewer?

A linter in CI (for example Squawk, free and open source)
Checks the SQL text against rules. It cannot see your tables, so a risky statement on a 200-row table and on a 40 GB table get the same warning.
An AI code reviewer
Can explain locks, but cannot see production table sizes from a pull request, and may answer differently from one run to the next. A merge check should give the same answer every time.
Migration Guard
Will use fixed rules that give the same answer every run, plus your table sizes, so statements that need a fix before merge come first and the rest are marked low impact at current size.

See an example

Hand-written illustrations of the report format (the Action is not built yet):

What it will not do

It will never say a migration is "safe". Statements it does not recognise are marked for review. Row counts are estimates from Postgres statistics.

Price

$19 per repo per month early-access price. This is a planned price, not yet charged. Nothing is charged when you join early access.

Free alternative

Squawk is a free open-source linter for Postgres migrations (github.com/sbdchd/squawk). Squawk is a separate project and is not affiliated with us.

Join early access

We store your email, a source tag, your consent and the signup time in Cloudflare D1, to email you about Migration Guard. Privacy

BVL privacy policy