index users on username (#674)

This commit is contained in:
Echo 2025-12-01 11:20:06 -05:00 committed by GitHub
parent 04ce935e69
commit 5f5257c752
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -0,0 +1,7 @@
class AddIndexToUsersUsername < ActiveRecord::Migration[8.0]
disable_ddl_transaction!
def change
add_index :users, :username, algorithm: :concurrently
end
end

4
db/schema.rb generated
View file

@ -10,9 +10,8 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.1].define(version: 2025_11_16_045500) do
ActiveRecord::Schema[8.1].define(version: 2025_12_01_161700) do
create_schema "pganalyze"
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"
enable_extension "pg_stat_statements"
@ -568,6 +567,7 @@ ActiveRecord::Schema[8.1].define(version: 2025_11_16_045500) do
t.index ["slack_uid"], name: "index_users_on_slack_uid", unique: true
t.index ["timezone", "trust_level"], name: "index_users_on_timezone_trust_level"
t.index ["timezone"], name: "index_users_on_timezone"
t.index ["username"], name: "index_users_on_username"
end
create_table "versions", force: :cascade do |t|