Disable migrate_to_new_scheme once there is nothing to migrate.

This commit is contained in:
Guo Xiang Tan 2019-04-24 13:59:23 +08:00
parent 2e346e6ea2
commit 573ddcbbd0
1 changed files with 6 additions and 0 deletions

View File

@ -212,6 +212,12 @@ class Upload < ActiveRecord::Base
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
if scope.count == 0
SiteSetting.migrate_to_new_scheme = false
return problems
end
remap_scope = nil
scope.each do |upload|