Esempio n. 1
0
def build_db():
    '''
    delete all, then rebuild db
    '''
    db.drop_all()
    db.create_all()

    return 'build database success.'
Esempio n. 2
0
def createdb(drop_first=False):
    """Creates the database."""
    if drop_first:
        db.drop_all()
    db.create_all()
    print('OK: database is initialed.')
Esempio n. 3
0
def app():
    SQLAlchemyDB.create_all()
    yield _app
    SQLAlchemyDB.session.close()
    SQLAlchemyDB.drop_all()
Esempio n. 4
0
def build_db():
    # database init
    db.drop_all()
    db.create_all()
    return 'build database success.'
Esempio n. 5
0
def drop_db():
    db.drop_all()