Mike thank you.
I think,
Use __table_args__ This is the definitive usage.
If you can add a sample to the Sqlalchemy documentation.
Let beginners avoid using the wrong method and confused.
Mike Bayer於 2018年3月19日星期一 UTC+8下午9時27分47秒寫道:
>
> On Mon, Mar 19, 2018 at 12:52 AM, lone ois
On Mon, Mar 19, 2018 at 12:52 AM, lone ois wrote:
> Hi!
> i test sqlalchemy 1.1.12 - 1.2.5
> create table check constraint.
> ---
> class testTable(db):
> __tablename__ = 'testTable'
>
> id = Column(INT, primary_key = True, autoincrement
Hi!
i test sqlalchemy 1.1.12 - 1.2.5
create table check constraint.
---
class testTable(db):
__tablename__ = 'testTable'
id = Column(INT, primary_key = True, autoincrement = True, unique =
True)
ser = Column(INT)
CheckConstraint('ser>100')