summaryrefslogtreecommitdiff
path: root/db/migrate/20160316123110_ci_runners_token_index.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-03-16 13:38:18 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2016-03-16 13:38:47 +0100
commitaf4d5458a9f2f45f781f5baab05eaa9a8113328d (patch)
treebb8a110290383e6c213af66b3a24a851721bfcf3 /db/migrate/20160316123110_ci_runners_token_index.rb
parenta34021cd182af49fc732c4ad58f7594f73c46f01 (diff)
downloadgitlab-ce-af4d5458a9f2f45f781f5baab05eaa9a8113328d.tar.gz
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