Spaces:
Paused
Paused
Download scripts/check_cloud_db.py from 3SCError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 952 Bytes
-
https://huggingface.co/spaces/3SCError404/nexus/resolve/main/scripts/check_cloud_db.py
- Command line
-
hf download hf://spaces/3SCError404/nexus/scripts/check_cloud_db.py
-
curl -L -o check_cloud_db.py https://huggingface.co/spaces/3SCError404/nexus/resolve/main/scripts/check_cloud_db.py
952 Bytes
| import asyncio | |
| import os | |
| import sys | |
| from sqlalchemy import text | |
| # Add project root to path | |
| sys.path.append(os.getcwd()) | |
| from core.database import engine | |
| async def check_tables(): | |
| print(f"Connecting to: {engine.url.render_as_string(hide_password=True)}") | |
| async with engine.connect() as conn: | |
| res = await conn.execute(text("SELECT table_name FROM information_schema.tables WHERE table_schema='public'")) | |
| tables = [r[0] for r in res.fetchall()] | |
| print("\n--- TABLES IN PUBLIC SCHEMA ---") | |
| for t in tables: | |
| print(f"- {t}") | |
| # Check for alembic_version specifically | |
| if "alembic_version" in tables: | |
| ver = await conn.execute(text("SELECT version_num FROM alembic_version")) | |
| print(f"\nALEMBIC CURRENT VERSION: {ver.scalar()}") | |
| else: | |
| print("\n❌ alembic_version TABLE MISSING") | |
| if __name__ == "__main__": | |
| asyncio.run(check_tables()) | |