Commit b72abd1d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Migrate stage_id only it job does not have it already

parent af72fa9c
......@@ -10,7 +10,9 @@ class MigrateBuildStageReference < ActiveRecord::Migration
'WHERE ci_stages.pipeline_id = ci_builds.commit_id ' \
'AND ci_stages.name = ci_builds.stage)')
update_column_in_batches(:ci_builds, :stage_id, stage_id)
update_column_in_batches(:ci_builds, :stage_id, stage_id) do |table, query|
query.where(table[:stage_id].eq(nil))
end
end
def down
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment