When we’re only interested in recent history, it would be great to get liquibase history
in descending order (newest first) or to get only some recent history.
Apologies if there is already a way to do this - please fill me in!
Currently, liquibase history
lists the changesets that have been applied, oldest first (ascending). There is no way of changing this.
Ascending order makes sense if you are manually running a command in a CLI, because you’re going to see the recent history at the end of the output. However, our use case involves some automation with Jenkins and AWS SSM. SSM generously shows us 48,000 characters from command output, but that’s not enough for a DB with a long history. SSM truncates the output, so we can’t see the recent changesets. Even without the character limit problem, the output would be easier to read in Jenkins if the recent history were at the top.
Also, we’re not really interested in the whole history from many years ago. We just want to see the recent changesets and when they were applied. Perhaps it would be nice to specify how many recent changesets you want to see, or to specify a date range that you’re interested in.
Ideas:
liquibase history --order=ASC
All history, oldest first.
liquibase history --order=DESC
All history, newest first.
liquibase history-count 3
List the most recent 3 update events.
liquibase history-to-date 2022-10-01
List the update events since 2022-10-01.