title: Put unique constraint on multiple fields of a model
body: <p>I'm working on a ruby on rails app and I want to put constraint on more than one field in database table i.e :</p>
  
  <pre><code>|id|field_one|field_two
   1  27        Value
   2  27        Value
  </code></pre>
  
  <p>This should be illegal because combination of field_one and field_two should not repeat. This below is perfectly fine :</p>
  
  <pre><code>|id|field_one|field_two
   1  27        Value
   2  28        Value
   3  27        AnotherValue
  </code></pre>
  
  <p>Can I make this constraints at database level? Or I need to do it in my ruby class level?</p>