title: UNIQUE Constraint, only when a field contains a specific value
body: <p>I'm trying to create a UNIQUE INDEX constraint for two columns, but only when another column contains the value 1. For example, <code>column_1</code> and <code>column_2</code> should be UNIQUE only when <code>active = 1</code>. Any rows that contain <code>active = 0</code> can share values for <code>column_1</code> and <code>column_2</code> with another row, regardless of what the other row's value for <code>active</code> is. But rows where <code>active = 1</code> cannot share values of <code>column_1</code> or <code>column_2</code> with another row that has <code>active = 1</code>.</p>
  
  <p>What I mean by "share" is two rows having the same value(s) in the same column(s). Example: row1.a = row2.a AND row1.b = row2.b. Values would be shared only if both columns in row1 matched the other two columns in row2.</p>
  
  <p>I hope I made myself clear. :\</p>