def reset_db(): click.echo("Dropping all tables") db.drop_all() db.session.commit() click.echo("Recreating them") db.create_all() db.session.commit() click.echo("Success")
def client(): app.config.from_object(Debug) with app.app_context(): db.create_all() with app.test_client() as client: yield client db.drop_all() db.engine.dispose() os.remove(app.config['DATABASE_FILE'])
def init_db(): click.echo("Creating database") db.create_all() click.echo("Committing change") db.session.commit() click.echo("Success")