def fixtures(): "Creates database tables with fixtures" db.drop_all() db.create_all() from gbi_server.model import fixtures db.session.add_all(fixtures.all()) db.session.commit() with manager. app.test_request_context(): fixtures.init_couchdb(manager.app.config)
def init_db(app): db.app = app # db.drop_app() # uncomment to clear database db.create_all() admin = model.User( email='*****@*****.**', active=True, verified=True, type=model.User.Type.ADMIN, passwort=bcrypt.hashpw('changeme', bcrypt.gensalt(10)) ) db.session.add(admin) db.session.commit()
def init_db_command(app=None): if not app: app = create_app() db.app = app db.drop_all() db.create_all()
def create_db(): db.drop_all() db.create_all()