def get_class(version, db):
    """
    Get a database version class for update/downgrade.
    :param version: version of the database
    :param db: DB session object
    :return: a database version class
    """
    module = "Pegasus.db.admin.versions.v{}".format(version)
    mod = __import__(module, fromlist=["Version"])
    klass = getattr(mod, "Version")
    return klass(db)