DEV: Get only matching records to backfill etags
This commit is contained in:
parent
e2f7db5549
commit
a9a8855739
|
@ -47,7 +47,7 @@ class S3Inventory
|
|||
end
|
||||
|
||||
if backfill_etags
|
||||
uploads = model.where(etag: nil).joins("LEFT JOIN #{table_name} ON #{model.table_name}.url ILIKE '%' || #{table_name}.key")
|
||||
uploads = model.where(etag: nil).joins("INNER JOIN #{table_name} ON #{model.table_name}.url ILIKE '%' || #{table_name}.key")
|
||||
uploads.select(:id, :"#{table_name}.etag").find_each do |upload|
|
||||
model.where(id: upload.id).update_all(etag: upload.etag)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue