store primary key in metadata