summaryrefslogtreecommitdiff
path: root/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 10:34:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 10:34:06 +0000
commit859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch)
treed7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb
parent446d496a6d000c73a304be52587cd9bbc7493136 (diff)
downloadgitlab-ce-859a6fb938bb9ee2a317c46dfa4fcc1af49608f0.tar.gz
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb')
-rw-r--r--db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb b/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb
new file mode 100644
index 00000000000..e2853977e5f
--- /dev/null
+++ b/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddOrphanIndexToComposerCacheFiles < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_composer_cache_files_where_namespace_id_is_null'
+
+ def up
+ add_concurrent_index :packages_composer_cache_files, :id, name: INDEX_NAME, where: 'namespace_id IS NULL'
+ end
+
+ def down
+ remove_concurrent_index_by_name :packages_composer_cache_files, INDEX_NAME
+ end
+end