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/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb')
-rw-r--r--db/post_migrate/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb b/db/post_migrate/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb
new file mode 100644
index 00000000000..ce09a48833f
--- /dev/null
+++ b/db/post_migrate/20221019195754_disable_fastupdate_on_issues_description_gin_index.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class DisableFastupdateOnIssuesDescriptionGinIndex < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_issues_on_description_trigram'
+
+ def up
+ with_lock_retries do
+ execute <<~SQL
+ ALTER INDEX #{INDEX_NAME} SET ( fastupdate = false ) ;
+ SQL
+ end
+ end
+
+ def down
+ with_lock_retries do
+ execute <<~SQL
+ ALTER INDEX #{INDEX_NAME} RESET ( fastupdate ) ;
+ SQL
+ end
+ end
+end