Before deployment, I ran ‘liquibase tag’ command. When I finished with deployment and want to rollback the change with the tag, I encounter error: “Caused by: liquibase.exception.RollbackFailedException: liquibase.exception.RollbackImpossibleException: No inverse to liquibase.change.core.RawSQLChange created”
The changeset is sql file generated using Postgresql pg_dump utilities for the whole database schema which has close to 500 tables plus indexes etc. For example:
CREATE TABLE pul.prop_cmv (
id bigint NOT NULL,
property_status character(1) NOT NULL,
region character(2) NOT NULL,
map_code character(3) NOT NULL,
division_code character(3) NOT NULL,
property_code character(3) NOT NULL,
county_mun character(4) NOT NULL,
parcel_code character(5) NOT NULL
);
ALTER TABLE pul.prop_cmv OWNER TO pul_tst;
CREATE TABLE pul.admin (
id integer NOT NULL,
name text,
on_lock boolean DEFAULT false,
updated_by text,
last_modified bigint
);
:
I guess without manually added the ‘–rollback’ script, even with tag, there is no way to rollback the deployment. I have to say backup the database using means outside of Liquibase if I want to be able to rollback the changes.
Correct, when using formatted sql you cannot use Liquibase rollback unless each changeset has the required sql commands for rollback defined. For your example:
–rollback drop table pul.prop_cmv;
–rollback drop table pul.admin;
If you want to use an external backup to “rollback” your changes then there is no reason to use the Liquibase rollback command.