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: 20150324010030_add_channel_id_to_topics.rb
    path of file: ./repos/rabel/db/migrate
    
    the code of the file until where you have to start completion: class AddChannelIdToTopics < ActiveRecord::Migration[4.2]
  def change
    add_column :topics, :channel_id, :integer
    a
    
  def change
    add_column :topics, :channel_id, :integer
    add_index :topics, :channel_id

    Topic.find_each do |t|
      node = Node.find(t.node_id)
      ch = Channel.find_by(name: node.name)
      t.channel_id = ch.id
      t.save
    end
  end