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

10 lines
243 B
Ruby
Raw Normal View History

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