add foreign keys to line devices