コード例 #1
0
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()
コード例 #2
0
 def tearDown(self):
     # dump the test elasticsearch index
     db.session.remove()
     db.drop_all()
コード例 #3
0
ファイル: manage.py プロジェクト: Bitcoinsulting/simplecoin
def init_db():
    """ Resets entire database to empty state """
    with app.app_context():
        db.session.commit()
        db.drop_all()
        db.create_all()
コード例 #4
0
 def tearDown(self):
     # dump the test elasticsearch index
     db.session.remove()
     db.drop_all()
コード例 #5
0
def init_db():
    """ Resets entire database to empty state """
    with app.app_context():
        db.session.commit()
        db.drop_all()
        db.create_all()