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
WHERE ci_builds.stage_id = ci_stages.id
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}
AND ci_stages.index IS NULL
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