add unique constraint to codes.value