Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/msimko81/liquibase into m…
Browse files Browse the repository at this point in the history
…simko81-master
  • Loading branch information
nvoxland committed Dec 22, 2021
2 parents ab7b2bd + 506e3de commit 76cf69a
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import liquibase.ContextExpression;
import liquibase.Labels;
import liquibase.Scope;
import liquibase.change.Change;
import liquibase.change.CheckSum;
import liquibase.change.core.TagDatabaseChange;
import liquibase.changelog.ChangeSet.ExecType;
import liquibase.GlobalConfiguration;
import liquibase.database.Database;
Expand Down Expand Up @@ -244,6 +246,14 @@ protected void appendChangeSet(ChangeSet changeSet, ChangeSet.ExecType execType)
csvWriter.writeNext(line);
}

String tag = "";
for (Change change : changeSet.getChanges()) {
if (change instanceof TagDatabaseChange) {
TagDatabaseChange tagChange = (TagDatabaseChange) change;
tag = tagChange.getTag();
}
}

String[] newLine = new String[Columns.values().length];
newLine[Columns.ID.ordinal()] = changeSet.getId();
newLine[Columns.AUTHOR.ordinal()] = changeSet.getAuthor();
Expand All @@ -254,7 +264,7 @@ protected void appendChangeSet(ChangeSet changeSet, ChangeSet.ExecType execType)
newLine[Columns.MD5SUM.ordinal()] = changeSet.generateCheckSum().toString();
newLine[Columns.DESCRIPTION.ordinal()] = changeSet.getDescription();
newLine[Columns.COMMENTS.ordinal()] = changeSet.getComments();
newLine[Columns.TAG.ordinal()] = "";
newLine[Columns.TAG.ordinal()] = tag;
newLine[Columns.LIQUIBASE.ordinal()] = LiquibaseUtil.getBuildVersion();

newLine[Columns.CONTEXTS.ordinal()] = (changeSet.getContexts() == null) ? null : changeSet.getContexts().toString();
Expand Down

0 comments on commit 76cf69a

Please sign in to comment.