title: Check if a certain column contains a certain value when updating another column
body: <p>I'm having some trouble to find an easy way to check if a column contains a certain value before updating the value in another column in a table row. For example, if I have the table StudentsParticipationInClass like below</p>
  
  <pre>
      |  ID  |  Grade  |  State  |
      |  1   |   'U'   |'OnGoing'|
      |  2   |   '3'   | 'Done'  |
  </pre>
  
  <p>I want a constraint that tells the user that to be able to update the state to Done the Grade must be something else than 'U' or NULL. </p>