Mvn liquibase:rollback -Dliquibase.rollbackCount=1 does not work as expected

Hi,

Having 3 entries in the table DATABASECHANGELOG with ORDEREXECUTED 318,317,316 the command:

mvn liquibase:rollback -Dliquibase.rollbackCount=1

Tries to rollback the changeset applied on the 316…

Does anyone know why?

To make sure I understand properly, this is the order the changesets were applied:

  1. 318
  2. 317
  3. 316

Based upon that order, 316 would be the changeset that is rolled-back using “rollbackCount 1”.

Rollback is done in reverese chronological order.

No, the order was 316, 317, 318…the sequential number indicates the order

if that is the case, please provide the following:

  1. Log output from initial “update”, using sql-log-level=INFO
  2. Log output from the “rollback-count 1”, using sql-log-level=INFO

I have had a similar problem too. When I have log-leve=INFO set here is what I get returned when running --rollback-count=1. Even though when I run history I see my previous updates from today.

[2025-04-03 17:55:47] INFO [liquibase.ui] Liquibase Open Source 4.27.0 by Liquibase
[2025-04-03 17:55:47] INFO [liquibase.integration] Starting command execution.
[2025-04-03 17:55:47] WARNING [liquibase.command] Ignoring the global liquibase.driver value in favor of the command value.
[2025-04-03 17:55:47] INFO [liquibase.database] Set default schema name to dbo
[2025-04-03 17:55:47] INFO [liquibase.changelog] Reading from DATABASECHANGELOG
[2025-04-03 17:55:47] INFO [liquibase.lockservice] Successfully acquired change log lock
[2025-04-03 17:55:47] INFO [liquibase.changelog] Reading from DATABASECHANGELOG
INFO: 0 changesets rolled back.
[2025-04-03 17:55:47] INFO [liquibase.ui] INFO: 0 changesets rolled back.
[2025-04-03 17:55:47] INFO [liquibase.command] Rollback command completed successfully.
[2025-04-03 17:55:47] INFO [liquibase.lockservice] Successfully released change log lock
[2025-04-03 17:55:47] INFO [liquibase.command] Command execution complete
Liquibase command 'rollback-count' was executed successfully.
[2025-04-03 17:55:47] INFO [liquibase.ui] Liquibase command 'rollback-count' was executed successfully.
+---------------+-----------------+-----------------------------+------------------+--------------+-----+
| Deployment ID | Update Date     | Changelog Path              | Changeset Author | Changeset ID | Tag |
+---------------+-----------------+-----------------------------+------------------+--------------+-----+
| 3714737762    | 4/3/25, 5:12 PM | changelog/changelog.sql     | fritz            | 53           |     |
+---------------+-----------------+-----------------------------+------------------+--------------+-----+
| 3714737762    | 4/3/25, 5:12 PM | changelog/changelog.sql     | fritz            | 54           |     |
+---------------+-----------------+-----------------------------+------------------+--------------+-----+

+---------------+-----------------+-----------------------------+------------------+--------------+-----+
| Deployment ID | Update Date     | Changelog Path              | Changeset Author | Changeset ID | Tag |
+---------------+-----------------+-----------------------------+------------------+--------------+-----+
| 3715052363    | 4/3/25, 5:17 PM | changelog/changelog.sql     | fritz            | 55           |     |
+---------------+-----------------+-----------------------------+------------------+--------------+-----+
| 3715052363    | 4/3/25, 5:17 PM | changelog/changelog.sql     | fritz            | 56           |     |
+---------------+-----------------+-----------------------------+------------------+--------------+-----+

+---------------+-----------------+-----------------------------+------------------+--------------+-----+
| Deployment ID | Update Date     | Changelog Path              | Changeset Author | Changeset ID | Tag |
+---------------+-----------------+-----------------------------+------------------+--------------+-----+
| 3716312137    | 4/3/25, 5:38 PM | changelog/changelog.sql     | fritz            | 57           |     |
+---------------+-----------------+-----------------------------+------------------+--------------+-----+