FIX: allow storage of non unique rows in oauth2_user_infos
Certain DBs have duplicates already, if we want to ensure uniqueness here we need to decide first how to clean up existing data and confirm all the plugins expect this.
This commit is contained in:
parent
c9714fcbf8
commit
5ae35f9906
|
@ -21,5 +21,5 @@ end
|
|||
# Indexes
|
||||
#
|
||||
# index_oauth2_user_infos_on_uid_and_provider (uid,provider) UNIQUE
|
||||
# index_oauth2_user_infos_on_user_id_and_provider (user_id,provider) UNIQUE
|
||||
# index_oauth2_user_infos_on_user_id_and_provider (user_id,provider)
|
||||
#
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
class AddIndexToOauth2UserInfo < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_index :oauth2_user_infos, [:user_id, :provider], unique: true
|
||||
add_index :oauth2_user_infos, [:user_id, :provider]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AmendOauth2UserInfoIndex < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
# remove old index which may have been unique
|
||||
execute "DROP INDEX index_oauth2_user_infos_on_user_id_and_provider"
|
||||
add_index :oauth2_user_infos, [:user_id, :provider]
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue