fix broken test
add sort test
add foreign key