diff options
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.rb | 23 |
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 |