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/20220901071310_add_tmp_index_user_callouts_on_attention_request_feature_names.rb')
-rw-r--r--db/post_migrate/20220901071310_add_tmp_index_user_callouts_on_attention_request_feature_names.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/post_migrate/20220901071310_add_tmp_index_user_callouts_on_attention_request_feature_names.rb b/db/post_migrate/20220901071310_add_tmp_index_user_callouts_on_attention_request_feature_names.rb
new file mode 100644
index 00000000000..10b339b90c1
--- /dev/null
+++ b/db/post_migrate/20220901071310_add_tmp_index_user_callouts_on_attention_request_feature_names.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddTmpIndexUserCalloutsOnAttentionRequestFeatureNames < Gitlab::Database::Migration[2.0]
+ INDEX_NAME = "tmp_index_user_callouts_on_attention_request_feature_names"
+ ATTENTION_REQUEST_CALLOUTS = [47, 48]
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :user_callouts, [:id],
+ where: "feature_name IN (#{ATTENTION_REQUEST_CALLOUTS.join(',')})",
+ name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :user_callouts, INDEX_NAME
+ end
+end