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/20210209171525_add_status_index_to_packages_packages.rb')
-rw-r--r--db/migrate/20210209171525_add_status_index_to_packages_packages.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20210209171525_add_status_index_to_packages_packages.rb b/db/migrate/20210209171525_add_status_index_to_packages_packages.rb
new file mode 100644
index 00000000000..cb956165d6e
--- /dev/null
+++ b/db/migrate/20210209171525_add_status_index_to_packages_packages.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddStatusIndexToPackagesPackages < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_packages_packages_on_project_id_and_status'
+
+ def up
+ add_concurrent_index :packages_packages, [:project_id, :status], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :packages_packages, name: INDEX_NAME
+ end
+end