from app.core.database import SessionLocal from sqlalchemy import text import os if os.path.exists("/app/alembic/versions/ff99fd874530_add_tolerance_to_accounts.py"): os.remove("/app/alembic/versions/ff99fd874530_add_tolerance_to_accounts.py") print("Deleted stale migration file") else: print("File not found") db = SessionLocal() r = db.execute(text("SELECT version_num FROM alembic_version")).scalar() print(f"Current alembic version: {r}") db.execute(text("UPDATE alembic_version SET version_num = 'ff99fd874530'")) db.commit() db.close() print("Updated alembic version to ff99fd874530")