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