There’s a Ruby gem called strong_migrations that does this. It’s fantastic and I include it on all of my Ruby projects.
The mere presence of it on the dev workflow keeps your developers thinking about these types of issues as well, which goes a long way.