From 06898af38f46daaa1c75cb4adead971062684875 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 5 Jun 2017 13:35:35 +0200 Subject: Create indexes on pipeline stages before migration Creates an index in ci_stages before migrating pipeline stages from ci_builds, to improve migration performance. --- .../20170526185748_create_index_in_pipeline_stages.rb | 15 +++++++++++++++ .../20170526190948_create_index_in_pipeline_stages.rb | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 db/post_migrate/20170526185748_create_index_in_pipeline_stages.rb delete mode 100644 db/post_migrate/20170526190948_create_index_in_pipeline_stages.rb 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 diff --git a/db/post_migrate/20170526190948_create_index_in_pipeline_stages.rb b/db/post_migrate/20170526190948_create_index_in_pipeline_stages.rb deleted file mode 100644 index d049f87578a..00000000000 --- a/db/post_migrate/20170526190948_create_index_in_pipeline_stages.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 -- cgit v1.2.3