from sqlalchemy.orm import sessionmaker
from mediagoblin.db.open import setup_connection_and_db_from_config
-from mediagoblin.db.migration_tools import MigrationManager
+from mediagoblin.db.migration_tools import MigrationManager, AlembicMigrationManager
from mediagoblin.init import setup_global_and_app_config
from mediagoblin.tools.common import import_component
def run_alembic_migrations(db, app_config, global_config):
- from mediagoblin.db.migration_tools import AlembicMigrationManager
+ """Initializes a database and runs all Alembic migrations."""
Session = sessionmaker(bind=db.engine)
manager = AlembicMigrationManager(Session())
manager.init_or_migrate()