Files
open-webui/backend/open_webui/migrations/util.py
T
Timothy Jaeryang Baek 2c2d06c31b refac: deprecate peewee migration layer
The Alembic init migration (7e5b5dc7342b) already creates the
equivalent schema. Peewee migrations are no longer needed for
any version >= 0.3.6.
2026-05-12 03:45:59 +09:00

19 lines
457 B
Python

"""Alembic migration utilities."""
from alembic import op
from sqlalchemy import inspect as sa_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())
def get_revision_id() -> str:
"""Generate a short random revision identifier."""
import uuid
return uuid.uuid4().hex[:12]