18 lines
515 B
Ruby
18 lines
515 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class AddPartialTrigramIndexForIssueTitle < Gitlab::Database::Migration[2.0]
|
||
|
disable_ddl_transaction!
|
||
|
|
||
|
INDEX_NAME = 'index_issues_on_title_trigram_non_latin'
|
||
|
|
||
|
def up
|
||
|
add_concurrent_index :issues, :title, name: INDEX_NAME,
|
||
|
using: :gin, opclass: { description: :gin_trgm_ops },
|
||
|
where: "title NOT SIMILAR TO '[\\u0000-\\u218F]*' OR description NOT SIMILAR TO '[\\u0000-\\u218F]*'"
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
remove_concurrent_index_by_name :issues, INDEX_NAME
|
||
|
end
|
||
|
end
|