diff options
author | Rémy Coutable <remy@rymai.me> | 2019-09-11 08:19:02 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-09-11 08:19:02 +0000 |
commit | bfaa96d586668678893e295062495f2c35b73c2a (patch) | |
tree | 9b598b46a8e802ccc162f08b310c4ef1261442e2 /db | |
parent | b88728e7b13fb193bc3a359e18f23b371bc93d16 (diff) | |
parent | 08c3e59aeed34ad71e74afb674ddda7327fdc3a7 (diff) | |
download | gitlab-ce-bfaa96d586668678893e295062495f2c35b73c2a.tar.gz |
Merge branch 'sh-fix-oauth-application-page' into 'master'
Optimize /admin/applications so that it does not timeout
Closes #67228
See merge request gitlab-org/gitlab-ce!32852
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20190910000130_add_index_on_application_id_on_oauth_access_tokens.rb | 17 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 19 insertions, 1 deletions
diff --git a/db/post_migrate/20190910000130_add_index_on_application_id_on_oauth_access_tokens.rb b/db/post_migrate/20190910000130_add_index_on_application_id_on_oauth_access_tokens.rb new file mode 100644 index 00000000000..78f7c0ecf0f --- /dev/null +++ b/db/post_migrate/20190910000130_add_index_on_application_id_on_oauth_access_tokens.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnApplicationIdOnOauthAccessTokens < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :oauth_access_tokens, :application_id + end + + def down + remove_concurrent_index :oauth_access_tokens, :application_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 70f3a42e7f8..14ce50b0619 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_09_05_223900) do +ActiveRecord::Schema.define(version: 2019_09_10_000130) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -2390,6 +2390,7 @@ ActiveRecord::Schema.define(version: 2019_09_05_223900) do t.datetime "revoked_at" t.datetime "created_at", null: false t.string "scopes" + t.index ["application_id"], name: "index_oauth_access_tokens_on_application_id" t.index ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true t.index ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id" t.index ["token"], name: "index_oauth_access_tokens_on_token", unique: true |