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

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