Actually take foreign keys into use