1
votes

I used mysql Ver 14.14 for both development and production environment. I have a db migration file like:

class ChangeRoleToNodeTemplate < ActiveRecord::Migration
  def up
    rename_table :roles, :node_templates
  end

  def down
    rename_table :node_templates, :roles
  end
end

When i run 'rake db:migrate' command, the schema.rb file which it generated is correctly.

But when i run 'rake db:migrate RAILS_ENV=production', it contains both 'roles' and 'node_templates' table with the same schema.

Anyone can give me a suggestion? Thanks.

I used Rails 3.1.0

1

1 Answers

1
votes

Not sure why and how this could have happened, but I'd try to rollback the production db completely first, than just load up the schema and check

to rollback the production db:

rake db:rollback RAILS_ENV=production STEP=100

to load the schema:

rake db:schema:load RAILS_ENV=production