Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20160615191922_set_missing_stage_on_ci_builds.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 11d15e7c15fe4e0afc0bb22f13cecdc40e96f6f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# rubocop:disable Migration/UpdateLargeTable
# rubocop:disable Migration/UpdateColumnInBatches
class SetMissingStageOnCiBuilds < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  disable_ddl_transaction!

  def up
    update_column_in_batches(:ci_builds, :stage, :test) do |table, query|
      query.where(table[:stage].eq(nil))
    end
  end
end