amisadmin / fastapi-user-auth

FastAPI-User-Auth is a simple and powerful FastAPI user RBAC authentication and authorization library. Based on FastAPI-Amis-Admin and provides a freely extensible visual management interface.
319 stars 43 forks source link

alembic upgrade head 升级数据库时报错 #6

Closed dongfengweixiao closed 2 years ago

dongfengweixiao commented 2 years ago

新增任意表后,执行 alembic revision --autogenerate -m "something" 生成脚本,执行 alembic upgrade head 时报错。

发生异常: ProgrammingError (sqlalchemy.dialects.postgresql.asyncpg.ProgrammingError) <class 'asyncpg.exceptions.InvalidTableDefinitionError'>: column "group_id" is in a primary key [SQL: ALTER TABLE auth_group_roles ALTER COLUMN group_id DROP NOT NULL] (Background on this error at: https://sqlalche.me/e/14/f405)

使用数据库为 pgsql,使用的驱动为 asyncpg。如需更多信息,请告知。

amisadmin commented 2 years ago

7