Scotland fly-half Tom Heathcote has agreed to leave Bath to join Edinburgh after signing a one-year deal.