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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-08 00:10:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-08 00:10:15 +0300
commit4cf8d931aa8511aa93b8504e940d2f5ddfee7b4c (patch)
tree1c2cd88c4d895757f08b73708bf49b182cc0a715 /db/migrate/20231020181652_add_index_packages_npm_metadata_caches_on_id_and_project_id_and_status.rb
parentfbe6bd7c6aae0beb81fa47d5834393ed92662885 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20231020181652_add_index_packages_npm_metadata_caches_on_id_and_project_id_and_status.rb')
-rw-r--r--db/migrate/20231020181652_add_index_packages_npm_metadata_caches_on_id_and_project_id_and_status.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20231020181652_add_index_packages_npm_metadata_caches_on_id_and_project_id_and_status.rb b/db/migrate/20231020181652_add_index_packages_npm_metadata_caches_on_id_and_project_id_and_status.rb
new file mode 100644
index 00000000000..6350ad935ca
--- /dev/null
+++ b/db/migrate/20231020181652_add_index_packages_npm_metadata_caches_on_id_and_project_id_and_status.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexPackagesNpmMetadataCachesOnIdAndProjectIdAndStatus < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'idx_pkgs_npm_metadata_caches_on_id_and_project_id_and_status'
+ NPM_METADATA_CACHES_STATUS_DEFAULT = 0
+
+ def up
+ where = "project_id IS NULL AND status = #{NPM_METADATA_CACHES_STATUS_DEFAULT}"
+
+ add_concurrent_index :packages_npm_metadata_caches, :id, name: INDEX_NAME, where: where
+ end
+
+ def down
+ remove_concurrent_index_by_name :packages_npm_metadata_caches, name: INDEX_NAME
+ end
+end