Commit 95621c01 authored by Rémy Coutable's avatar Rémy Coutable Committed by Robert Speicher

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
parent ff5b073e
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
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