开发者

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

开发者 https://www.devze.com 2023-01-10 17:09 出处:网络
I\'m modifying an existing maven2 project and I would like to create the database structure if I notice it 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

精彩评论

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