Skip to content

Commit

Permalink
Merge pull request #1772 from liquibase/DAT-6842
Browse files Browse the repository at this point in the history
Correctly update the changeLogId in the DatabaseChangeLog object at the end of registration DAT 6842
  • Loading branch information
nvoxland committed Mar 23, 2021
2 parents a05d11b + d722ba0 commit d17e391
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static ChangeLogRewriterResult addChangeLogId(String changeLogFile, Strin
// Update the current DatabaseChangeLog with its id
//
if (databaseChangeLog != null) {
databaseChangeLog.setChangeLogId(null);
databaseChangeLog.setChangeLogId(changeLogId);
}
}
catch (IOException ioe) {
Expand Down
3 changes: 0 additions & 3 deletions liquibase-core/src/main/java/liquibase/hub/HubUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import liquibase.*;
import liquibase.changelog.ChangeLogIterator;
import liquibase.changelog.ChangeLogParameters;
import liquibase.changelog.ChangeSet;
import liquibase.changelog.DatabaseChangeLog;
import liquibase.changelog.visitor.ListVisitor;
Expand Down Expand Up @@ -30,8 +29,6 @@
import liquibase.lockservice.LockService;
import liquibase.lockservice.LockServiceFactory;
import liquibase.logging.core.BufferedLogService;
import liquibase.parser.ChangeLogParserFactory;
import liquibase.resource.ResourceAccessor;
import liquibase.util.StringUtil;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ class ChangeLogRewriterTest extends Specification {
//
ResourceAccessor resourceAccessor = new FileSystemResourceAccessor(Paths.get("target/test-classes").toAbsolutePath().toFile())
ChangeLogParser parser = ChangeLogParserFactory.getInstance().getParser(outputFile.getName(), resourceAccessor)
changeLog = parser.parse(outputFile.getName(), new ChangeLogParameters(), resourceAccessor)
DatabaseChangeLog newChangeLog = parser.parse(outputFile.getName(), new ChangeLogParameters(), resourceAccessor)

then:
result.success
matcher.matches()
idMatcher.matches()
changeLog.getChangeLogId() != null
newChangeLog.getChangeLogId() != null

where:
file | extension | patternString
Expand Down

0 comments on commit d17e391

Please sign in to comment.