views:

48

answers:

1

Hi all,

This question is related to "Hibernate using JPA (annotated Entities) and liquibase".

I was actually wondering what to expect when doing a Liquibase diff against a Hibernate mapping definition.

What it seems to produce: A liquibase changelog that migrates the state of my hibernate mappings to the current image of the database.

What I was hoping for: A liquibase changelog that migrates the existing (old) database to reflect the changes in my (new) hibernate mappings.

Am I expecting the wrong thing? or am I doing something wrong?

Thank you for letting me know! J.

+1  A: 

The answer was too obvious...

It was just a matter of flipping the base- and target system :-)

 --username=un \
 --password=pw \
 --url=jdbc:mysql:///mydb \
 diffChangeLog \
 --baseUrl="hibernate:/hibernate.hbm.xml"

becomes:

 --url="hibernate:/hibernate.hbm.xml" \
 diffChangeLog \
 --baseUrl=jdbc:mysql:///mydb \
 --baseUsername=un \
 --basePassword=pw

Sorry! Time for sleep :-)

Jan
In the upcoming liquibase 2.0 version, we changed the naming to be hopefully more obvious than target and base.
Nathan Voxland