Skip to content

A platform for community discussion. Free, open, simple.

FIX: don't check system uploads in migrate_to_s3 rake task

Régis Hanol9dbca41152e6
diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake
index 5a88a627e6a..f5f1455e1b4 100644
--- a/lib/tasks/uploads.rake
+++ b/lib/tasks/uploads.rake
@@ -218,7 +218,7 @@ def migrate_to_s3
puts "*" * 30 + " DRY RUN " + "*" * 30 if dry_run
puts "Migrating uploads to S3 for '#{db}'..."
- if Upload.where("url NOT LIKE '//%' AND url NOT LIKE '/uploads/#{db}/original/_X/%'").exists?
+ if Upload.by_users.where("url NOT LIKE '//%' AND url NOT LIKE '/uploads/#{db}/original/_X/%'").exists?
puts <<~TEXT
Some uploads were not migrated to the new scheme. Please run these commands in the rails console