migrate: Fix getVersionNumbers function

Otherwise this code doesn't make sense.