20120919061122_enable_lockable_strategy_for_devise.rb 436 B

123456789101112131415
  1. class EnableLockableStrategyForDevise < ActiveRecord::Migration[4.2]
  2. def up
  3. add_column :users, :failed_attempts, :integer, :default => 0
  4. add_column :users, :unlock_token, :string
  5. add_column :users, :locked_at, :datetime
  6. add_index :users, :unlock_token, :unique => true
  7. end
  8. def down
  9. remove_column :users, :failed_attempts
  10. remove_column :users, :unlock_token
  11. remove_column :users, :locked_at
  12. end
  13. end