Implement #1579 Default to primary key when adding relation.