views:

22

answers:

1

I'm modifying an existing maven2 project and I would like to create the database structure if I notice it is missing.

I sort-of know how to do this in ant, I could query the database and if the table is missing I could execute the query.

But, maven is a different thing. I found a SQL plugin to run the script, but I don't know where or how to detect if the database structure is missing? Also where in the "goals" should I check for this?..

I would put this on the test.

Can someone point me in the right direction?

+1  A: 

I would use a database migration tool for this, something like the dbmaintain-maven-plugin or Carbon Five db-migration-maven-plugin.

Pascal Thivent
Looks nice, I'll take a look at it.
OscarRyz