diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-26 20:57:36 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-26 20:57:36 +0200 |
commit | b8c39649296049e402f8917b2b8a6123a302e672 (patch) | |
tree | cd58051738badacdc83e30b1315aea909a0ebd0b /db | |
parent | 56681cf7954eeeba227b73cfeb163eb4e51dc96f (diff) | |
download | gitlab-ce-b8c39649296049e402f8917b2b8a6123a302e672.tar.gz |
Add stage_id column to ci_builds in a separate migration
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170526185602_add_stage_id_to_ci_builds.rb | 9 | ||||
-rw-r--r-- | db/post_migrate/20170526101042_migrate_pipeline_stages.rb | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/db/migrate/20170526185602_add_stage_id_to_ci_builds.rb b/db/migrate/20170526185602_add_stage_id_to_ci_builds.rb new file mode 100644 index 00000000000..0788f15f7c5 --- /dev/null +++ b/db/migrate/20170526185602_add_stage_id_to_ci_builds.rb @@ -0,0 +1,9 @@ +class AddStageIdToCiBuilds < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + add_column :ci_builds, :stage_id, :integer + end +end diff --git a/db/post_migrate/20170526101042_migrate_pipeline_stages.rb b/db/post_migrate/20170526101042_migrate_pipeline_stages.rb index 9ef351dff93..fdbefd59edf 100644 --- a/db/post_migrate/20170526101042_migrate_pipeline_stages.rb +++ b/db/post_migrate/20170526101042_migrate_pipeline_stages.rb @@ -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)') |