title: Constraint that checks there is only one is_primary true in one to many group
body: <p>In a one-to-many table setup say <code>customer</code> to <code>phone</code>. Where one customer can have many phones.</p>
  <p>The table for <code>phone</code> has a column <code>is_primary</code> so that the applications knows which one to use under normal circumstances. There can only be one <code>is_primay</code> that is <code>true</code> and n that can be <code>false</code>.</p>
  <p>Is there any constraint in MySQL that can be applied to enforce the above scenario? The application currently protects against this but we wanted to add a block at the db.</p>
  <p>A unique constraint does not allow for the n number of false phone. It would make is so only 1 true and 1 false per customer.</p>
  <p>There is the idea of a partial unique constraint but I cannot find docs in MySQL for this just postgres.</p>