open-notebook/open_notebook/database/migrate.py
Luis Novo d7b0fff954
Api podcast migration (#93)
Creates the API layer for Open Notebook
Creates a services API gateway for the Streamlit front-end
Migrates the SurrealDB SDK to the official one
Change all database calls to async
New podcast framework supporting multiple speaker configurations
Implement the surreal-commands library for async processing
Improve docker image and docker-compose configurations
2025-07-17 08:36:11 -03:00

26 lines
811 B
Python

import asyncio
from .async_migrate import AsyncMigrationManager
class MigrationManager:
"""
Synchronous wrapper around AsyncMigrationManager for backward compatibility.
"""
def __init__(self):
"""Initialize with async migration manager."""
self._async_manager = AsyncMigrationManager()
def get_current_version(self) -> int:
"""Get current database version (sync wrapper)."""
return asyncio.run(self._async_manager.get_current_version())
@property
def needs_migration(self) -> bool:
"""Check if migration is needed (sync wrapper)."""
return asyncio.run(self._async_manager.needs_migration())
def run_migration_up(self):
"""Run migrations (sync wrapper)."""
asyncio.run(self._async_manager.run_migration_up())