This MR improves a migration that adds a foreign key on ci_builds.stage_id.
ci_builds.stage_id
Closes gitlab-org/gitlab-ce#34495