Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /agno-agi_agno /libs /agno /migrations /migrate_postgres.py
| import asyncio | |
| from agno.db.migrations.manager import MigrationManager | |
| from agno.db.postgres import AsyncPostgresDb, PostgresDb | |
| # Create your database connection here | |
| db = PostgresDb( | |
| db_url="postgresql+psycopg://ai:ai@localhost:5532/ai", | |
| session_table="agno_sessions", | |
| memory_table="agno_memories", | |
| ) | |
| # Or for asynchronous operations | |
| async_db = AsyncPostgresDb( | |
| db_url="postgresql+psycopg_async://ai:ai@localhost:5532/ai", | |
| session_table="agno_sessions", | |
| memory_table="agno_memories", | |
| ) | |
| # Upgrade your DB to the latest version | |
| async def run_migration(): | |
| await MigrationManager(async_db).up() | |
| # Optionally force the migration if necessary | |
| # await MigrationManager(db).up(force=True) | |
| # Downgrade your DB to a specific version | |
| # await MigrationManager(db).down(target_version="2.0.0") | |
| if __name__ == "__main__": | |
| asyncio.run(run_migration()) | |
Xet Storage Details
- Size:
- 893 Bytes
- Xet hash:
- 8016dc1e7f38ac426c1999104253dceec02cedb08d8cce4c9e8dff0fc0e80577
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.