Skip to content

Commit 55e59f9

Browse files
committed
Index people on name to speed up autocomplete
1 parent d71f98f commit 55e59f9

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddNameIndexToPeople < ActiveRecord::Migration[7.2]
2+
def change
3+
add_index :people, :name
4+
end
5+
end

db/schema.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.2].define(version: 2026_03_05_104021) do
13+
ActiveRecord::Schema[7.2].define(version: 2026_03_10_163512) do
1414
# These are extensions that must be enabled in order to support this database
1515
enable_extension "plpgsql"
1616

@@ -438,6 +438,7 @@
438438
t.bigint "profile_id"
439439
t.datetime "created_at", null: false
440440
t.datetime "updated_at", null: false
441+
t.index ["name"], name: "index_people_on_name"
441442
t.index ["orcid"], name: "index_people_on_orcid"
442443
t.index ["profile_id"], name: "index_people_on_profile_id"
443444
t.index ["resource_type", "resource_id", "role"], name: "index_people_on_resource_type_and_resource_id_and_role"

0 commit comments

Comments
 (0)