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: 20180425125409_add_poll_participations_unique_index_on_author_and_poll.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 AddPollParticipationsUniqueIndexOnAuthorAndPoll < ActiveRecord::Migration[5.1]
  def change
    reversible do |change|
      change.up do
        duplicate_query = "WHERE a1.poll_id = a2.poll_id AND a1.author_id = a2.author_id AND a1.id > a2.id"
        if AppConfig.post
    
  def change
    reversible do |change|
      change.up do
        duplicate_query = "WHERE a1.poll_id = a2.poll_id AND a1.author_id = a2.author_id AND a1.id > a2.id"
        if AppConfig.postgres?
          execute("DELETE FROM poll_participations AS a1 USING poll_participations AS a2 #{duplicate_query}")
        else
          execute("DELETE a1 FROM poll_participations a1, poll_participations a2 #{duplicate_query}")
        end
      end
    end