sqlalchemy.exc.ArgumentError: Mapper mapped class NewsLoog->news_loog could not assemble any primary key columns for mapped table 'news_loog' 报错
原因是我们定义的模型类缺少了一个; 主键; 可能是我们的没有定义 id字段 (flask框架 是不会给我们自动生成 id 字段的) 或者是 我们没有给他 添加 主键约束 ; 导致了我们迁移报错;
如下我们给他加上主键字段就可以了;
id = db.Column(db.Integer, primary_key=True)


被折叠的 条评论
为什么被折叠?



