sqlalchemy.exc.CompileError: (in table 'user', column 'username'): VARCHAR requires a length on dialect mysql

映射数据库时报错:sqlalchemy.exc.CompileError: (in table 'user', column 'username'): VARCHAR requires a length on dialect mysql

错误代码:

username = db.Column(db.String)

String需要指定长度,如:

username = db.Column(db.String(50))

 

posted @ 2019-12-03 18:22  小呆丶  阅读(3258)  评论(0编辑  收藏  举报