Commit 181d8f68 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Make stages index background migration more idempotent

parent 02999234
...@@ -18,6 +18,7 @@ module Gitlab ...@@ -18,6 +18,7 @@ module Gitlab
WHERE ci_builds.stage_id = ci_stages.id WHERE ci_builds.stage_id = ci_stages.id
GROUP BY ci_builds.stage_idx ORDER BY COUNT(*) DESC LIMIT 1) GROUP BY ci_builds.stage_idx ORDER BY COUNT(*) DESC LIMIT 1)
WHERE ci_stages.id BETWEEN #{start_id.to_i} AND #{stop_id.to_i} WHERE ci_stages.id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
AND ci_stages.index IS NULL
SQL SQL
ActiveRecord::Base.connection.execute(sql) ActiveRecord::Base.connection.execute(sql)
......
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