about summary refs log tree commit diff
path: root/db/migrate
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/migrate
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/migrate')
-rw-r--r--db/migrate/20170623152212_create_session_activations.rb13
1 files changed, 13 insertions, 0 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