Add index to items.name database field

I am. Kinda surprised we didn't have this already, huh?? I guess in
most searches, the difference isn't very noticeable, because we don't
have a lot of item names to sort anyway? But we do this *so often* that
I think an index will certainly help! Let's add it!
This commit is contained in:
Emi Matchu 2024-06-03 11:44:06 -07:00
parent 63abfa51f7
commit aa3dc9549f
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,5 @@
class AddIndexOnNameToItems < ActiveRecord::Migration[7.1]
def change
add_index :items, :name
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_05_22_233638) do
ActiveRecord::Schema[7.1].define(version: 2024_06_03_181855) do
create_table "alt_styles", charset: "utf8mb4", collation: "utf8mb4_unicode_520_ci", force: :cascade do |t|
t.integer "species_id", null: false
t.integer "color_id", null: false
@ -140,6 +140,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_05_22_233638) do
t.index ["modeling_status_hint", "created_at"], name: "items_modeling_status_hint_and_created_at"
t.index ["modeling_status_hint", "id"], name: "items_modeling_status_hint_and_id"
t.index ["modeling_status_hint"], name: "items_modeling_status_hint"
t.index ["name"], name: "index_items_on_name"
end
create_table "login_cookies", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_520_ci", force: :cascade do |t|