Spaces:
Paused
Paused
Download scratch/migrate_pg.py from 3SCError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 570 Bytes
-
https://huggingface.co/spaces/3SCError404/nexus/resolve/main/scratch/migrate_pg.py
- Command line
-
hf download hf://spaces/3SCError404/nexus/scratch/migrate_pg.py
-
curl -L -o migrate_pg.py https://huggingface.co/spaces/3SCError404/nexus/resolve/main/scratch/migrate_pg.py
570 Bytes
| import asyncio | |
| from sqlalchemy import text | |
| from core.database import engine | |
| async def migrate(): | |
| async with engine.begin() as conn: | |
| try: | |
| await conn.execute(text("ALTER TABLE \"user\" ADD COLUMN real_email VARCHAR")) | |
| print("Successfully added real_email column to 'user' table.") | |
| except Exception as e: | |
| if "already exists" in str(e): | |
| print("Column real_email already exists.") | |
| else: | |
| print(f"Migration error: {e}") | |
| if __name__ == "__main__": | |
| asyncio.run(migrate()) | |