fix part of rework of primary key in db