Historisk uppgörelse i EUEU:s medlemsländer har nått en historisk uppgörelse om framtidens asyl och migration.