之前一直都是好的,今天模型新增了两张表,更新时报错:
sqlalchemy.exc.InvalidRequestError: Table 'xxx' is already defined for this MetaData instance. Specify 'extend_existing=True' to redefine options and columns on an existing Table object.
不知道问题出在哪里。
解决方案
Table 'xxx' is already defined for this MetaData instance
这张表已经创建过了,如果需要追加的话,可以添加extend_existing=True
参数。