summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-04-25 15:14:01 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-04-25 15:14:01 +0200
commitdf6a2d423ea4dac3484669f6f49c535b36288d5d (patch)
treeb40fd03f577b555b0ecdc146e86385eb47c7ca4f
parentc9dc51111d53aba4e456afaade4bf9ad82c4b28c (diff)
downloadgitlab-ce-df6a2d423ea4dac3484669f6f49c535b36288d5d.tar.gz
Add temporary build stage priority partial index
-rw-r--r--db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb b/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb
new file mode 100644
index 00000000000..c07d1c69a81
--- /dev/null
+++ b/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb
@@ -0,0 +1,16 @@
+class AddTmpStagePriorityIndexToCiBuilds < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:ci_builds, [:stage_id, :stage_idx],
+ where: 'stage_idx IS NOT NULL', name: 'tmp_build_stage_priority_index')
+ end
+
+ def down
+ remove_concurrent_index_by_name(:ci_builds, 'tmp_build_stage_priority_index')
+ end
+end