# Returns the disk_path value before the execution
attr_reader:old_disk_path
# Returns the disk_path value after the execution
attr_reader:new_disk_path
# Returns the logger currently in use
attr_reader:logger
# Return whether this operation was skipped or not
#
# @return [Boolean] true if skipped of false otherwise
defskipped?
@skipped
end
protected
defmove_folder!(old_path,new_path)
unlessFile.directory?(old_path)
logger.info("Skipped attachments move from '#{old_path}' to '#{new_path}', source path doesn't exist or is not a directory (PROJECT_ID=#{project.id})")
@skipped=true
returntrue
end
ifFile.exist?(new_path)
logger.error("Cannot move attachments from '#{old_path}' to '#{new_path}', target path already exist (PROJECT_ID=#{project.id})")
logger.info("Skipped attachments migration from '#{old_path}' to '#{new_path}', source path doesn't exist or is not a directory (PROJECT_ID=#{project.id})")
@skipped=true
returntrue
end
ifresult
project.save!
ifFile.exist?(new_path)
logger.error("Cannot migrate attachments from '#{old_path}' to '#{new_path}', target path already exist (PROJECT_ID=#{project.id})")
Upload.joins(<<~SQL).where('projects.storage_version < :version OR projects.storage_version IS NULL',version: Project::HASHED_STORAGE_FEATURES[:attachments])