I have a very simple migration that was created using a generator
class AddEmailToUsers < ActiveRecord::Migration def self.up add_column :users, :email, :string end def self.down remove_column :users, :email end end
It works fine locally
rake db:migrate rails console >> User.column_names => ["id", "created_at", "updated_at", "uid", "provider", "name", "role", "email"]
I have two versions of the application on Heroku. In one, it works great. The other column just does not appear.
The output from geku rake db: migrate looks right:
== AddEmailToUsers: migrating ================================================ -- add_column(:users, :email, :string) -> 0.0031s == AddEmailToUsers: migrated (0.0032s) =======================================
But there is no column there:
>> User.column_names => ["id", "created_at", "updated_at", "uid", "provider", "name", "role"]
(By the way, all my changes in the database occurred through those created by the migration generator, I myself did not touch SQL and did not edit any migration files.)
This is a production environment, so dropping a table is not an option.
Any suggestions for things I can try?