diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-20 19:58:54 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-06-21 18:49:32 +0300 |
commit | 95621c0118c691f3523275d645364363d57f55e5 (patch) | |
tree | 84ad097065a193fae39d30acdce16fb78720d1ea | |
parent | ff5b073e2fdfc089a4f251bce5262eaf36f1d851 (diff) |
Merge branch '17949-error-500-on-gitlab-org-when-visiting-pipelines' into 'master'
Set missing stages on ci builds to 'test' to avoid regressions in the pipelines view
## What does this MR do?
Sets a default stage on old `ci_builds`.
## Are there points in the code the reviewer needs to double check?
Is the migration acceptable for online execution?
## Why was this MR needed?
Old `ci_builds`with no stages cause a regression on the pipelines index view.
## What are the relevant issue numbers?
#17949
Blocked by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4680
See merge request !4381
-rw-r--r-- | db/migrate/20160615191922_set_missing_stage_on_ci_builds.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/db/migrate/20160615191922_set_missing_stage_on_ci_builds.rb b/db/migrate/20160615191922_set_missing_stage_on_ci_builds.rb new file mode 100644 index 00000000000..bd0463886bc --- /dev/null +++ b/db/migrate/20160615191922_set_missing_stage_on_ci_builds.rb @@ -0,0 +1,9 @@ +class SetMissingStageOnCiBuilds < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + def up + update_column_in_batches(:ci_builds, :stage, :test) do |table, query| + query.where(table[:stage].eq(nil)) + end + end +end |