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>2018-05-30 17:04:52 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-05-30 17:04:52 +0300
commite542583e91dc53698048686cf4268eaeae807973 (patch)
treee32af2482ce1c424d8fdacdf809a0a3afe02ab5a /db/migrate
parent74caf54704704e30b8ed45e2459828890f416b08 (diff)
Add a unique index to stages on pipeline / position
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20180530135500_add_index_to_stages_position.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20180530135500_add_index_to_stages_position.rb b/db/migrate/20180530135500_add_index_to_stages_position.rb
new file mode 100644
index 00000000000..e60b742a59b
--- /dev/null
+++ b/db/migrate/20180530135500_add_index_to_stages_position.rb
@@ -0,0 +1,15 @@
+class AddIndexToStagesPosition < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :ci_stages, [:pipeline_id, :position], unique: true
+ end
+
+ def down
+ remove_concurrent_index :ci_stages, [:pipeline_id, :position]
+ end
+end