1- import os
21from logging.config import fileConfig
32
43from alembic import context
54from sqlalchemy import engine_from_config, pool
5+ from fastapi_users_db_sqlalchemy.generics import GUID
66
77# this is the Alembic Config object, which provides
88# access to the values within the .ini file in use.
@@ -19,10 +19,7 @@ fileConfig(config.config_file_name)
1919# target_metadata = None
2020
2121from app.db.base import Base # noqa
22- from app.core.config import settings # noqa
23-
24- # Import custom GUID type
25- from fastapi_users_db_sqlalchemy.generics import GUID
22+ from app.core.config import settings # noqa
2623
2724
2825def render_item(type_, obj, autogen_context):
@@ -60,7 +57,11 @@ def run_migrations_offline():
6057 """
6158 url = get_url()
6259 context.configure(
63- url=url, target_metadata=target_metadata, literal_binds=True, compare_type=True, render_item=render_item
60+ url=url,
61+ target_metadata=target_metadata,
62+ literal_binds=True,
63+ compare_type=True,
64+ render_item=render_item,
6465 )
6566
6667 with context.begin_transaction():
@@ -84,7 +85,10 @@ def run_migrations_online():
8485
8586 with connectable.connect() as connection:
8687 context.configure(
87- connection=connection, target_metadata=target_metadata, compare_type=True, render_item=render_item
88+ connection=connection,
89+ target_metadata=target_metadata,
90+ compare_type=True,
91+ render_item=render_item,
8892 )
8993
9094 with context.begin_transaction():
@@ -94,4 +98,4 @@ def run_migrations_online():
9498if context.is_offline_mode():
9599 run_migrations_offline()
96100else:
97- run_migrations_online()
101+ run_migrations_online()
0 commit comments