After finding out that the whole path of the changeset file is part of the key in the databasechangelog table I made an attempt to use the logicalFilePath to overcome this problem (for my project setup).
Unfortunately I am using formatted sql files and these do not support the logicaleFilePath yet (see: https://liquibase.jira.com/browse/CORE-915).
So I came up with the solution to only execute liquibase (on command-line) from the directory where the changeset files reside. Then the path of the changeset files is relative to this.
Now I wanted to include the generation of a new data base into our nightly build (Jenkins + Maven) using the maven plugin but this resulted into the same problem that I had before:
The path of the changeset files is different and liquibase tries to run already executed changesets again.
Searching these forums I found the option to specify the classpath with the --classpath switch (to make the file path relative again) but I can not find this option for the maven plugin.
Does anybody know how to specify the classpath for the maven plugin or maybe another workaround for this problem?
Thanks & regards,
(Reading a couple of forum entries I found the reason for the changeset file name being part of the key is the simple fact that some people are using multiple changeset files and do not want to bother about duplicating the changeset ids. I would definitively be on the list of people thinking that supporting this should not be the default way for liquibase. It’s good to have a switch somewhere to handle these cases but the default way (imho) should be to include only the author and the id in key of the databasechangelog table).