rosa-build/db/migrate/20120418100619_add_token_au...

15 lines
333 B
Ruby

class AddTokenAuthenticatableToUsers < ActiveRecord::Migration
def self.up
add_column :users, :authentication_token, :string
add_index :users, :authentication_token
User.all.each do |user|
user.ensure_authentication_token!
end
end
def self.down
remove_column :users, :authentication_token
end
end