Hi everyone,
we have some “old” projects, where setup the liquibase configuration the wrong way. We started with C7.17 and the sql directory from the camunda-bpm-tomcat zip file.
Instead of using the sql files from the liquibase/baseline directory, we added the mysql_engine_7.17.0.sql and mysql_identity_7.17.0.sql from the “create” directory to one of our own xml files which were referenced in the db.changelog-master.xml.
<include file="db/changelog/our_camunda-service-initial.xml" />
Here the snippet from this xml file:
<property name="db.name" value="h2" dbms="h2"/>
<property name="db.name" value="mysql" dbms="mysql"/>
<changeSet author="Camunda" id="7.17.0-baseline">
<sqlFile path="../${db.name}_engine_7.17.0.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
<sqlFile path="../${db.name}_identity_7.17.0.sql"
encoding="UTF-8"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
</changeSet>
This works fine for the first startup and all tables were created.
Now we want to update to C7.19 using the “correct” liquibase files. So we copied the content of sql/liquibase from camunda-bpm-tomcat-7.19.0.zip to our db/changelog directory and added a reference to the camunda-changelog.xml to th db.changelog-master.xml:
<include file="db/changelog/our_camunda-service-initial.xml" />
<include file="db/changelog/camunda-changelog.xml" />
I downloaded the liquibase client and followed the steps from here: Install the Database Schema | docs.camunda.org
So I called
liquibase changelog-sync-to-tag --tag=7.17.0 --changelog-file=src\main\resources\db\changelog\camunda-changelog.xml
The command ended successfully
Liquibase Version: 4.21.1
Liquibase Open Source 4.21.1 by Liquibase
Liquibase command 'changelog-sync-to-tag' was executed successfully.
Now I started my spring application, but liquibase failed to update the database because it is trying to create tables that already exists:
Table "ACT_GE_PROPERTY" already exists; SQL statement:
create table ACT_GE_PROPERTY (
NAME_ varchar(64),
VALUE_ varchar(300),
REV_ integer,
primary key (NAME_)
) [42101-200] [Failed SQL: (42101) create table ACT_GE_PROPERTY (
NAME_ varchar(64),
VALUE_ varchar(300),
REV_ integer,
primary key (NAME_)
)]
I thougt running the liquibase command will set a marker so it will skip the databasechanges that already were done?
I am not so familiar with liquibase, so I hope someone can help me … please
Best regards,
Rainer