Sha256: a781975196bb512b6d5b7a9e401c6147b71a612e507731ae8b41273994484bae

Contents?: true

Size: 361 Bytes

Versions: 27

Compression:

Stored size: 361 Bytes

Contents

class AddAuthenticationTokenToUsers < ActiveRecord::Migration
  def up
    add_column :users, :authentication_token, :string
    add_index :users, :authentication_token

    User.unscoped { User.find_each(&:ensure_authentication_token) }
  end

  def down
    remove_index :users, :authentication_token
    remove_column :users, :authentication_token
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
houston-core-0.5.6 db/migrate/20120826022643_add_authentication_token_to_users.rb
houston-core-0.5.5 db/migrate/20120826022643_add_authentication_token_to_users.rb
houston-core-0.5.4 db/migrate/20120826022643_add_authentication_token_to_users.rb
houston-core-0.5.3 db/migrate/20120826022643_add_authentication_token_to_users.rb
houston-core-0.5.2 db/migrate/20120826022643_add_authentication_token_to_users.rb
houston-core-0.5.1 db/migrate/20120826022643_add_authentication_token_to_users.rb
houston-core-0.5.0 db/migrate/20120826022643_add_authentication_token_to_users.rb