Use update_column_in_batches helper in stages migration

This commit is contained in:
Grzegorz Bizon 2017-07-31 12:23:04 +02:00
parent cec2cc3ffa
commit 13a15e7009
2 changed files with 1 additions and 5 deletions

View file

@ -17,8 +17,6 @@ module Ci
validates :pipeline, presence: true, unless: :importing?
validates :name, presence: true, unless: :importing?
## TODO, should we extract these events to `Ci::Eventable`?
#
state_machine :status, initial: :created do
event :enqueue do
transition created: :pending

View file

@ -28,8 +28,6 @@ class MigrateStagesStatuses < ActiveRecord::Migration
def down
disable_statement_timeout
execute <<-SQL.strip_heredoc
UPDATE ci_stages SET status = null
SQL
update_column_in_batches(:ci_stages, :status, nil)
end
end