eBooru/db/migrate/20230518182034_add_user_about_indicies.rb

11 lines
518 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2023-05-18 14:48:01 -04:00
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