FIX: should not migrate the system uploads to s3

FIX: should not migrate the system uploads to s3

diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake
index a507f70..5704cf3 100644
--- a/lib/tasks/uploads.rake
+++ b/lib/tasks/uploads.rake
@@ -441,7 +441,7 @@ def migrate_to_s3
   end
 
   base_url = File.join(SiteSetting.Upload.s3_base_url, prefix)
-  count = Upload.where("url NOT LIKE '#{base_url}%'").count
+  count = Upload.where("id >= 0 AND url NOT LIKE '#{base_url}%'").count
   raise "#{count} of #{Upload.count} uploads are not migrated to S3. #{failure_message}" if count > 0
 
   cdn_path = SiteSetting.cdn_path("/uploads/#{db}").sub(/https?:/, "")

GitHub sha: bc0c4b72

This commit message is abit misleading because we don’t actually migrate system uploads.

Yes. Maybe we should say “default uploads” instead since we have system user.

1 Like