diff options
| author | mo khan <mo@mokhan.ca> | 2014-08-13 21:47:17 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-08-13 21:47:17 -0600 |
| commit | be11ff527fb16b829e527d9b448df92b7262267a (patch) | |
| tree | 06d0968ce24c1c17d309409faec50a75e9e62480 /db | |
| parent | ac1caed55bef96781b447a83aff319770c3044ef (diff) | |
generate session key and add ability to revoke a session.
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20140814031349_add_accessed_at_and_revoked_at_to_user_sessions.rb | 11 | ||||
| -rw-r--r-- | db/schema.rb | 7 |
2 files changed, 17 insertions, 1 deletions
diff --git a/db/migrate/20140814031349_add_accessed_at_and_revoked_at_to_user_sessions.rb b/db/migrate/20140814031349_add_accessed_at_and_revoked_at_to_user_sessions.rb new file mode 100644 index 00000000..1166b260 --- /dev/null +++ b/db/migrate/20140814031349_add_accessed_at_and_revoked_at_to_user_sessions.rb @@ -0,0 +1,11 @@ +class AddAccessedAtAndRevokedAtToUserSessions < ActiveRecord::Migration + def change + change_table :user_sessions do |t| + t.column :key, :string + t.column :ip, :string + t.column :user_agent, :string + t.column :accessed_at, :datetime + t.column :revoked_at, :datetime, null: true + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 8c1e51b6..9c277658 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140814030250) do +ActiveRecord::Schema.define(version: 20140814031349) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -162,6 +162,11 @@ ActiveRecord::Schema.define(version: 20140814030250) do t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" + t.string "key" + t.string "ip" + t.string "user_agent" + t.datetime "accessed_at" + t.datetime "revoked_at" end create_table "users", force: true do |t| |
