Is it possible to create a contraint on a table and specify a value on one or more of the columns? Condsider this example:
mytable = Table('mytable', meta,
# per-column anonymous unique constraint
Column('col1', Integer,),
Column('col2', Integer),
Column('col3', ENUM('ready', 'pass', 'fail'),
UniqueConstraint('col2', 'col2', 'col3', name='uix_1')
)
But I dont only want uniqueness when col3 is equal to something like a state of 'ready' (I WANT multiple success or failures).
UniqueConstraint('col2', 'col2', 'col3 == ready', name='uix_1')
Is this possible in the sqlalchemy api?