aboutsummaryrefslogtreecommitdiffstats
path: root/spec/dummy/db/migrate/20110802081564_remove_password_salt_from_users.rb
blob: afcbfd7b3edf7e1d32057091ac72ec89a0245096 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
class RemovePasswordSaltFromUsers < ActiveRecord::Migration
  def self.up
    remove_column ::Refinery::User.table_name, :password_salt
    # Make the current password invalid :(
    ::Refinery::User.all.each do |u|
      u.update_attribute(:encrypted_password, u.encrypted_password[29..-1])
    end
  end

  def self.down
    add_column ::Refinery::User.table_name, :password_salt, :string
  end
end