Download backend/open_webui/migrations/util.py from Rfym21/OpenWebUI: direct link, hf CLI and curl.
- Browser
- Download file 309 Bytes
-
https://huggingface.co/spaces/Rfym21/OpenWebUI/resolve/main/backend/open_webui/migrations/util.py
- Command line
-
hf download hf://spaces/Rfym21/OpenWebUI/backend/open_webui/migrations/util.py
-
curl -L -o util.py https://huggingface.co/spaces/Rfym21/OpenWebUI/resolve/main/backend/open_webui/migrations/util.py
309 Bytes
| 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 | |
| def get_revision_id(): | |
| import uuid | |
| return str(uuid.uuid4()).replace("-", "")[:12] | |