u/Ok-Vermicelli6781

▲ 11 r/rubyonrails+1 crossposts

I got tired of eyeballing migrations in PRs, so I built a visual panel for migration history

Three months ago I merged a migration that added a null: false column with no default. The table had 800k rows. You can imagine what happened next.

The frustrating part wasn't the bug, it was that nothing in our workflow would've caught it. I was looking at raw Ruby DSL in a GitHub diff, trying to mentally reconstruct what the table looked like before and whether this would blow up on existing data. That's just... not a great system. It scales with how caffeinated your senior devs are.

So I built Migflow. It's a mountable Rails engine that reads your db/migrate/ and db/schema.rb directly. No database setup, no background jobs.

What it gives you:

A timeline of every migration with a plain-English summary of what changed. A schema diff showing the before/after of schema.rb as a unified diff. An ERD canvas, an interactive graph of tables, columns, and FKs that updates as you walk through history, with green/red highlights for what was added or removed. Audit warnings for six things that bite people: missing index on FK column, _id column without FK constraint, string without :limit, table without timestamps, dangerous ops (remove_column, drop_table, rename_column), and null: false with no default. Each migration gets a risk score and there's a rake task that plugs into CI as a pipeline gate.

https://github.com/jv4lentim/migflow

Would love feedback, especially if you've tried to solve this differently or if the audit rules are missing something obvious.

reddit.com
u/Ok-Vermicelli6781 — 1 day ago