Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-06-05 14:35:35 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-06-05 14:35:35 +0300
commit06898af38f46daaa1c75cb4adead971062684875 (patch)
tree011531131a00cf1472f840334ff8391eb69df63b /db/post_migrate/20170526185748_create_index_in_pipeline_stages.rb
parentb72abd1d359da313b31097fcf042d2379e1c4ab2 (diff)
Create indexes on pipeline stages before migration
Creates an index in ci_stages before migrating pipeline stages from ci_builds, to improve migration performance.
Diffstat (limited to 'db/post_migrate/20170526185748_create_index_in_pipeline_stages.rb')
-rw-r--r--db/post_migrate/20170526185748_create_index_in_pipeline_stages.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/post_migrate/20170526185748_create_index_in_pipeline_stages.rb b/db/post_migrate/20170526185748_create_index_in_pipeline_stages.rb
new file mode 100644
index 00000000000..d049f87578a
--- /dev/null
+++ b/db/post_migrate/20170526185748_create_index_in_pipeline_stages.rb
@@ -0,0 +1,15 @@
+class CreateIndexInPipelineStages < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:ci_stages, [:pipeline_id, :name])
+ end
+
+ def down
+ remove_index(:ci_stages, [:pipeline_id, :name])
+ end
+end