summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170526185602_add_stage_id_to_ci_builds.rb9
-rw-r--r--db/post_migrate/20170526101042_migrate_pipeline_stages.rb2
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)')