PERF: Add unique index oauth2_user_infos(user_id, provider) (#8230)

This commit is contained in:
Dan Ungureanu 2019-10-23 12:27:56 +03:00 committed by David Taylor
parent 1a72a61822
commit 09a569aaba
2 changed files with 9 additions and 1 deletions

View File

@ -20,5 +20,6 @@ end
#
# Indexes
#
# index_oauth2_user_infos_on_uid_and_provider (uid,provider) UNIQUE
# index_oauth2_user_infos_on_uid_and_provider (uid,provider) UNIQUE
# index_oauth2_user_infos_on_user_id_and_provider (user_id,provider) UNIQUE
#

View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddIndexToOauth2UserInfo < ActiveRecord::Migration[6.0]
def change
add_index :oauth2_user_infos, [:user_id, :provider], unique: true
end
end