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

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