unexpectedChangeSets command

The unexpectedChangeSets command produces a list of changesets that were run in the database but do not exist in the current changelog.

Uses

The unexpectedChangeSets command is typically used to detect and compare the changes between the DATABASECHANGELOG table and the current changelog. If any of the changesets in the DATABASECHANGELOG table do not exist in the current changelog, the unexpectedChangeSets command detects those changesets and produces them in your output.

The unexpectedChangeSets command also produces all the deleted changesets that were previously deployed from the current changelog.

The image below shows the changelog that is already applied to the database — changelog_release1. If you want to apply a new changelog_release2 and it requires information about the previous changesets applied against the database, the unexpectedChangeSets command will list those changesets from changelog_release1 and changelog_release2.

By running the unexpectedChangeSets command, you can review any changesets in the DATABASECHANGELOG table applied from any other changelogs outside the scope of your current changelog.

Running the unexpectedChangeSets command

To run the unexpectedChangeSets command, you need to specify your driver, class path, URL, and user authentication information in your liquibase.properties file. For more information, see Creating and configuring a liquibase.properties file. You can also specify these properties in your command line.

Then run the unexpectedChangeSets command:

liquibase unexpectedChangeSets

To see the list of all changes applied, add the --verbose flag while running the command:

liquibase unexpectedChangeSets --verbose

unexpectedChangeSets global attributes

Attribute Definition Requirement

--changeLogFile

The root changelog

Required

--url

The JDBC database connection URL

Required

--username

The database username

Required

--password

The database password

Required