use of liquibase.changelog.ChangeSet.RunStatus in project liquibase by liquibase.
the class UpdateVisitor method visit.
@Override
public void visit(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Set<ChangeSetFilterResult> filterResults) throws LiquibaseException {
Executor executor = Scope.getCurrentScope().getSingleton(ExecutorService.class).getExecutor("jdbc", database);
if (!(executor instanceof LoggingExecutor)) {
Scope.getCurrentScope().getUI().sendMessage("Running Changeset: " + changeSet);
}
ChangeSet.RunStatus runStatus = this.database.getRunStatus(changeSet);
Scope.getCurrentScope().getLog(getClass()).fine("Running Changeset: " + changeSet);
fireWillRun(changeSet, databaseChangeLog, database, runStatus);
ExecType execType = null;
ObjectQuotingStrategy previousStr = this.database.getObjectQuotingStrategy();
try {
execType = changeSet.execute(databaseChangeLog, execListener, this.database);
} catch (MigrationFailedException e) {
fireRunFailed(changeSet, databaseChangeLog, database, e);
throw e;
}
if (!runStatus.equals(ChangeSet.RunStatus.NOT_RAN)) {
execType = ChangeSet.ExecType.RERAN;
}
fireRan(changeSet, databaseChangeLog, database, execType);
// reset object quoting strategy after running changeset
this.database.setObjectQuotingStrategy(previousStr);
this.database.markChangeSetExecStatus(changeSet, execType);
this.database.commit();
}
Aggregations