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: 28_host_node_indexes.rb
    path of file: ./repos/kontena/server/db/migrations
    
    the code of the file until where you have to start completion: class HostNodeIndexes < Mongodb::Migration
  def self.up

    # Make sure each node has proper node_number and name
    HostNode.each do |node|
      unless node.node_number
        node.set(node_
    
  def self.up

    # Make sure each node has proper node_number and name
    HostNode.each do |node|
      unless node.node_number
        node.set(node_number: node.grid.free_node_numbers.first)
      end

      unless node.name
        node.set(name: "node-#{node.node_number}")
      end