Passionate Engineer
Passionate Engineer

Reputation: 10412

Dropwizard migrations Liquibase new changeset not migrating

I've added new changeset to migrations.xml but when I run db migration config-file it doesn't apply new changeset but just with below output:

INFO  [2015-02-10 12:59:34,193] liquibase: Successfully acquired change log lock
INFO  [2015-02-10 12:59:34,809] liquibase: Reading from public.databasechangelog
INFO  [2015-02-10 12:59:34,821] liquibase: Successfully released change log lock

I have two changesets and only the first one is applied. For example:

<changeSet id="1" author="me">

<changeSet id="2" author="me">

Also I only see first changeset entry under databasechangelog table which is strange.

How do I make it apply my new changeset?

Upvotes: 1

Views: 1418

Answers (2)

SztupY
SztupY

Reputation: 10536

We've run into a similar issue. Our problem was that we have only outputted stdout to the log files, but liquibase will put anything error related to the stderr, which was being dropped silently.

For the actual error: we actually had a hash mismatch in changeset 1 (compared to what's stored in the DB), and that's why changeset 2 didn't run.

Upvotes: 0

Nathan Douglas
Nathan Douglas

Reputation: 31

I ran into a similar issue and finally realized the migration.xml file is packaged in the generated jar file. You will need to recompile the jar every time you make a change to migrations.xml.

You can also use the --migrations flag to specify the migration file it is outside the jar.

Upvotes: 3

Related Questions