PERF: Add index on `user_id` to `single_sign_on_records`.

PERF: Add index on user_id to single_sign_on_records.

diff --git a/app/models/single_sign_on_record.rb b/app/models/single_sign_on_record.rb
index 1ceeacf..417a5f3 100644
--- a/app/models/single_sign_on_record.rb
+++ b/app/models/single_sign_on_record.rb
@@ -24,4 +24,5 @@ end
 # Indexes
 #
 #  index_single_sign_on_records_on_external_id  (external_id) UNIQUE
+#  index_single_sign_on_records_on_user_id      (user_id)
 #
diff --git a/db/migrate/20190130013015_add_index_on_user_id_to_single_sign_on_records.rb b/db/migrate/20190130013015_add_index_on_user_id_to_single_sign_on_records.rb
new file mode 100644
index 0000000..2eb26d5
--- /dev/null
+++ b/db/migrate/20190130013015_add_index_on_user_id_to_single_sign_on_records.rb
@@ -0,0 +1,5 @@
+class AddIndexOnUserIdToSingleSignOnRecords < ActiveRecord::Migration[5.2]
+  def change
+    add_index :single_sign_on_records, :user_id
+  end
+end

GitHub sha: ac004297

1 Like