Maven Liquibase plugin executing previous changesets -
i able apply latest changes liquibase controlled database via maven. 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 run mvn liquibase:update
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 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 apply: 0 [info] drop first? false [info] ------------------------------------------------------------------------ [info] executing on database: jdbc:mysql://localhost:3306/mydb info 23/07/15 13:09: liquibase: acquired change log lock info 23/07/15 13:09: liquibase: reading 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' exists liquibase.exception.databaseexception: com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: table 'tc_configuration' exists
it appears liquibase trying re-run changesets have been executed.
is there way run new changesets?
liquibase keeps track of has been executed in own tables. not if table tc_configuration exists, before deciding whether run sql statement creates it. instead, check in own tables if changeset wit given id has been executed. in case, apparently, tc_configuration table has been created outside of liquibase, or liquibase tables have been manipulated.
if start empty database , update liquibase:update, liquibase run newest changes, once.
Comments
Post a Comment