Hello,
I just started with Liquibase (version 3.1.1) and came across following situation:
I created a rollback statement (with a delete change inside) and added it to a ChangeSet.
Then I wrote the ChangeLog via the XMLChangeLogSerializer and in the resulting XML file the rollback statement is displayed as following:
<rollback>[Lliquibase.change.Change;@5c2a25</rollback>
I stepped through the liquibase library and saw following:
In ChangeSet.getRollbackChanges there is an Array returned (explicitly casting the rollBackChanges list to Array). TheXMLChangeLogSerializer then on setValueOnNode checks for an instance of Collection, which excludes the rollback array. Therefore as the rollback value the array is printed with the standard toString method.
I'm still pretty new with liquibase but I'm not sure this is the wanted behaviour.
So questions:
1) Why is the rollback changes getter returning an array? And not the (unmodifiable) list as it is the case with the changes list?
2) Is there something I should consider when creating a rollback change? In principle I only did:
DeleteDataChange deleteRollback = new DeleteDataChange();
deleteRollback.setTableName(tableName);
deleteRollback.setWhere(rollbackWhereStatement.toString());
changeSet.addRollbackChange(deleteRollback);
Thank you...