diff options
Diffstat (limited to 'db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb')
-rw-r--r-- | db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb b/db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb new file mode 100644 index 00000000000..9c6a27812a5 --- /dev/null +++ b/db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddExpiredIndexToComposerCacheFiles < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + INDEX_NAME = 'composer_cache_files_index_on_deleted_at' + + def up + add_concurrent_index :packages_composer_cache_files, [:delete_at, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :packages_composer_cache_files, INDEX_NAME + end +end |