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/migrate/20210216223335_remove_index_on_issues_where_service_desk_reply_to_is_not_null.rb')
-rw-r--r--db/migrate/20210216223335_remove_index_on_issues_where_service_desk_reply_to_is_not_null.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20210216223335_remove_index_on_issues_where_service_desk_reply_to_is_not_null.rb b/db/migrate/20210216223335_remove_index_on_issues_where_service_desk_reply_to_is_not_null.rb
new file mode 100644
index 00000000000..5224b6f7031
--- /dev/null
+++ b/db/migrate/20210216223335_remove_index_on_issues_where_service_desk_reply_to_is_not_null.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RemoveIndexOnIssuesWhereServiceDeskReplyToIsNotNull < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ INDEX_TABLE = :issues
+ INDEX_NAME = 'idx_on_issues_where_service_desk_reply_to_is_not_null'
+
+ def up
+ Gitlab::BackgroundMigration.steal('PopulateIssueEmailParticipants')
+ remove_concurrent_index_by_name INDEX_TABLE, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index(INDEX_TABLE, [:id], name: INDEX_NAME, where: 'service_desk_reply_to IS NOT NULL')
+ end
+end