20150429002313_remove_abandoned_group_members_records.rb 248 Bytes
Newer Older
1
class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration[4.2]
2
  def up
3 4 5
    execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\
        SELECT id FROM namespaces WHERE type='Group')")
  end
6 7 8

  def down
  end
9
end