mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Destroy optimized images in upload:migrate_to_s3 rake task.
`OptimizedImage` are currently not renegerated when the image changes store.
This commit is contained in:
@@ -378,6 +378,11 @@ def migrate_to_s3
|
||||
else
|
||||
DbHelper.remap(from, to)
|
||||
end
|
||||
|
||||
OptimizedImage
|
||||
.joins("LEFT JOIN uploads u ON optimized_images.upload_id = u.id")
|
||||
.where("u.id IS NOT NULL AND u.url LIKE '//%' AND optimized_images.url NOT LIKE '//%'")
|
||||
.destroy_all
|
||||
end
|
||||
|
||||
puts "Done!"
|
||||
|
||||
Reference in New Issue
Block a user