Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20150429002313_remove_abandoned_group_members_records.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6013605bb3541c9e636a1ef76000073b939ec315 (plain)
1
2
3
4
5
6
class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration
  def change
    execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\
        SELECT id FROM namespaces WHERE type='Group')")
  end
end