开发者

In maven, how can I execute a SQL if I detect the table structure is missing?

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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜