open-webui/backend/migrations/util.py

10 lines
216 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