def downgrade_db(v):
    """downgrade database schema to specified version"""
    from_version = db_version(url=db, repository=repo)
    to_version = int(v)

    print("Downgrading db from version %d to %d. " % (from_version, to_version))
    print("Schema upgrade ... ")
    downgrade(url=db, repository=repo, version=v)
    print("Data upgrade ... ")
    datamigrations.run_downgrade_scripts(app, from_version, to_version)
    print("Done!")
dataset/ETHPy150Open jkossen/imposter/dbmanage.py/downgrade_db/original