From 8282015281efb02f881a7e8b5605cb31b81603ed Mon Sep 17 00:00:00 2001 From: Batuhan Erenler <40266535+batuhanerenler@users.noreply.github.com> Date: Fri, 6 Jan 2023 02:22:11 +0300 Subject: [PATCH] Update env.py --- backend/alembic/env.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/alembic/env.py b/backend/alembic/env.py index 6a8dc424..90d53230 100644 --- a/backend/alembic/env.py +++ b/backend/alembic/env.py @@ -1,9 +1,12 @@ + + import logging from alembic import context from oasst_backend import models # noqa: F401 from sqlalchemy import engine_from_config, pool + # Read in the Alembic config file. config = context.config # Set up loggers. @@ -14,6 +17,8 @@ target_metadata = models.Base.metadata # Other values from the config file can be acquired as follows: # my_important_option = config.get_main_option("my_important_option") # ... etc. + + def run_migrations_offline() -> None: """Run migrations in 'offline' mode. @@ -27,6 +32,8 @@ def run_migrations_offline() -> None: ) with context.begin_transaction(): context.run_migrations() + + def run_migrations_online() -> None: """Run migrations in 'online' mode.