Added the migration count function.