@Override
	public void execute() throws BuildException {
		
		Migrator migrator = new Migrator(url, driver, user, password, scriptsLocation);
		
		log(migrator.printBeforeDiagnostics());
		
		if (action != null) {

			if (action.equals(UPGRADE)) {
				log(UPGRADE + " action started");
				migrator.migrateUp();
				log(UPGRADE + " action ended");
			} else if (action.equals(UPGRADE_ALL)) {
				log(UPGRADE_ALL + " action started");
				migrator.migrateUpAll();
				log(UPGRADE_ALL + " action ended");
			} else if (action.equals(ROLLBACK)) {
				log(ROLLBACK + " action started");
				migrator.migrateDown();
				log(ROLLBACK + " action ended");
			} else if (action.equals(INIT)) {
				log(INIT + " action started");
				migrator.initDb();
				log(INIT + " action ended");
			} else if (action.equals(STATUS)) {
				log(STATUS + " action started");
				migrator.printAfterDiagnostics();
				log(STATUS + " action ended");
			} else {
				throw new BuildException("don't kow what " + action
						+ " is.  Must be one of:" + UPGRADE_ALL + " " + UPGRADE + " "
						+ ROLLBACK + " " + INIT + " " + STATUS);
			}

			log(migrator.printAfterDiagnostics());

		} else {
			throw new BuildException("action is required");
		}
	}