Semantics of ignoreClasspathPrefix

Yes, it would be best to strip out the classpath: prefix before saving it. I created https://liquibase.jira.com/browse/CORE-2766 to track fixing that. 

For now, the easiest approach may be to add a with an tag that updates databasechangelog to strip off the “classpath:”.

Nathan

I am using Liquibase through the Spring integration to run any changesets on application start-up.  Since the changelog is part of a jar, I specify the location in one of my property files as:
liquibase.change-log = classpath:db/changelog/current.xml

Liquibase gets set up by Spring Boot’s auto-configuration mechanism.  When a changeset us run, the file name is recorded in DATABASECHANGELOG as classpath:db/changelog/current.xml.

I am also using the Gradle plugin to provide a way to update the database without running the application.  When I run with the same changelog file, the recorded file name doesn’t have the prefix (I am still loading it from the class path, by specifying it in the respective activity).

Liquibase provides the ignoreClasspathPrefix property (which is true by default) to deal with this discrepancy and it does work to some extent.  If I apply the changesets through Gradle first, the Spring app will recognize that they have been run and skips them.  However, if the changesets get executed by the Spring app first, gradle update will attempt to apply the changesets again and use the file name without the classpath: prefix.

It would seem that the ignoreClasspathPrefix property should remove the prefix from the file name before being recorded in DATABASECHANGELOG, to provide consistent behavior.  Or am I missing something in my setup?  Using Spring Boot 1.3.3.RELEASE and the Liquibase version it pulls by default (3.4.2).  Any insights would be appreciated.

Thanks,
Alex

Thanks Nathan.  That’s a creative workaround.

Alex