gitlab-org--gitlab-foss/db/migrate/20150429002313_remove_aband...

11 lines
265 B
Ruby
Raw Normal View History

# rubocop:disable all
2015-04-29 10:46:57 +00:00
class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration
2015-05-07 14:29:15 +00:00
def up
2015-04-29 10:46:57 +00:00
execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\
SELECT id FROM namespaces WHERE type='Group')")
end
2015-05-07 14:29:15 +00:00
def down
end
2015-04-29 10:46:57 +00:00
end