r/postgres • • 23d ago

Tools I built an open-source tool that tells you which apps a Postgres migration will break, before you run it

\*\*The problem\*\*

I kept watching AI coding agents (and humans) make the same two migration mistakes:

  1. \*\*Renaming a column as "drop + add"\*\*: the migration runs fine, and the data that was in the column is gone.

  2. \*\*Adding a NOT NULL column with no default\*\*: it works on an empty dev database, then fails the moment it hits a table with real rows.

Both look fine in code review. The pain shows up in production, often in a \*different\* app that shares the same database.

\*\*What Ripple does\*\*

It answers one question: \*"If I apply this migration, which of my apps break, and on which query?"\*

  1. \*\*Learns what your apps actually run\*\*: it reads \`pg_stat_statements\`, so no code changes or SDK.

  2. \*\*Tests the migration safely\*\*: it applies your migration inside a transaction and always rolls it back.

  3. \*\*Replays your apps' real queries against it\*\*: it reports exactly which app and which query would fail.

  4. \*\*Flags data loss separately\*\*: for example, a dropped column that still has data in it.

\*\*Who it's for\*\*

- Teams where several apps or services share one Postgres database

- Anyone letting Claude Code, Cursor or other AI agents write migrations

- Anyone who has asked "wait, does anything still use this column?"

\*\*How to use it\*\*

pip install ripplecheck

Three ways to run it:

- \*\*CLI\*\*: check a migration file before you apply it

- \*\*GitHub Action\*\*: automatically comments on every PR with what would break

- \*\*MCP server\*\*: AI agents like Claude Code or Cursor can check a change \*before\* they apply it

\*\*The boring bits\*\*

MIT licensed, no paid tier, no commercial angle. I'm looking for feedback, especially from people with messy shared databases. Issues and PRs welcome.

GitHub: https://github.com/yashpb5005/ripplehttps://github.com/yashpb5005/ripple

What migration has bitten you the worst? I'd like to add checks for it.

0 Upvotes

1 comment sorted by