add foreign keys to tables