Kaluza-Klein reduction of massive and partially massless spin-2 fields