Update and add several foreign keys