iferr:=UnscopedDb().Delete(entity.Duplicate{},"file_hash IN (SELECT d.file_hash FROM duplicates d LEFT JOIN files f ON d.file_hash = f.file_hash AND f.file_missing = 0 AND f.deleted_at IS NULL WHERE f.file_hash IS NULL)").Error;err==nil{
returnnil
}
// MySQL fallback, see https://github.com/photoprism/photoprism/issues/599
returnUnscopedDb().Delete(entity.Duplicate{},"file_hash IN (SELECT file_hash FROM (SELECT d.file_hash FROM duplicates d LEFT JOIN files f ON d.file_hash = f.file_hash AND f.file_missing = 0 AND f.deleted_at IS NULL WHERE f.file_hash IS NULL) AS tmp)").Error