We are in process of evaluating Liquibase. We have following queries
Scenario 1:
Is it possible to rollback one complete change request(instead of one .sql file) after successful deployment.
For eg.
Suppose we have following change request. We have rollback in the similar structure
1.Change_Request_1
a.sql
b.sql
2.Change_Request_2
c.sql
d.sql
3.Change_Request_3
e.sql
f.sql
4.Change_Request_4
g.sql
h.sql
5.Change_Request_5
i.sql
j.sql
After sucessful deployment and during post production check it is decided to rollback all changes for Change_Request_3
Is it possible to rollback all changes for Change_Request_3 without affecting the other changes made by other Change Request
Scenario 2:
Is it possible to rollback to previous deployment.
Suppose we have deployment in month of Nov-2021. After complete deployment For Dec-2021 it is decided to rollback all changes made in Dec-2021 release.
We want to make the state of database what was after Nov-2021 release.
Hi @Dinesh1
For scenario 1: yes you can do that with Liquibase Pro.
For scenario 2: yes you can rollback all of the changes you made in Dec2021 with Liquibase Pro as well.
As far as for putting it back to the state of the database including the data that was there in Nov 2021, that is a backup and restore because data was written to the database since then.
One other thing you might look at for scenario 2 to quickly rollback would be liquibase-data.
You can also rollback to a prior changeset using community, using the changeSetId and changeSetAuthor attributes:
<changeSet id="create_procedurev1" author="XYZ" runOnChange="true">
<sql endDelimiter="/">
create or replace procedure test_proc is
v_dummy1 date;
begin
--This is select 1
select sysdate into v_dummy1 from "DUAL";
end test_proc;
/
</sql>
<rollback/>
</changeSet>
<changeSet id="create_procedurev2" author="XYZ" runOnChange="true">
<sql endDelimiter="/">
create or replace procedure test_proc is
v_dummy1 date;
v_dummy2 date;
begin
--This is select 1
select sysdate into v_dummy1 from dual;
--This is select 2
select sysdate-1 into v_dummy2 from dual;
end test_proc;
/
</sql>
<rollback changeSetId="create_procedurev1" changeSetAuthor="XYZ"/>
</changeSet>