I’ve started to use LiquiBase in a project integrated with Maven. I’ve configured LiquiBase Maven plugin as explained in the website and it seems that it works.
However, I’m finding a problem. If someone adds a changeset and I’ve not created my database. When I do “mvn clean install” I get an error as tables related with changes don’t exist.
I guess that the problem is because I’m executing LiquiBase before the database is created, this is automatically done by hibernate, the specified phase is: process-resources
Anyway even if I move LiquiBase execution to a later phase, the database is going to be created properly but the changeset is not being able to be applied anyway. It should be somehow marked as already applied.
For example, you could think in a changeset that change a column name. If you execute this change:
- Before database creation is not going to work: Column doesn't exist.
- After database creation is not going to work either: Column is already with right name.
A possible solution would be to have a first changeset with all the tables and fields created by hibernate and then add the new changesets. This would mean that I couldn’t take advantage of some changes that are automatically done by Hibernate, like add a new column and things like that.
Did you find this problem before? Any other solution?
Thanks you very much,