David - Musings of an SRE

Rails 3.1x Migration Change

If you’re on Rails 3.1, you’ll probably notice that the methods in your migration files have changed from ‘up’ and its corresponding ‘down’ to just a simple ‘change’.

So don’t be the surprised the next time you handle migrations.

Rails 3.1 makes migrations smarter by providing a new change method. This method is preferred for writing constructive migrations (adding columns or tables). The migration knows how to migrate your database and reverse it when the migration is rolled back without the need to write a separate down method.

http://guides.rubyonrails.org/migrations.html