ensureNumericParam(params);
ensureVersionExists(params);
BigDecimal version = new BigDecimal(params[0]);
Change change = getLastAppliedChange();
if (version.compareTo(change.getId()) > 0) {
printStream.println("Upgrading to: " + version);
Command up = new UpCommand(basePath, environment, force, true);
while (!version.equals(change.getId())) {
up.execute();
change = getLastAppliedChange();
}
} else if (version.compareTo(change.getId()) < 0) {
printStream.println("Downgrading to: " + version);
Command down = new DownCommand(basePath, environment, force);
while (!version.equals(change.getId())) {
down.execute();
change = getLastAppliedChange();
}
} else {
printStream.println("Already at version: " + version);