about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorSorin Davidoi <sorin.davidoi@gmail.com>2017-06-23 18:50:53 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-06-23 18:50:53 +0200
commit2211e8d1cd6eb97a8a04e24c1fea7031a201edb5 (patch)
treeb235a97b1c0f73475449c2313823dc6d599f31bb /db
parent3783cadf2d7a2b7ace078d1d337645f53c190c69 (diff)
Revocable sessions (#3616)
* feat: Revocable sessions

* fix: Tests using sign_in

* feat: Configuration entry for the maximum number of session activations
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170623152212_create_session_activations.rb13
-rw-r--r--db/schema.rb11
2 files changed, 23 insertions, 1 deletions
diff --git a/db/migrate/20170623152212_create_session_activations.rb b/db/migrate/20170623152212_create_session_activations.rb
new file mode 100644
index 000000000..81c776135
--- /dev/null
+++ b/db/migrate/20170623152212_create_session_activations.rb
@@ -0,0 +1,13 @@
+class CreateSessionActivations < ActiveRecord::Migration[5.1]
+  def change
+    create_table :session_activations do |t|
+      t.integer :user_id,   null: false
+      t.string :session_id, null: false
+
+      t.timestamps
+    end
+
+    add_index :session_activations, :user_id
+    add_index :session_activations, :session_id, unique: true
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 2f12c7308..b6aceb930 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20170610000000) do
+ActiveRecord::Schema.define(version: 20170623152212) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -250,6 +250,15 @@ ActiveRecord::Schema.define(version: 20170610000000) do
     t.index ["target_account_id"], name: "index_reports_on_target_account_id"
   end
 
+  create_table "session_activations", force: :cascade do |t|
+    t.integer "user_id", null: false
+    t.string "session_id", null: false
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.index ["session_id"], name: "index_session_activations_on_session_id", unique: true
+    t.index ["user_id"], name: "index_session_activations_on_user_id"
+  end
+
   create_table "settings", id: :serial, force: :cascade do |t|
     t.string "var", null: false
     t.text "value"