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:
authorYorick Peterse <yorickpeterse@gmail.com>2016-03-16 15:38:18 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2016-03-16 15:38:47 +0300
commitaf4d5458a9f2f45f781f5baab05eaa9a8113328d (patch)
treebb8a110290383e6c213af66b3a24a851721bfcf3 /db/migrate/20160316123110_ci_runners_token_index.rb
parenta34021cd182af49fc732c4ad58f7594f73c46f01 (diff)
Added an index on ci_runners.token
On PostgreSQL the index is created concurrently. Fixes gitlab-org/gitlab-ce#14325
Diffstat (limited to 'db/migrate/20160316123110_ci_runners_token_index.rb')
-rw-r--r--db/migrate/20160316123110_ci_runners_token_index.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20160316123110_ci_runners_token_index.rb b/db/migrate/20160316123110_ci_runners_token_index.rb
new file mode 100644
index 00000000000..67bf5b4f978
--- /dev/null
+++ b/db/migrate/20160316123110_ci_runners_token_index.rb
@@ -0,0 +1,13 @@
+class CiRunnersTokenIndex < ActiveRecord::Migration
+ disable_ddl_transaction!
+
+ def change
+ args = [:ci_runners, :token]
+
+ if Gitlab::Database.postgresql?
+ args << { algorithm: :concurrently }
+ end
+
+ add_index(*args)
+ end
+end