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
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-10-31 15:11:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-31 15:11:01 +0300
commitf52f8542b47c9e00ddf420abaf2263de168988f9 (patch)
tree568225882da5cc4deb746d2d4fc362c6076fb708 /db
parent6a5ef9b75d38f39cd2a6a2392fadfbd3b966b884 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20231030095419_remove_temp_index_to_packages_on_project_id_when_npm_and_not_pending_destruction.rb23
-rw-r--r--db/schema_migrations/202310300954191
-rw-r--r--db/structure.sql2
3 files changed, 24 insertions, 2 deletions
diff --git a/db/post_migrate/20231030095419_remove_temp_index_to_packages_on_project_id_when_npm_and_not_pending_destruction.rb b/db/post_migrate/20231030095419_remove_temp_index_to_packages_on_project_id_when_npm_and_not_pending_destruction.rb
new file mode 100644
index 00000000000..cd3fccf5f4d
--- /dev/null
+++ b/db/post_migrate/20231030095419_remove_temp_index_to_packages_on_project_id_when_npm_and_not_pending_destruction.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class RemoveTempIndexToPackagesOnProjectIdWhenNpmAndNotPendingDestruction < Gitlab::Database::Migration[2.2]
+ disable_ddl_transaction!
+ milestone '16.7'
+
+ INDEX_NAME = 'tmp_idx_packages_on_project_id_when_npm_not_pending_destruction'
+ NPM_PACKAGE_TYPE = 2
+ PENDING_DESTRUCTION_STATUS = 4
+
+ def up
+ remove_concurrent_index_by_name :packages_packages, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index(
+ :packages_packages,
+ :project_id,
+ name: INDEX_NAME,
+ where: "package_type = #{NPM_PACKAGE_TYPE} AND status <> #{PENDING_DESTRUCTION_STATUS}"
+ )
+ end
+end
diff --git a/db/schema_migrations/20231030095419 b/db/schema_migrations/20231030095419
new file mode 100644
index 00000000000..039ad039283
--- /dev/null
+++ b/db/schema_migrations/20231030095419
@@ -0,0 +1 @@
+99b845e37c091107a0540a182e4376bb0c0b0b2c46def577a96cbcf1971a8cd4 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index bead50c1c50..c9d55842ba2 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -35040,8 +35040,6 @@ CREATE INDEX tmp_idx_orphaned_approval_merge_request_rules ON approval_merge_req
CREATE INDEX tmp_idx_orphaned_approval_project_rules ON approval_project_rules USING btree (id) WHERE ((report_type = ANY (ARRAY[2, 4])) AND (security_orchestration_policy_configuration_id IS NULL));
-CREATE INDEX tmp_idx_packages_on_project_id_when_npm_not_pending_destruction ON packages_packages USING btree (project_id) WHERE ((package_type = 2) AND (status <> 4));
-
CREATE INDEX tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown ON ci_job_artifacts USING btree (expire_at, job_id) WHERE ((locked = 2) AND (expire_at IS NOT NULL));
CREATE INDEX tmp_index_cis_vulnerability_reads_on_id ON vulnerability_reads USING btree (id) WHERE (report_type = 7);