* Replace password field by password_hash * Add User#password attribute * Implement password hashing and verification with BCrypt mixin
12 lines
268 B
Ruby
12 lines
268 B
Ruby
class AddPasswordHashToUsers < ActiveRecord::Migration
|
|
def self.up
|
|
add_column :users, :password_hash, :string
|
|
remove_column :users, :password
|
|
end
|
|
|
|
def self.down
|
|
remove_column :users, :password_hash
|
|
add_column :users, :password, :string
|
|
end
|
|
end
|