之前一直都是好的,今天模型新增了两张表,更新时报错:
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.
不知道问题出在哪里。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这张表已经创建过了,如果需要追加的话,可以添加
extend_existing=True
参数。谢谢漩涡
我也查到一个方案:
http://stackoverflow.com/questions/7191758/how-to-set-up-a-table-with-a-recursive-foreign-key-and-a-relationship-declarativ
原文用的是