Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <alexis.reigel.ext@siemens.com>2019-02-06 22:35:22 +0300
committerAlexis Reigel <alexis.reigel.ext@siemens.com>2019-02-27 22:20:24 +0300
commit4667b20c007c4bce248ac6cc458414fefa058bb8 (patch)
tree1f0a6f9b000182d5896ad0c74c2c4648dbf67234 /db/migrate/20190206193120_add_index_to_tags.rb
parent022ee0c0c91d30dea3c1c0472525e86ec8379827 (diff)
add trigram database index on tags
Diffstat (limited to 'db/migrate/20190206193120_add_index_to_tags.rb')
-rw-r--r--db/migrate/20190206193120_add_index_to_tags.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20190206193120_add_index_to_tags.rb b/db/migrate/20190206193120_add_index_to_tags.rb
new file mode 100644
index 00000000000..5257ebba003
--- /dev/null
+++ b/db/migrate/20190206193120_add_index_to_tags.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexToTags < ActiveRecord::Migration[5.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_tags_on_name_trigram'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :tags, :name, name: INDEX_NAME, using: :gin, opclasses: { name: :gin_trgm_ops }
+ end
+
+ def down
+ remove_concurrent_index_by_name(:tags, INDEX_NAME)
+ end
+end