def run_online_migration(self):
    """
    Run an online migration using microcosm configuration.

    This function takes the place of the `env.py` file in the Alembic migration.

    """
    connectable = self.graph.postgres

    with connectable.connect() as connection:
        context.configure(
            connection=connection,
            # assumes that all models extend our base
            target_metadata=Model.metadata,
            **get_alembic_environment_options(self.graph),
        )

        with context.begin_transaction():
            context.run_migrations()
Run an online migration using microcosm configuration.

    This function takes the place of the `env.py` file in the Alembic migration.