def init_db(emit=False): """ Resets entire database to empty state """ if emit: import logging logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) res = raw_input("You shouldn't probably ever do this in production! Are you" " really, really sure you want to reset the DB? [y/n] ") if res != "y": return else: db.session.commit() db.drop_all() db.create_all() stamp()
def init_db(): """ Resets entire database to empty state """ with app.app_context(): db.session.commit() db.drop_all() db.create_all()