Spaces:
Paused
Paused
File size: 952 Bytes
5eb4857 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 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())
|