class ConvertIdToBuildId < ActiveRecord::Migration
  def up
    SmocaBuild.reset_column_information

    smoca_build = SmocaBuild.all

    smoca_build.each_with_index do |val, index|
      val.build_id = val.id
      val.id = (index + 1)
      val.job_name = 'qa-smoca'
      val.save
    end
  end

  def down
    SmocaBuild.reset_column_information

    smoca_build = SmocaBuild.all

    smoca_build.each_with_index do |val, index|
      val.id = val.build_id
      val.save
    end
  end
end
