A platform for community discussion. Free, open, simple.
FIX: Rake tasks related to uploads were broken (#17085)
Gerhard Schlager96e87af6053c
diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rakeindex 898f21cd972..8a12c168cef 100644--- a/lib/tasks/uploads.rake+++ b/lib/tasks/uploads.rake@@ -857,11 +857,11 @@ enddef analyze_missing_s3puts "List of posts with missing images:"sql = <<~SQL- SELECT post_id, url, sha1, extension, uploads.id+ SELECT ur.target_id, u.url, u.sha1, u.extension, u.idFROM upload_references ur- RIGHT JOIN uploads on uploads.id = ur.upload_id- WHERE ur.target_type = 'Post' AND verification_status = :invalid_etag- ORDER BY created_at+ RIGHT JOIN uploads u ON u.id = ur.upload_id+ WHERE ur.target_type = 'Post' AND u.verification_status = :invalid_etag+ ORDER BY ur.created_atSQLlookup = {}@@ -1047,12 +1047,11 @@ def fix_missing_s3puts "Rebaking posts with missing uploads, this can take a while as all rebaking runs inline"sql = <<~SQL- SELECT target_id+ SELECT ur.target_idFROM upload_references ur- JOIN uploads on uploads.id = ur.upload_id- WHERE ur.target_type = 'Post'- WHERE verification_status = :invalid_etag- ORDER BY target_id DESC+ JOIN uploads u ON u.id = ur.upload_id+ WHERE ur.target_type = 'Post' AND u.verification_status = :invalid_etag+ ORDER BY ur.target_id DESCSQLDB.query_single(sql, invalid_etag: Upload.verification_statuses[:invalid_etag]).each do |post_id|