Add an index to users.old_username (#13102)
We have one for username and for old_old_username, but not the one in between.
This commit is contained in:
parent
7c45df1d81
commit
ec39e0c000
2 changed files with 10 additions and 1 deletions
|
|
@ -0,0 +1,8 @@
|
|||
class AddIndexesToOldUsernames < ActiveRecord::Migration[6.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
# Used in StoriesController#show and #index
|
||||
add_index :users, :old_username, algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_03_12_191925) do
|
||||
ActiveRecord::Schema.define(version: 2021_03_23_190443) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "citext"
|
||||
|
|
@ -1362,6 +1362,7 @@ ActiveRecord::Schema.define(version: 2021_03_12_191925) do
|
|||
t.index ["invited_by_id"], name: "index_users_on_invited_by_id"
|
||||
t.index ["invited_by_type", "invited_by_id"], name: "index_users_on_invited_by_type_and_invited_by_id"
|
||||
t.index ["old_old_username"], name: "index_users_on_old_old_username"
|
||||
t.index ["old_username"], name: "index_users_on_old_username"
|
||||
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
||||
t.index ["twitter_username"], name: "index_users_on_twitter_username", unique: true
|
||||
t.index ["username"], name: "index_users_on_username", unique: true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue