I have a very basic knowledge on liquibase.My project team is planning to use Liquibase for Test data snapshot. we have a cloud database (Postgresql) for different microservices. we have planned to take Test data snap before scripts execution and roll back the original state after the execution. Any insights on this would be really helpful. Thanks!
Asked
Active
Viewed 605 times
2 Answers
0
Liquibase has this capability which is a Pro feature. You can use liquibase rollbackToUpdate
feature to rollback the database state to a specific deployment ID. Read more about the rollback Pro features here: https://docs.liquibase.com/commands/pro/rollbackoneupdate.html
NOTE: Before running the liquibase rollbackToUpdate
, make sure to view the SQL log output of what all will be rolled back. You need to use liquibase rollbackTpUpdateSQL
to get the log output in SQL format. https://docs.liquibase.com/commands/pro/rollbackoneupdatesql.html

Aditi
- 357
- 1
- 7
-
Unfortunately we are using only the base version of liquibase !! – kathir43 Dec 01 '21 at 14:18
0
You can use context attribut of liquibase, context = dev, test, faker.....
in producton you must execute liquibase with another context for skipping fake-data.

Sofyane MAKERRI
- 395
- 3
- 5
-
-
Thanks for providing some insights! But my requirement to take test data snapshot of current state and then roll back this state in future.. Is it something achievable in liquibase?? – kathir43 Dec 01 '21 at 14:17
-
You can use also labels attribut : https://docs.liquibase.com/concepts/advanced/labels.html – Sofyane MAKERRI Dec 01 '21 at 14:34
-
https://docs.liquibase.com/workflows/liquibase-community/using-rollback.html – Sofyane MAKERRI Dec 01 '21 at 14:52