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: 20151213085908_polymorphize_episodes.rb
    path of file: ./repos/kitsu-server/db/migrate
    
    the code of the file until where you have to start completion: class PolymorphizeEpisodes < ActiveRecord::Migration[4.2]
  def change
    rename_column :episodes, :anime_id, :media_id
    change_column_null :episodes, :media
    
  def change
    rename_column :episodes, :anime_id, :media_id
    change_column_null :episodes, :media_id, false
    add_column :episodes, :media_type, :string
    change_column_null :episodes, :media_type, false, 'Anime'
    add_index :episodes, [:media_type, :media_id]
    remove_index :episodes, :media_id
  end