2012-03-21 13:37:16 +00:00
|
|
|
class AddDeviseLockable < ActiveRecord::Migration
|
|
|
|
def change
|
2014-01-21 04:51:49 +00:00
|
|
|
add_column :users, :failed_attempts, :integer, default: 0 # Only if lock strategy is :failed_attempts
|
2012-03-21 13:37:16 +00:00
|
|
|
add_column :users, :unlock_token, :string # Only if unlock strategy is :email or :both
|
|
|
|
add_column :users, :locked_at, :datetime
|
2014-01-21 04:51:49 +00:00
|
|
|
add_index :users, :unlock_token, unique: true
|
2012-03-21 13:37:16 +00:00
|
|
|
end
|
|
|
|
end
|