I have an issue when using liquibase:updateSQL goal in maven.
I have a fresh database and this is the first time liquibase accesses the database.
When using mvn install liquibase creates the two tables DATABASECHANGELOG and DATABASECHANGELOGLOCK into the database,
and it also adds the creation of these tables to the migration script that is generated alongwith other changes that need to be applied to the database.
– Create Database Lock Table
ID INT NOT NULL,
LOCKED TINYINT(1) NOT NULL,
LOCKEDBY VARCHAR(255), CONSTRAINT
PK_DATABASECHANGELOGLOCK PRIMARY KEY (
LOCKED) VALUES (1, 0);
SELECT LOCKED FROM
– Lock Database
LOCKEDBY = ‘192.168.1.110’,
LOCKGRANTED = ‘2010-10-01 11:50:14.140’,
LOCKED = 1 WHERE ID = 1;
– Create Database Change Log Table
ID VARCHAR(63) NOT NULL,
AUTHOR VARCHAR(63) NOT NULL,
FILENAME VARCHAR(200) NOT NULL,
DATEEXECUTED DATETIME NOT NULL,
LIQUIBASE VARCHAR(10), CONSTRAINT
PK_DATABASECHANGELOG PRIMARY KEY (
Obviously either 1 of the two should happen.
Thus when I use the migration script IT WILL throw an error as the two tables DATABASECHANGELOG and DATABASECHANGELOGLOCK already exist.
I know I can manually remove the above sql from the migration.sql file that has been generated. But I don’t want to do that inorder to keep the build automated.
Maybe I have missed something. Any help or solution would be greatly appreciated.