Commit b8c39649 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add stage_id column to ci_builds in a separate migration

parent 56681cf7
class AddStageIdToCiBuilds < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
add_column :ci_builds, :stage_id, :integer
end
end
......@@ -16,8 +16,6 @@ class MigratePipelineStages < ActiveRecord::Migration
ORDER BY stage_idx
SQL
add_column(:ci_builds, :stage_id, :integer)
stage_id = Arel.sql('(SELECT id FROM ci_stages ' \
'WHERE ci_stages.pipeline_id = ci_builds.commit_id ' \
'AND ci_stages.name = ci_builds.stage)')
......
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