summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-06-05 13:24:07 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-06-05 13:24:07 +0200
commitb72abd1d359da313b31097fcf042d2379e1c4ab2 (patch)
treeca94e02dda9ab78f65fc528f9e37acdc7e910cc9 /db
parentaf72fa9c9c0af25cb7d8d349abd9dea4897aeea8 (diff)
downloadgitlab-ce-b72abd1d359da313b31097fcf042d2379e1c4ab2.tar.gz
Migrate stage_id only it job does not have it already
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20170526185921_migrate_build_stage_reference.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/post_migrate/20170526185921_migrate_build_stage_reference.rb b/db/post_migrate/20170526185921_migrate_build_stage_reference.rb
index 8f453b8cd82..3c30dfd6dde 100644
--- a/db/post_migrate/20170526185921_migrate_build_stage_reference.rb
+++ b/db/post_migrate/20170526185921_migrate_build_stage_reference.rb
@@ -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