fix primary keys order