migration: use Comparator instead of Sorter in code

Signed-off-by: Jean Privat <jean@pryen.org>