from sqlalchemy import Column, Integer, String
class User(BaseModel):
__tablename__='users'
__table_args__={
"mysql_engine":"InnoDB", # 表的引擎
"mysql_charset":"utf8mb4" # 表的编码格式
}
id=Column("id",Integer,primary_key=True,autoincrement=True)
name=Column("name",String(50),nullable=False)
age=Column("age",Integer,default=0)
没有评论:
发表评论