Serialize primary key with table