summaryrefslogtreecommitdiff
path: root/db/migrate/20191105193652_add_index_on_deployments_updated_at.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20191105193652_add_index_on_deployments_updated_at.rb')
-rw-r--r--db/migrate/20191105193652_add_index_on_deployments_updated_at.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20191105193652_add_index_on_deployments_updated_at.rb b/db/migrate/20191105193652_add_index_on_deployments_updated_at.rb
new file mode 100644
index 00000000000..10371c26dcc
--- /dev/null
+++ b/db/migrate/20191105193652_add_index_on_deployments_updated_at.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexOnDeploymentsUpdatedAt < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_COLUMNS = [:project_id, :updated_at]
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:deployments, INDEX_COLUMNS)
+ end
+
+ def down
+ remove_concurrent_index(:deployments, INDEX_COLUMNS)
+ end
+end