I would like to be able to apply the latest changes to a liquibase controlled database via Maven. My POM contains:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.3.5</version>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.23</version>
</dependency>
</dependencies>
<configuration>
<changeLogFile>src/main/resources/config/database/db-changelog-master.xml</changeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://localhost:3306/myDb</url>
<username>${db.user}</username>
<password>${db.password}</password>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
</plugin>
and when I run mvn liquibase:update
I get the following:
[INFO] driver: com.mysql.jdbc.Driver
[INFO] url: jdbc:mysql://localhost:3306/myDb
[INFO] username: dbUser
[INFO] password: *****
[INFO] use empty password: false
[INFO] properties file: null
[INFO] properties file will override? false
[INFO] prompt on non-local database? true
[INFO] clear checksums? false
[INFO] changeLogFile: src/main/resources/config/database/db-changelog-master.xml
[INFO] context(s): null
[INFO] label(s): null
[INFO] number of changes to apply: 0
[INFO] drop first? false
[INFO] ------------------------------------------------------------------------
[INFO] Executing on Database: jdbc:mysql://localhost:3306/myDb
INFO 23/07/15 13:09: liquibase: Successfully acquired change log lock
INFO 23/07/15 13:09: liquibase: Reading from DATABASECHANGELOG
SEVERE 23/07/15 13:09: liquibase: src/main/resources/config/database/db-changelog-master.xml: src/main/resources/config/database/changesets-001.xml::1000::gavin: Change S
et src/main/resources/config/database/changesets-001.xml::1000::gavin failed. Error: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'tc_configuration'
already exists
liquibase.exception.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'tc_configuration' already exists
It appears that Liquibase is trying to re-run changesets that have already been executed.
Is there a way to run only the new changesets?
logicalFilePath
. - Mykola Gurov