You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 20160906225138_fix_photos_share_visibilities.rb
    path of file: ./repos/diaspora/db/migrate
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class FixPhotosShareVisibilities < ActiveRecord::Migration[4.2]
  class Photo < ApplicationRecord
  end

  class ShareVisibility < ApplicationRec
    
  def remove_duplicates
    where = "WHERE s1.user_id = s2.user_id AND s1.shareable_id = s2.shareable_id AND "\
      "s1.shareable_type = s2.shareable_type AND s1.id > s2.id"
    if AppConfig.postgres?
      execute("DELETE FROM share_visibilities AS s1 USING share_visibilities AS s2 #{where}")
    else
      execute("DELETE s1 FROM share_visibilities s1, share_visibilities s2 #{where}")
    end