Use update_column_in_batches helper in stages migration
This commit is contained in:
parent
cec2cc3ffa
commit
13a15e7009
2 changed files with 1 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue