Can roll back be added after changeSet is executed?

Suppose I have the following changeSet in an SQL file:

-- liquibase formatted sql

-- changeset amr:my_id
CREATE TABLE XYZ...

And then after executing this change set on the different environments I added a rollback statement to rollback this changeSet:

-- liquibase formatted sql

-- changeset amr:my_id
CREATE TABLE XYZ...
-- rollback DROP TABLE XYZ

Is adding rollback after executing a changeSet wrong? Does it affect the check sum?

It works fine to add the rollback later. I’m using v4.21.1. These are the steps:

  1. Ran the “update”, changeset did not have the rollback.
  2. Added rollback section to the changeset.
  3. Ran “rollback-count 1” and was successful, no checksum error.
1 Like