mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 13:23:38 +08: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:
parent
fdd2e7f2e7
commit
4e594f2b2b
|
@ -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!"
|
||||
|
|
Loading…
Reference in New Issue
Block a user