Fix mongo connection

This commit is contained in:
stijndcl 2022-07-25 20:33:20 +02:00
parent 9abe5dd519
commit 52b452c85a
16 changed files with 53 additions and 38 deletions

View file

@ -4,7 +4,7 @@ from logging.config import fileConfig
from sqlalchemy.ext.asyncio import AsyncEngine
from alembic import context
from database.engine import engine
from database.engine import postgres_engine
from database.models import Base
# this is the Alembic Config object, which provides
@ -40,7 +40,7 @@ def run_migrations_online() -> None:
and associate a connection with the context.
"""
connectable = context.config.attributes.get("connection", None) or engine
connectable = context.config.attributes.get("connection", None) or postgres_engine
if isinstance(connectable, AsyncEngine):
asyncio.run(run_async_migrations(connectable))