debian-mirror-gitlab/db/migrate/20211004075629_add_topics_name_gin_index.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
367 B
Ruby
Raw Normal View History

2021-11-18 22:05:49 +05:30
# frozen_string_literal: true
class AddTopicsNameGinIndex < Gitlab::Database::Migration[1.0]
INDEX_NAME = 'index_topics_on_name_trigram'
disable_ddl_transaction!
def up
add_concurrent_index :topics, :name, name: INDEX_NAME, using: :gin, opclass: { name: :gin_trgm_ops }
end
def down
remove_concurrent_index_by_name :topics, INDEX_NAME
end
end