diff options
author | Stan Hu <stanhu@gmail.com> | 2016-05-28 03:05:34 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-05-29 23:03:08 -0700 |
commit | 9485b65abb4efaec1f8369d66e289ad882341330 (patch) | |
tree | af33149a0815bfb5753e913f8dfe168e10935133 /db | |
parent | 43c35b0f20fb3bb67ea2b96bf8f806c7e95b6aec (diff) | |
download | gitlab-ce-9485b65abb4efaec1f8369d66e289ad882341330.tar.gz |
Add DB index on users.state
Closes #17920
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160528043124_add_users_state_index.rb | 9 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/db/migrate/20160528043124_add_users_state_index.rb b/db/migrate/20160528043124_add_users_state_index.rb new file mode 100644 index 00000000000..e77a5460737 --- /dev/null +++ b/db/migrate/20160528043124_add_users_state_index.rb @@ -0,0 +1,9 @@ +class AddUsersStateIndex < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + disable_ddl_transaction! + + def change + add_concurrent_index :users, :state + end +end diff --git a/db/schema.rb b/db/schema.rb index b42eef08a00..c7eeaadb131 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: 20160525205328) do +ActiveRecord::Schema.define(version: 20160528043124) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1000,6 +1000,7 @@ ActiveRecord::Schema.define(version: 20160525205328) do add_index "users", ["name"], name: "index_users_on_name", using: :btree add_index "users", ["name"], name: "index_users_on_name_trigram", using: :gin, opclasses: {"name"=>"gin_trgm_ops"} add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree + add_index "users", ["state"], name: "index_users_on_state", using: :btree add_index "users", ["username"], name: "index_users_on_username", using: :btree add_index "users", ["username"], name: "index_users_on_username_trigram", using: :gin, opclasses: {"username"=>"gin_trgm_ops"} |