I'm new to Liquibase. I can able to update(changeset which has create table) to the Oracle database using liquibase. while doing update i've created the tag also. But when i try to rollback the updated changes(ie dropping the created table)using the tag. The table was not dropped.
I'm using liquibase-maven plugin 3.4.2. Below are the code in maven.
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.4.2</version>
<executions>
<execution>
<id>execution1</id>
<phase>process-resources</phase>
<configuration>
<changeLogFile>src/main/resources/changelog.xml</changeLogFile>
<rollbackTag>checkpoint</rollbackTag>
<driver>oracle.jdbc.OracleDriver</driver>
<url>jdbc:oracle:thin:@10.86.24.2:1521:claim</url>
<username>Test</username>
<password>Test</password>
</configuration>
<goals>
<goal>rollback</goal>
<!-- <goal>rollbackSQL</goal> -->
</goals>
</execution>
</executions>
</plugin>
Below are my changelog.xml while rolling back the database.
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.liquibase.org/xml/ns/dbchangelog"></databaseChangeLog>
I tried with "rollbackSQL" . But the query to drop table has not be created.
find the below code.
-- *********************************************************************
-- Rollback to 'checkpoint' Script
-- *********************************************************************
-- Change Log: src/main/resources/changelog.xml
-- Ran at: 2/10/16 6:24 PM
-- Against: TEST@jdbc:oracle:thin:@10.86.24.2:1521:claim
-- Liquibase version: 3.4.2
-- *********************************************************************
SET DEFINE OFF;
-- Lock Database
UPDATE DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = 'KannanSDTW864', LOCKGRANTED = to_timestamp('2016-02-10 18:24:08.593', 'YYYY-MM-DD HH24:MI:SS.FF') WHERE ID = 1 AND LOCKED = 0;
-- Release Database Lock
UPDATE DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
Entries in the DATABASECHANGELOG table
Please help me to fix the issues.