Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20210331145548_add_index_for_last_deployment.rb')
-rw-r--r--db/migrate/20210331145548_add_index_for_last_deployment.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20210331145548_add_index_for_last_deployment.rb b/db/migrate/20210331145548_add_index_for_last_deployment.rb
new file mode 100644
index 00000000000..a50d8ea403a
--- /dev/null
+++ b/db/migrate/20210331145548_add_index_for_last_deployment.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexForLastDeployment < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_deployments_on_environment_id_status_and_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :deployments, [:environment_id, :status, :id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :deployments, INDEX_NAME
+ end
+end