winton/also_migrate — Issue #8: Configuration for also_migrate seems to break Rails 3.1 migrations
Author: saros
Created: 2011-10-18 13:23:23+00:00
State: open

When trying to upgrade an application to Rails 3.1, the naming scheme of the migration files breaks. Specifically, the timestamp does not appear in the name. Instead of the expected

db/migrate/20111018130243_add_foo_to_user.rb

I get

db/migrate/_add_foo_to_user.rb

If I comment out the block of configuration code for the also_migrate gem, the migration files are properly generated. Uncommenting the same lines recreates the issue.

The code seemed to work properly under Rails 3.0.7, but the issue appears under 3.1.1.

The block of code is:

require 'also_migrate'
AlsoMigrate.configuration = [
{:source => 'questions', :destination => 'question_archives', :add => [['moved_at', :datetime]], :indexes => :id},
{:source => 'answers', :destination => 'answer_archives', :add => [['moved_at', :datetime]], :indexes => :id},
{:source => 'descriptions', :destination => 'description_archives', :add => [['moved_at', :datetime]], :indexes => :id}
]

The corresponding entry in the Gemfile is:

gem 'also_migrate'

Gemfile.lock indicates that the version of also_migrate being pulled in is 0.3.5.

Not sure if there is more information I should be providing. Thanks.