summaryrefslogtreecommitdiff
path: root/db/migrate/20201103095752_add_issues_closed_at_index.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20201103095752_add_issues_closed_at_index.rb')
-rw-r--r--db/migrate/20201103095752_add_issues_closed_at_index.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20201103095752_add_issues_closed_at_index.rb b/db/migrate/20201103095752_add_issues_closed_at_index.rb
new file mode 100644
index 00000000000..7a8ee4e8d67
--- /dev/null
+++ b/db/migrate/20201103095752_add_issues_closed_at_index.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIssuesClosedAtIndex < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:issues, [:project_id, :closed_at])
+ end
+
+ def down
+ remove_concurrent_index_by_name(:issues, 'index_issues_on_project_id_and_closed_at')
+ end
+end