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: 20120713171100_add_index_to_image_votes.rb
    path of file: ./repos/mushroom-observer/db/migrate
    
    the code of the file until where you have to start completion: # encoding: utf-8

class AddIndexToImageVotes < ActiveRecord::Migration
  def self.up
    # This improves the following query by orders of magnitude:
    #   Query.lookup(:Observation, :by_user, :user => 252, :by => owners_thumbnail_quality):

    
  def self.up
    # This improves the following query by orders of magnitude:
    #   Query.lookup(:Observation, :by_user, :user => 252, :by => owners_thumbnail_quality):
    #     SELECT DISTINCT observations.id
    #     FROM `observations`
    #     JOIN `images` ON observations.thumb_image_id = images.id
    #     JOIN `image_votes` ON image_votes.image_id = images.id
    #     WHERE observations.user_id = '252'
    #       AND image_votes.user_id = observations.user_id
    #     ORDER BY image_votes.value DESC;
    add_index :image_votes, :image_id
  end