debshots/db/migrate/20150713153950_change_users_to_authlogic.rb

23 lines
1.4 KiB
Ruby

class ChangeUsersToAuthlogic < ActiveRecord::Migration
def change
change_table :users do |t|
# Remove the password column that was previously introduced
t.remove :password
# Create AuthLogic fields
t.string :password_salt, :null => false # optional, but highly recommended
t.string :persistence_token, :null => false # required
# Magic columns, just like ActiveRecord's created_at and updated_at. These are automatically maintained by Authlogic if they are present.
t.integer :login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
t.integer :failed_login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
t.datetime :last_request_at # optional, see Authlogic::Session::MagicColumns
t.datetime :current_login_at # optional, see Authlogic::Session::MagicColumns
t.datetime :last_login_at # optional, see Authlogic::Session::MagicColumns
t.string :current_login_ip # optional, see Authlogic::Session::MagicColumns
t.string :last_login_ip # optional, see Authlogic::Session::MagicColumns
end
change_column :packages, :long_description, :text
end
end