首页 > 开发 > Python > 正文

python flask-migrate 使用报错

2017-09-06 19:26:36  来源:网友分享

之前一直都是好的,今天模型新增了两张表,更新时报错:

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参数。