summaryrefslogtreecommitdiff
path: root/db/migrate/20201208143911_add_approvals_created_at_index.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20201208143911_add_approvals_created_at_index.rb')
-rw-r--r--db/migrate/20201208143911_add_approvals_created_at_index.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20201208143911_add_approvals_created_at_index.rb b/db/migrate/20201208143911_add_approvals_created_at_index.rb
new file mode 100644
index 00000000000..cfec6b257c2
--- /dev/null
+++ b/db/migrate/20201208143911_add_approvals_created_at_index.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddApprovalsCreatedAtIndex < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_approvals_on_merge_request_id_and_created_at'
+
+ def up
+ add_concurrent_index :approvals, [:merge_request_id, :created_at], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :approvals, INDEX_NAME
+ end
+end