updateReward :: ExperimentId -> UserId -> Reward -> RunHRRBackend ()
updateReward eid uid rew conn = do
  ps <- Update.prepareUpdate conn upd
  _  <- Update.runPreparedUpdate ps ()
  return ()
  where
    upd =
      typedUpdate tableOfAssignment . updateTarget $ \proj -> do
        asReward' <-# value rew
        wheres $ proj ! asExperimentId' .=. value eid
        wheres $ proj ! asUserId' .=. value uid
        wheres $ proj ! asReward' .=. value (MkReward 0.0)
updateReward :: ExperimentId -> UserId -> Reward -> RunHRRBackend ()
updateReward eid uid rew conn = do
  ps <- Update.prepareUpdate conn upd
  _  <- Update.runPreparedUpdate ps ()
  return ()
  where
    upd =
      typedUpdate tableOfAssignment . updateTarget $ \proj -> do
        asReward' <-# value rew
        wheres $ proj ! asExperimentId' .=. value eid
        wheres $ proj ! asUserId' .=. value uid
        wheres $ proj ! asReward' .=. value (MkReward 0.0)
updateReward eid uid rew conn = do
  ps <- Update.prepareUpdate conn upd
  _  <- Update.runPreparedUpdate ps ()
  return ()
  where
    upd =
      typedUpdate tableOfAssignment . updateTarget $ \proj -> do
        asReward' <-# value rew
        wheres $ proj ! asExperimentId' .=. value eid
        wheres $ proj ! asUserId' .=. value uid
        wheres $ proj ! asReward' .=. value (MkReward 0.0)