change spec to indicate which table for key and which is for primary key