Liquibase rollback acts like it works. But does nothing
My master changelog is in XML. The changelog files are in SQL.
Here is my output after running my rollback command to check the SQL
I anonymized the output here for security reasons
These commands on the bottom of my file are NOT run during a rollback.
– rollback DROP TABLE IF EXISTS XXXX."FILE_XXXX_RELATIONSHIPS";
– rollback DROP TABLE IF EXISTS XXXX.“FILE_METADATA”;
– rollback DROP SCHEMA IF EXISTS XXXX;
Here is the output to check the SQL:
liquibase rollbackToDateSQL 2021-11-00
– *********************************************************************
schema-manager2_1 | – Rollback to 2021-10-31 Script
schema-manager2_1 | – *********************************************************************
schema-manager2_1 | – Change Log: ./changelog/XXXX/changelog_dir1/000020_XX-2058_schema_and_table_creation.sql
schema-manager2_1 | – Ran at: 11/4/21, 4:27 PM
schema-manager2_1 | – Against: XXXX_local@jdbc:postgresql://database:5432/XXXX_local
schema-manager2_1 | – Liquibase version: 4.5.0
schema-manager2_1 | – *********************************************************************
schema-manager2_1 |
schema-manager2_1 | – Lock Database
schema-manager2_1 | UPDATE public.databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = ‘82XXXXXX (192.XXX.XX.X)’, LOCKGRANTED = ‘2021-11-04 16:27:04.719’ WHERE ID = 1 AND LOCKED = FALSE;
schema-manager2_1 |
schema-manager2_1 | – Release Database Lock
schema-manager2_1 | UPDATE public.databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
schema-manager2_1 |
schema-manager2_1 | – Lock Database
schema-manager2_1 | UPDATE public.databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = ‘82XXXXXX (XXX.XXX.XX.4)’, LOCKGRANTED = ‘2021-11-04 16:27:05.012’ WHERE ID = 1 AND LOCKED = FALSE;
schema-manager2_1 |
schema-manager2_1 | – Release Database Lock
schema-manager2_1 | UPDATE public.databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
schema-manager2_1 |
schema-manager2_1 | Liquibase command ‘rollbackToDateSql’ was executed successfully.
schema-manager2_1 | Done