diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-27 18:06:20 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-27 18:06:20 +0000 |
commit | 2abb1b54c0305b359b178d6660810e865f619c22 (patch) | |
tree | e388953a0566ef9844b0b98cdb34236049721a14 /db/migrate/20190927074328_add_index_on_snippet_content.rb | |
parent | 8320f7956d72986f5a7c850874fce4f8b5a8e015 (diff) | |
download | gitlab-ce-2abb1b54c0305b359b178d6660810e865f619c22.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20190927074328_add_index_on_snippet_content.rb')
-rw-r--r-- | db/migrate/20190927074328_add_index_on_snippet_content.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20190927074328_add_index_on_snippet_content.rb b/db/migrate/20190927074328_add_index_on_snippet_content.rb new file mode 100644 index 00000000000..ef7583508f2 --- /dev/null +++ b/db/migrate/20190927074328_add_index_on_snippet_content.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnSnippetContent < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'index_snippets_on_content_trigram' + + disable_ddl_transaction! + + def up + add_concurrent_index :snippets, :content, name: INDEX_NAME, using: :gin, opclass: { content: :gin_trgm_ops } + end + + def down + remove_concurrent_index_by_name(:snippets, INDEX_NAME) + end +end |