refac: modernize imports, standardize type hints and docstrings
This commit is contained in:
1 parent
998c86a52b
commit
a59c967d7e
16 files changed
+118
-142
No files matched your search
@@ -9,12 +9,11 @@ import logging
|
||||
from logging.config import fileConfig
|
||||
|
||||
from alembic import context
|
||||
from sqlalchemy import create_engine, engine_from_config, pool
|
||||
|
||||
from open_webui.env import DATABASE_PASSWORD, DATABASE_URL, LOG_FORMAT
|
||||
from open_webui.internal.db import extract_ssl_params_from_url, reattach_ssl_params_to_url
|
||||
from open_webui.models.auths import Auth
|
||||
from open_webui.models.calendar import Calendar, CalendarEvent, CalendarEventAttendee # noqa: F401
|
||||
from sqlalchemy import create_engine, engine_from_config, pool
|
||||
|
||||
# ── Alembic config & logging ─────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
"""Alembic migration utilities."""
|
||||
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect as sa_inspect
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
def get_existing_tables() -> set[str]:
|
||||
"""Return the set of table names already present in the database."""
|
||||
bind = op.get_bind()
|
||||
inspector = sa_inspect(bind)
|
||||
return set(inspector.get_table_names())
|
||||
"""Return table names already present in the database."""
|
||||
conn = op.get_bind()
|
||||
return set(inspect(conn).get_table_names())
|
||||
|
||||
|
||||
def get_revision_id() -> str:
|
||||
|
||||
Reference in new issue
Block a user