def upgrade(yes, dry_run, patches): """ Upgrade the datamodel by applying recusively the patches available """ patcher = _get_mongopatcher() if dry_run: patcher.discover_and_apply(directory=patches, dry_run=dry_run) else: if yes or prompt_bool("Are you sure you want to alter %s" % green(patcher.db)): patcher.discover_and_apply(patches) else: raise SystemExit("You changed your mind, exiting...")
def upgrade(yes, dry_run, patches): """ Upgrade the datamodel by applying recusively the patches available """ if not patches: patches = current_app.config['MONGOPATCHER_PATCHES_DIR'] patcher = _get_mongopatcher() if dry_run: patcher.discover_and_apply(patches, dry_run=dry_run) else: if (yes or prompt_bool("Are you sure you want to alter %s" % green(patcher.db))): patcher.discover_and_apply(patches) else: raise SystemExit('You changed your mind, exiting...')