eBooru/db/migrate/20230518182034_add_user_about_indicies.rb
Earlopain fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00

11 lines
518 B
Ruby

# frozen_string_literal: true
class AddUserAboutIndicies < ActiveRecord::Migration[7.0]
def up
add_index :users, "(to_tsvector('english', profile_about))", using: :gin
add_index :users, "(to_tsvector('english', profile_artinfo))", using: :gin
execute("CREATE INDEX index_users_on_lower_profile_about_trgm ON users USING gin ((lower(profile_about)) gin_trgm_ops)")
execute("CREATE INDEX index_users_on_lower_profile_artinfo_trgm ON users USING gin ((lower(profile_artinfo)) gin_trgm_ops)")
end
end