File size: 811 Bytes
f871fed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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())