Beispiel #1
0
def evilshit():
    """EVIL: Delete all data and recreate the database."""
    delete_index()
    db.drop_all()
    from sqlalchemy import MetaData, inspect
    from sqlalchemy.dialects.postgresql import ENUM
    metadata = MetaData()
    metadata.bind = db.engine
    metadata.reflect()
    for table in metadata.sorted_tables:
        table.drop(checkfirst=True)
    for enum in inspect(db.engine).get_enums():
        enum = ENUM(name=enum['name'])
        enum.drop(bind=db.engine, checkfirst=True)
    init()
Beispiel #2
0
def evilshit():
    """Delete all data and recreate the database."""
    db.drop_all()
    upgrade_db()
    delete_index()
    init_search()
Beispiel #3
0
def reset():
    db.drop_all()
    delete_index()
    upgrade()
Beispiel #4
0
def reset():
    db.drop_all()
    delete_index()
    upgrade()