summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-04-20 12:55:39 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-04-24 11:07:37 +0200
commit181d8f687d70accffd0ecd2d49dc715a5355b318 (patch)
treef2f75bd1a80be062f2921a1871e1099245e94ea1 /lib
parent02999234d4b7ebcf60332816b68addf8f4667ce7 (diff)
downloadgitlab-ce-181d8f687d70accffd0ecd2d49dc715a5355b318.tar.gz
Make stages index background migration more idempotent
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/background_migration/migrate_stage_index.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration/migrate_stage_index.rb b/lib/gitlab/background_migration/migrate_stage_index.rb
index e66fec7b20d..c5f0fb5e8f8 100644
--- a/lib/gitlab/background_migration/migrate_stage_index.rb
+++ b/lib/gitlab/background_migration/migrate_stage_index.rb
@@ -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)