Skip to content

Commit

Permalink
Merge pull request #1932 from sergeevik/update_log_to_ui
Browse files Browse the repository at this point in the history
Output changeset execution to UI like rollback does
  • Loading branch information
suryaaki2 committed Jan 18, 2022
2 parents caa1690 + 09c8ec6 commit f7571ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -46,7 +46,7 @@ public Direction getDirection() {
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("Rolling Back Changeset:" + changeSet);
Scope.getCurrentScope().getUI().sendMessage("Rolling Back Changeset: " + changeSet);
}
sendRollbackWillRunEvent(changeSet, databaseChangeLog, database);
try {
Expand Down
Expand Up @@ -10,6 +10,9 @@
import liquibase.database.ObjectQuotingStrategy;
import liquibase.exception.LiquibaseException;
import liquibase.exception.MigrationFailedException;
import liquibase.executor.Executor;
import liquibase.executor.ExecutorService;
import liquibase.executor.LoggingExecutor;

import java.util.Set;

Expand Down Expand Up @@ -40,8 +43,12 @@ public Direction getDirection() {
@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);
Scope.getCurrentScope().getLog(getClass()).fine("Running Changeset: " + changeSet);
fireWillRun(changeSet, databaseChangeLog, database, runStatus);
ExecType execType = null;
ObjectQuotingStrategy previousStr = this.database.getObjectQuotingStrategy();
Expand Down

0 comments on commit f7571ab

Please sign in to comment.