Trying to get authlogic running
This commit is contained in:
parent
06f09c0486
commit
737ff62cfc
23 changed files with 306 additions and 4 deletions
23
db/migrate/20150713153950_change_users_to_authlogic.rb
Normal file
23
db/migrate/20150713153950_change_users_to_authlogic.rb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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
|
||||
13
db/migrate/20150713155458_create_user_sessions.rb
Normal file
13
db/migrate/20150713155458_create_user_sessions.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class CreateUserSessions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :user_sessions do |t|
|
||||
t.string :session_id, :null => false
|
||||
t.text :data
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :user_sessions, :session_id
|
||||
add_index :user_sessions, :updated_at
|
||||
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue