aboutsummaryrefslogtreecommitdiffstats
path: root/alembic/env.py
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-04-07 22:54:06 +0100
committerGravatar GitHub <[email protected]>2024-04-07 22:54:06 +0100
commitac45f4c9360c5d6d3be2bfb6f06280df6bc2a4af (patch)
treea4be4dfabcb0e8d900f2fa2189d79ca8b6b63e08 /alembic/env.py
parentMerge pull request #139 from python-discord/jb3/fix-stringed-ids (diff)
parentFix new reported errors from Ruff version bump (diff)
Merge pull request #142 from python-discord/jb3/dep-bumps
Bump Poetry Python version to 3.12
Diffstat (limited to 'alembic/env.py')
-rw-r--r--alembic/env.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/alembic/env.py b/alembic/env.py
index efe2573..f6871e1 100644
--- a/alembic/env.py
+++ b/alembic/env.py
@@ -30,6 +30,7 @@ target_metadata = Base.metadata
config.set_main_option("sqlalchemy.url", build_db_uri())
+
def do_run_migrations(connection: Connection) -> None:
"""Run migrations."""
context.configure(connection=connection, target_metadata=target_metadata)
@@ -37,6 +38,7 @@ def do_run_migrations(connection: Connection) -> None:
with context.begin_transaction():
context.run_migrations()
+
async def run_async_migrations() -> None:
"""Run migrations asynchronously using the asyncpg driver."""
connectable = async_engine_from_config(
@@ -50,6 +52,7 @@ async def run_async_migrations() -> None:
await connectable.dispose()
+
def run_migrations_offline() -> None:
"""
Run migrations in 'offline' mode.