2017-08-17 22:00:37 +05:30
|
|
|
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
|
|
|
|
# for more information on how to write migrations for GitLab.
|
|
|
|
|
|
|
|
# Remove all files from old custom carrierwave's cache directories.
|
|
|
|
# See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9466
|
|
|
|
|
2018-12-23 12:14:25 +05:30
|
|
|
class RemoveOldCacheDirectories < ActiveRecord::Migration[4.2]
|
2017-08-17 22:00:37 +05:30
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
# FileUploader cache.
|
|
|
|
FileUtils.rm_rf(Dir[Rails.root.join('public', 'uploads', 'tmp', '*')])
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
# Old cache is not supposed to be recoverable.
|
|
|
|
# So the down method is empty.
|
|
|
|
end
|
|
|
|
end
|