diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-03-16 13:38:18 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-03-16 13:38:47 +0100 |
commit | af4d5458a9f2f45f781f5baab05eaa9a8113328d (patch) | |
tree | bb8a110290383e6c213af66b3a24a851721bfcf3 /db | |
parent | a34021cd182af49fc732c4ad58f7594f73c46f01 (diff) | |
download | gitlab-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')
-rw-r--r-- | db/migrate/20160316123110_ci_runners_token_index.rb | 13 | ||||
-rw-r--r-- | db/schema.rb | 9 |
2 files changed, 18 insertions, 4 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 diff --git a/db/schema.rb b/db/schema.rb index 5027d2ba32f..2c27b228864 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160314143402) do +ActiveRecord::Schema.define(version: 20160316123110) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -260,6 +260,7 @@ ActiveRecord::Schema.define(version: 20160314143402) do end add_index "ci_runners", ["description"], name: "index_ci_runners_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"} + add_index "ci_runners", ["token"], name: "index_ci_runners_on_token", using: :btree add_index "ci_runners", ["token"], name: "index_ci_runners_on_token_trigram", using: :gin, opclasses: {"token"=>"gin_trgm_ops"} create_table "ci_services", force: :cascade do |t| @@ -775,9 +776,9 @@ ActiveRecord::Schema.define(version: 20160314143402) do t.string "type" t.string "title" t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "active", default: false, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "active", null: false t.text "properties" t.boolean "template", default: false t.boolean "push_events", default: true |