Liquibase tried to apply all changeset, even if database is present

The problem is often because part of the unique identifier for each changeSet is the path to the changelog file. It looks like it currently sees it as "liquibase/2014/1-1.xml".

If you run select * from databasechangelog where id='05192014.1525' what is the path already in the database?


Just adding new, more direct info on why the issue happens.

Liquibase DATABASECHANGELOG Documentation

Liquibase uses the DATABASECHANGELOG table to track which changeSets have been ran.

The table tracks each changeSet as a row, identified by a combination of the “id”, “author” and a “filename” column which stores the path to the changelog file.

Please note that the filename column stores the path to the changelog. This may be an absolute path or a relative path depending on how the changelog was passed to Liquibase. For best results, it should be a relative path.

If you move the database, as in the case of migrating, and the filename column contains full paths, Liquibase may not recognize the changeset from the DATABASECHANGELOG table.


Just to add info about what worked for me,

Liquibase was looking in the path relative to the JAR, 'BOOT-INF/classes/db/changelog/sql/' but the problem was that in the db databasechangelog, filename column had 'db/changelog/sql/' this path.

So I ran the following query on my database to resolve my issue.

update customer.databasechangelog set filename = replace(filename, 'db/changelog/sql/', 'BOOT-INF/classes/db/changelog/sql/');

As I'm new to the liquibase, I'm not sure if this approach is correct, but it did solve my problem.