debian-mirror-gitlab/db/migrate/20150429002313_remove_abandoned_group_members_records.rb

11 lines
265 B
Ruby
Raw Normal View History

# rubocop:disable all
2015-09-11 14:41:01 +05:30
class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration
def up
execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\
SELECT id FROM namespaces WHERE type='Group')")
end
def down
end
end