python创建迁移仓库失败,怎么解决

(venv) PS D:\python项目\Travel> python manage.py db
 init
Traceback (most recent call last):
  File "manage.py", line 3, in <module>
    from app.models import *
  File "D:\python项目\Travel\app\models.py", line 5
, in <module>
    class User(db.Model):
  File "D:\python项目\Travel\venv\lib\site-packages
\flask_sqlalchemy\model.py", line 92, in __init__  
    super().__init__(name, bases, d, **kwargs)     
  File "D:\python项目\Travel\venv\lib\site-packages
\flask_sqlalchemy\model.py", line 144, in __init__ 
    super().__init__(name, bases, d, **kwargs)     
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\orm\decl_api.py", line 196, in __init__
    _as_declarative(reg, cls, dict_)
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\orm\decl_base.py", line 244, in _as_dec
larative
    return _MapperConfig.setup_mapping(registry, cl
s, dict_, None, {})
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\orm\decl_base.py", line 325, in setup_m
apping
    return _ClassScanMapperConfig(
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\orm\decl_base.py", line 575, in __init_
_
    self._setup_table(table)
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\orm\decl_base.py", line 1726, in _setup
_table
    table_cls(
  File "D:\python项目\Travel\venv\lib\site-packages
\flask_sqlalchemy\model.py", line 178, in __table_c
ls__
    return sa.Table(*args, **kwargs)
  File "<string>", line 2, in __new__
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\util\deprecations.py", line 281, in war
ned
    return fn(*args, **kwargs)  # type: ignore[no-a
ny-return]
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\sql\schema.py", line 431, in __new__   
    return cls._new(*args, **kw)
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\sql\schema.py", line 486, in _new      
    metadata._remove_table(name, schema)
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\util\langhelpers.py", line 146, in __ex
it__
    raise exc_value.with_traceback(exc_tb)
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\sql\schema.py", line 481, in _new      
    table.__init__(name, metadata, *args, _no_init=
False, **kw)
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\sql\schema.py", line 855, in __init__  
    self._extra_kwargs(**kw)
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\sql\schema.py", line 1003, in _extra_kw
args
    self._validate_dialect_kwargs(kwargs)
  File "D:\python项目\Travel\venv\lib\site-packages
\sqlalchemy\sql\base.py", line 596, in _validate_di
alect_kwargs
    raise TypeError(
TypeError: Additional arguments should be named <di
alectname>_<argument>, got 'useexisting'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值