Rails migration management - best practices?

migration, ruby, ruby-on-rails

Solution

I tend to edit the original migration as long as it is a) the last migration and b) not in source control. This presents a clean migration path for all other consumers of the code. The important thing is that your migrations should be able to run without error from whatever database state is the earliest that you can expect to encounter.

Problem

What are best practices for migration management? For instance, when debugging a migration, do you edit the original migration or add an edit migration before committing to the repository? Thanks!

Original source