summaryrefslogtreecommitdiff
path: root/db/migrate/20160615191922_set_missing_stage_on_ci_builds.rb
blob: c58cb957df4058f1079ee36be4a6a81735228cfe (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
  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