Reputation: 2177
I am getting a "table already exists" error from Liquibase when I run my Jhipster project:
[ERROR] liquibase - classpath:config/liquibase/master.xml: classpath:config/liquibase/changelog/db-changelog-001.xml::1::jhipster: Change Set classpath:config/liquibase/changelog/db-changelog-001.xml::1::jhipster failed. Error: Error executing SQL CREATE TABLE fc.T_USER (login VARCHAR(50) NOT NULL, .....: Table 't_user' already exists
I have generated the Liquibase changelog file into config\liquibase\changelog directory using
liquibase --driver=com.mysql.jdbc.Driver ^
--classpath=C:\Users\Greg\.IntelliJIdea13\config\jdbc-drivers\mysql-connector-java-5.1.31-bin.jar ^
--changeLogFile=db-changelog-001.xml ^
--url="jdbc:mysql://localhost/fc" ^
--username=root ^
generateChangeLog
So something is tricking Liquibase into trying to re-create the database when the changelog, I thought, was setting a baseline of the existing database.
This process was working but not since move to new computer. When it was working I saw databasechangelog had a couple of records in it as well as 1 in databasechangeloglock
Tips on how to debug as welcome as an answer. Thanks.
Upvotes: 1
Views: 7324
Reputation: 2177
Running generateChangeLog
as described above, and then changeLogSync
in situ, results in the field [FILENAME]
in the databasechangelog table having the value db-changelog-001.xml
.
What it needs to be is the full address from where liquibase is run. When in a Jhipster app I am seeing classpath:config/liquibase/changelog/db-changelog-001.xml
. So it does not seem to be using only ID as the row identifier, as I was expecting.
Upvotes: 2