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