我正在尝试为表Task添加一个约束,如下所示:
class Test(Base):
__tablename__ = 'test'
id = Column('id', INTEGER, primary_key=True)
name = Column('name', VARCHAR(30))
progress = Column(
'progress', VARCHAR(4),
CheckConstraint('progress like "[0-9]"'),
server_default='0'
)
但是,如果我尝试在“ progress”列中添加一些数字,则会与“ CK_Test_Progress”产生冲突