diff --git a/lib/tasks/seek_upgrades.rake b/lib/tasks/seek_upgrades.rake index 769e95aed1..8bf3e7f183 100644 --- a/lib/tasks/seek_upgrades.rake +++ b/lib/tasks/seek_upgrades.rake @@ -18,6 +18,7 @@ namespace :seek do implement_assay_streams_for_isa_assays set_ls_login_legacy_mode rename_custom_metadata_legacy_supported_type + fix_xlsx_marked_as_zip ] # these are the tasks that are executes for each upgrade as standard, and rarely change @@ -205,6 +206,15 @@ namespace :seek do end end + task(fix_xlsx_marked_as_zip: [:environment]) do + blobs = ContentBlob.where('original_filename LIKE ?','%.xlsx').where(content_type: 'application/zip') + if blobs.any? + n = blobs.count + blobs.update_all(content_type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') + puts "... fixed #{n} XLSX blobs with zip content type" + end + end + private ##