Esempio n. 1
0
def handle_db_reset(verbose=True):
    from mslib.mscolab.server import APP, db
    if os.path.exists(mscolab_settings.DATA_DIR):
        shutil.rmtree(mscolab_settings.DATA_DIR)
    create_files()
    with APP.app_context():
        db.drop_all()
        db.create_all()
    if verbose is True:
        print("Database has been reset successfully!")
Esempio n. 2
0
def handle_db_init():
    from mslib.mscolab.server import APP, db
    create_files()
    with APP.app_context():
        db.create_all()
    print("Database initialised successfully!")