mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 11:28:18 +00:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
9 lines
309 B
Ruby
9 lines
309 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddUniqueIndexToGroupRequests < ActiveRecord::Migration[5.2]
|
|
def change
|
|
execute "DELETE FROM group_requests WHERE id NOT IN (SELECT MIN(id) FROM group_requests GROUP BY group_id, user_id)"
|
|
add_index :group_requests, [:group_id, :user_id], unique: true
|
|
end
|
|
end
|