I have a Spring Boot application where I'm trying to test some migration with Liquibase. I'm trying to see how the rollback function works but I keep getting errors.
This is the migration file:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet id="1" author="Me">
<createTable tableName="Person">
<column name="id" type="int" />
<column name="name" type="string" />
</createTable>
<rollback>
<dropTable tableName="Person" />
</rollback>
</changeSet>
</databaseChangeLog>
When I run the application, the table is created correctly... but I don't know how or where to run the command to execute the rollback. I've tried to run the following command in Maven Goal in IntelliJ:
mvn liquibase:rollback
When I run it says:
Failed to execute goal org.liquibase:liquibase-maven-plugin:3.10.3:rollback (default-cli) on project party:
The database URL has not been specified either as a parameter or in a properties file.
If the database URL was missing or wrong then I'm thinking it shouldn't be able to create the table either?