mirror of
https://github.com/discourse/discourse.git
synced 2024-12-30 10:03:44 +08:00
25 lines
508 B
Ruby
25 lines
508 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class AddTrigramIndexesToUsers < ActiveRecord::Migration[7.0]
|
||
|
disable_ddl_transaction!
|
||
|
|
||
|
def change
|
||
|
add_index(
|
||
|
:users,
|
||
|
:username_lower,
|
||
|
using: "gist",
|
||
|
opclass: :gist_trgm_ops,
|
||
|
algorithm: :concurrently,
|
||
|
name: "index_users_on_username_lower_trgm",
|
||
|
)
|
||
|
add_index(
|
||
|
:users,
|
||
|
:name,
|
||
|
using: "gist",
|
||
|
opclass: :gist_trgm_ops,
|
||
|
algorithm: :concurrently,
|
||
|
name: "index_users_on_name_trgm",
|
||
|
)
|
||
|
end
|
||
|
end
|