Run all migrations that have not been run

    Migrations will be run inside a transaction.

    :param db:              database connection object
    :param name:            name associated with the migrations
    :param package:         package that contains the migrations
    :param conf:            application configuration object

def migrate(db, name, package, conf={}):
    """ Run all migrations that have not been run

    Migrations will be run inside a transaction.

    :param db:              database connection object
    :param name:            name associated with the migrations
    :param package:         package that contains the migrations
    :param conf:            application configuration object
    """
    (current_major_version, current_minor_version) = get_version(db, name)
    package = importlib.import_module(package)
    logging.debug('Migration version for %s is %s.%s',
                  package.__name__,
                  current_major_version,
                  current_minor_version)
    mods = get_mods(package)
    migrations = get_new(mods,
                         current_major_version,
                         current_minor_version + 1)
    for (modname, major_version, minor_version) in migrations:
        mod = load_mod(modname, package)
        run_migration(name, major_version, minor_version, db, mod, conf)
        logging.debug("Finished migrating to %s", modname)