diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-04 16:58:35 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-04 16:58:35 +0200 |
commit | 93d217bda639b94c129afd71343e429f935a4ada (patch) | |
tree | 7eae1493cca8908d971291743f6eeb0564a179ca /db | |
parent | b3ee172b4ee6fd22ebf3705edf6762a9dd777cdc (diff) | |
download | gitlab-ce-93d217bda639b94c129afd71343e429f935a4ada.tar.gz |
Migrate only old stages without status that is set
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20170630111158_migrate_stages_statuses.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/db/post_migrate/20170630111158_migrate_stages_statuses.rb b/db/post_migrate/20170630111158_migrate_stages_statuses.rb index 62542ed0001..9dac91960ff 100644 --- a/db/post_migrate/20170630111158_migrate_stages_statuses.rb +++ b/db/post_migrate/20170630111158_migrate_stages_statuses.rb @@ -72,7 +72,9 @@ class MigrateStagesStatuses < ActiveRecord::Migration .where('ci_builds.stage = ci_stages.name') .status_sql - update_column_in_batches(:ci_stages, :status, Arel.sql("(#{status_sql})")) + update_column_in_batches(:ci_stages, :status, Arel.sql("(#{status_sql})")) do |table, query| + query.where(table[:status].eq(nil)) + end end def down |