Primary key for ways; foreign key to source and target; foreign key from way_tag to ways.