Sha256: 5c5a171ccb283d3ca5e571ea5d878e6a899879a5adec5858905b8a2f4668425e

Contents?: true

Size: 540 Bytes

Versions: 10

Compression:

Stored size: 540 Bytes

Contents

require "progressbar"

class MoveAdapterNamesToProps < ActiveRecord::Migration[5.0]
  def up
    projects = Project.unscoped
    pbar = ProgressBar.new("projects", projects.count)
    projects.find_each do |project|
      project.update_props!(
        "adapter.ciServer" => project.ci_server_name,
        "adapter.ticketTracker" => project.ticket_tracker_name,
        "adapter.errorTracker" => project.error_tracker_name,
        "adapter.versionControl" => project.version_control_name)
      pbar.inc
    end
    pbar.finish
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
houston-core-0.9.2 db/migrate/20170115150643_move_adapter_names_to_props.rb
houston-core-0.9.1 db/migrate/20170115150643_move_adapter_names_to_props.rb
houston-core-0.9.0 db/migrate/20170115150643_move_adapter_names_to_props.rb
houston-core-0.9.0.rc1 db/migrate/20170115150643_move_adapter_names_to_props.rb
houston-core-0.8.4 db/migrate/20170115150643_move_adapter_names_to_props.rb
houston-core-0.8.3 db/migrate/20170115150643_move_adapter_names_to_props.rb
houston-core-0.8.2 db/migrate/20170115150643_move_adapter_names_to_props.rb
houston-core-0.8.1 db/migrate/20170115150643_move_adapter_names_to_props.rb
houston-core-0.8.0 db/migrate/20170115150643_move_adapter_names_to_props.rb
houston-core-0.8.0.pre2 db/migrate/20170115150643_move_adapter_names_to_props.rb