FIX: Restrict scope of old scheme upload migration.
Some sites have external URLs that don't even match `%/uploads/%' and some sites surprise me with URLs that contains the default path when it is a site in a multisite cluster. We can't do anything about those.
This commit is contained in:
parent
0de2253d55
commit
4037a2fd0b
|
@ -224,8 +224,7 @@ class Upload < ActiveRecord::Base
|
|||
max_file_size_kb = [SiteSetting.max_image_size_kb, SiteSetting.max_attachment_size_kb].max.kilobytes
|
||||
local_store = FileStore::LocalStore.new
|
||||
|
||||
scope = Upload.by_users
|
||||
.where("url NOT LIKE '%/original/_X/%'")
|
||||
scope = Upload.by_users.where("url NOT LIKE '%/original/_X/%' AND url LIKE '%/uploads/#{RailsMultisite::ConnectionManagement.current_db}%'")
|
||||
.order(id: :desc)
|
||||
|
||||
scope = scope.limit(limit) if limit
|
||||
|
|
Loading…
Reference in New Issue