def build_db(): ''' delete all, then rebuild db ''' db.drop_all() db.create_all() return 'build database success.'
def createdb(drop_first=False): """Creates the database.""" if drop_first: db.drop_all() db.create_all() print('OK: database is initialed.')
def app(): SQLAlchemyDB.create_all() yield _app SQLAlchemyDB.session.close() SQLAlchemyDB.drop_all()
def build_db(): # database init db.drop_all() db.create_all() return 'build database success.'
def drop_db(): db.drop_all()