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:
Diffstat (limited to 'db/post_migrate/20221122063922_remove_issue_title_trigram_index.rb')
-rw-r--r--db/post_migrate/20221122063922_remove_issue_title_trigram_index.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/db/post_migrate/20221122063922_remove_issue_title_trigram_index.rb b/db/post_migrate/20221122063922_remove_issue_title_trigram_index.rb
new file mode 100644
index 00000000000..80a2020a364
--- /dev/null
+++ b/db/post_migrate/20221122063922_remove_issue_title_trigram_index.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class RemoveIssueTitleTrigramIndex < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_issues_on_title_trigram'
+
+ def up
+ remove_concurrent_index_by_name :issues, name: INDEX_NAME
+ end
+
+ def down
+ disable_statement_timeout do
+ execute <<-SQL
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS #{INDEX_NAME} ON issues
+ USING gin (title gin_trgm_ops) WITH (fastupdate='false')
+ SQL
+ end
+ end
+end