def init_schema_version(driver, model, current_version):
    """
    initialize schema table with a initialized singleton of version

    Args:
        driver (object): an alias or index driver instance
        model (sqlalchemy.ext.declarative.api.Base): the version table model
        current_version (int): current schema version
    Return:
        version (int): current version number in database
    """
    with driver.session as s:
        schema_version = s.query(model).first()
        if not schema_version:
            schema_version = model(version=current_version)
            s.add(schema_version)
        current_version = schema_version.version
    return current_version