rails/rails — pull request #8177 by marcandre (2012-11-11 20:00:23+00:00)
Title: Migration reversible

The commit of this PR builds on those of #7627, but the need they both fulfill is independent. Both functionalities can be accepted/rejected independently.

It is currently impossible to create a `change` migration that has a some data processing that rely on schema changes. Indeed, when migrating down, the schema modifying methods will be recorded and only played back (inverted) *after* the data processing took place.

This PR aims at providing a mechanism to process data at the right moment and conditionally of the direction. Please see the documented example in https://github.com/marcandre/rails/commit/migration_reversible