summaryrefslogtreecommitdiff
path: root/db/migrate/20181106135939_add_index_to_deployments.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20181106135939_add_index_to_deployments.rb')
-rw-r--r--db/migrate/20181106135939_add_index_to_deployments.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20181106135939_add_index_to_deployments.rb b/db/migrate/20181106135939_add_index_to_deployments.rb
new file mode 100644
index 00000000000..5f988a4723c
--- /dev/null
+++ b/db/migrate/20181106135939_add_index_to_deployments.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexToDeployments < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :deployments, [:project_id, :status, :created_at]
+ end
+
+ def down
+ remove_concurrent_index :deployments, [:project_id, :status, :created_at]
+ end
+end