title: Check constraint for mutually exclusive columns in SQLAlchemy
body: <p>If I have a SQLAlchemy declarative model like below:</p>
  
  <pre><code>class Test(Model):
      __tablename__ = 'tests'
  
      id = Column(Integer, Sequence('test_id_seq'), primary_key=True)
      ...
      Atest_id = Column(Integer, ForeignKey('Atests.id'), nullable=True)
      Btest_id = Column(Integer, ForeignKey('Btests.id'), nullable=True)
      Ctest_id = Column(Integer, ForeignKey('Ctests.id'), nullable=True)
      Dtest_id = Column(Integer, ForeignKey('Dtests.id'), nullable=True)
      Etest_id = Column(Integer, ForeignKey('Etests.id'), nullable=True)
      ...
      date = Column(DateTime)
      status = Column(String(20))  # pass, fail, needs_review
  </code></pre>
  
  <p>And I would like to ensure that only one of the <code>*test_id</code> foreign keys is present in a given row, how might I accomplish that in <code>SQLAlchemy</code>?</p>
  
  <p>I see that there is an <code>SQLAlchemy</code> <code>CheckConstraint</code> object <a href="http://docs.sqlalchemy.org/en/latest/core/constraints.html#check-constraint" rel="noreferrer">(see docs)</a>, but <code>MySQL</code> does not support check constraints.</p>
  
  <p>The data model has interaction outside of <code>SQLAlchemy</code>, so preferably it would be a database-level check (<code>MySQL</code>)</p>