open-webui/backend/open_webui/migrations/util.py

16 lines
309 B
Python
Raw Normal View History

2024-06-24 11:54:24 +00:00
from alembic import op
from sqlalchemy import Inspector
def get_existing_tables():
con = op.get_bind()
inspector = Inspector.from_engine(con)
tables = set(inspector.get_table_names())
return tables
2024-10-01 16:40:08 +00:00
def get_revision_id():
2024-10-02 00:35:10 +00:00
import uuid
2024-10-01 16:40:08 +00:00
return str(uuid.uuid4()).replace("-", "")[:12]