I'm trying to integrate liquibase with our application. I'm executing it using Maven integration approach.
When I execute, I see that creation script for databasechangelog invoked twice and get "Table already exist" error. Below are the statements from console. I'm using liquibase-core-3.1.1 jar.
INFO 2014-04-28 06:49:liquibase: Successfully acquired change log lock
INFO 2014-04-28 06:49:liquibase: Creating database history table with name: databasechangelog
INFO 2014-04-28 06:49:liquibase: ChangeSet src/main/resources/sql/postGre/db.changelog-2.0.xml::1::fms ran successfully in 555ms
INFO 2014-04-28 06:49:liquibase: Creating database history table with name: databasechangelog
SEVERE 2014-04-28 06:49:liquibase: Error executing SQL CREATE TABLE databasechangelog (ID VARCHAR(63) NOT NULL, AUTHOR VARCHAR(63) NOT NULL, FILENAME VARCHAR(200) NOT NULL, DATEEXECUTED TIMESTAMP WITH TIME ZONE NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONSTRAINT PK_DATABASECHANGELOG PRIMARY KEY (ID, AUTHOR, FILENAME))
org.postgresql.util.PSQLException: ERROR: relation "databasechangelog" already exists
POM file entry
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>2.0.1</version>
<configuration>
<changeLogFile>src/main/resources/sql/postGre/changelog-master.xml</changeLogFile>
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
<defaultschemaName><<my application schema>> </defaultschemaName>
<driver>org.postgresql.Driver</driver>
<url>jdbc:<<mydburl>> </url>
<username>user</username>
<password>pwd</password>
</configuration>
<executions>
<execution>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
</plugin>
please do let me where I'm going wrong..
for h2 database ı was have the same problem.
my connection string was
jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;
After I removed DATABASE_TO_UPPER=false from the end it starts working.
last connection string as follows:
jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;
Try to add CASE_INSENSITIVE_IDENTIFIERS=TRUE; param to your url connection. Example :
datasource:
url: jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With