Improve tag search query (#16104)
This commit is contained in:
parent
daccc07dc1
commit
7f0c49c58a
4 changed files with 35 additions and 10 deletions
|
@ -0,0 +1,13 @@
|
|||
class AddCaseInsensitiveBtreeIndexToTags < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
safety_assured { execute 'CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_name_lower_btree ON tags (lower(name) text_pattern_ops)' }
|
||||
remove_index :tags, name: 'index_tags_on_name_lower'
|
||||
end
|
||||
|
||||
def down
|
||||
safety_assured { execute 'CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_name_lower ON tags (lower(name))' }
|
||||
remove_index :tags, name: 'index_tags_on_name_lower_btree'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue