admin管理员组文章数量:1186154
# Database setup
DATABASE_URL = postgresql+psycopg2://....
engine = create_engine(
DATABASE_URL, future=True
)
SessionLocal = sessionmaker(
autocommit=False, autoflush=False, bind=engine, future=True
)
Base = declarative_base()
def get_database():
db = SessionLocal()
try:
yield db
finally:
db.close()
I get this error after executing command alembic revision --autogenerate -m "initial migrations"
:
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InvalidSchemaName) no schema has been selected to create in LINE 2: CREATE TABLE alembic_version ( .......
How can I fix this?
本文标签: pythonProblem with setting up Alembic with FastAPI and PostgresqlStack Overflow
版权声明:本文标题:python - Problem with setting up Alembic with FastAPI and Postgresql - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738302935a2073697.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论