PERF: add missing index on group_users

This commit is contained in:
Sam 2015-09-18 10:43:53 +10:00
parent c1ecd6f4ce
commit 287411525a
2 changed files with 6 additions and 0 deletions

View File

@ -70,4 +70,5 @@ end
# Indexes
#
# index_group_users_on_group_id_and_user_id (group_id,user_id) UNIQUE
# index_group_users_on_user_id_and_group_id (user_id,group_id) UNIQUE
#

View File

@ -0,0 +1,5 @@
class AddUserIdGroupIdIndexToGroupUsers < ActiveRecord::Migration
def change
add_index :group_users, [:user_id, :group_id], unique: true
end
end