Skip to content

Commit

Permalink
🐛 fixed dsn type compatible with docker env
Browse files Browse the repository at this point in the history
  • Loading branch information
agn-7 committed Dec 21, 2023
1 parent a6fe65f commit f812b38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def run_migrations_offline() -> None:
"""

context.configure(
url=settings.SQLALCHEMY_DATABASE_URI.unicode_string(),
url=f"{settings.SQLALCHEMY_DATABASE_URI}",
target_metadata=target_metadata,
literal_binds=True,
compare_types=True,
Expand All @@ -59,9 +59,9 @@ def run_migrations_online() -> None:
"""
configuration = config.get_section(config.config_ini_section)
configuration[
"sqlalchemy.url"
] = settings.SQLALCHEMY_DATABASE_URI.unicode_string().replace("+asyncpg", "")
configuration["sqlalchemy.url"] = f"{settings.SQLALCHEMY_DATABASE_URI}".replace(
"+asyncpg", ""
)
connectable = engine_from_config(
configuration,
prefix="sqlalchemy.",
Expand Down
4 changes: 1 addition & 3 deletions ifsguid/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

from .config import settings

engine: AsyncEngine = create_async_engine(
settings.SQLALCHEMY_DATABASE_URI.unicode_string()
)
engine: AsyncEngine = create_async_engine(f"{settings.SQLALCHEMY_DATABASE_URI}")
async_session = sessionmaker(
autocommit=False,
autoflush=False,
Expand Down

0 comments on commit f812b38

Please sign in to comment.