def _migrate(db_url, migration_version):
    earliest_version = _migrate_get_earliest_version()

    # NOTE(sirp): sqlalchemy-migrate currently cannot handle the skipping of
    # migration numbers.
    _migrate_cmd(
            db_url, 'version_control', str(earliest_version - 1))

    upgrade_cmd = ['upgrade']
    if migration_version != 'latest':
        upgrade_cmd.append(str(migration_version))

    _migrate_cmd(db_url, *upgrade_cmd)
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/tools/db/schema_diff.py/_migrate/original