mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-27 07:54:55 -06:00
2c2d06c31b
The Alembic init migration (7e5b5dc7342b) already creates the equivalent schema. Peewee migrations are no longer needed for any version >= 0.3.6.
19 lines
457 B
Python
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]
|