1- from logging .config import fileConfig
1+ from logging .config import fileConfig # isort:skip
22
3- from main import Hero
4- from sqlmodel import SQLModel
3+ from main import Hero # isort:skip
4+ from sqlmodel import SQLModel # isort:skip
55
6- from sqlalchemy import engine_from_config
7- from sqlalchemy import pool
6+ from sqlalchemy import engine_from_config # isort:skip
7+ from sqlalchemy import pool # isort:skip
88
9- from alembic import context
9+ from alembic import context # isort:skip
1010
1111# this is the Alembic Config object, which provides
1212# access to the values within the .ini file in use.
3232
3333def run_migrations_offline () -> None :
3434 """Run migrations in 'offline' mode.
35-
3635 This configures the context with just a URL
3736 and not an Engine, though an Engine is acceptable
3837 here as well. By skipping the Engine creation
3938 we don't even need a DBAPI to be available.
40-
4139 Calls to context.execute() here emit the given string to the
4240 script output.
43-
4441 """
4542 url = config .get_main_option ("sqlalchemy.url" )
4643 context .configure (
@@ -56,10 +53,8 @@ def run_migrations_offline() -> None:
5653
5754def run_migrations_online () -> None :
5855 """Run migrations in 'online' mode.
59-
6056 In this scenario we need to create an Engine
6157 and associate a connection with the context.
62-
6358 """
6459 connectable = engine_from_config (
6560 config .get_section (config .config_ini_section ),
@@ -68,9 +63,7 @@ def run_migrations_online() -> None:
6863 )
6964
7065 with connectable .connect () as connection :
71- context .configure (
72- connection = connection , target_metadata = target_metadata
73- )
66+ context .configure (connection = connection , target_metadata = target_metadata )
7467
7568 with context .begin_transaction ():
7669 context .run_migrations ()
0 commit comments