open-webui/backend/open_webui/migrations/util.py
Timothy J. Baek 4752df9bd8 refac
2024-10-01 09:40:08 -07:00

15 lines
304 B
Python

from alembic import op
from sqlalchemy import Inspector
import uuid
def get_existing_tables():
con = op.get_bind()
inspector = Inspector.from_engine(con)
tables = set(inspector.get_table_names())
return tables
def get_revision_id():
return str(uuid.uuid4()).replace("-", "")[:12]