flsak + could not assemble any primary key columns for mapped table

在进行flsak项目迁移时

sqlalchemy.exc.ArgumentError: Mapper Mapper|TenHum|表名could not assemble any primary key columns for mapped table '表名'
刚看到这报错时,一脸懵逼,仔细看了下,好像说时关于主键有问题,
但网上找了好多都没有,最后在stackoverflow 上找到了答案,出现这问题的原因大致是,在定义数据库模型类的字段时,两个字段之间多了个逗号,
https://stackoverflow.com/questions/24872541/could-not-assemble-any-primary-key-columns-for-mapped-table
在这里插入图片描述

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐