2012-07-31 46 views
0

我想要的代码,做这样的任务:用于创建数据库,表,列和填充表的“解决方案”?

check if a given database exists. 
1a-->if no, then create a DB, make some tables in it and some columns too. 

    1.1-->Check if certain columns in a "list" exist. 
     Create those columns which don't exist yet. 
    1.2--> once 1.1 is done, populate these tables with some test data. 

1b-->else check if certain tables exist and create them if they 
    don't exist. After that, do the stuff mentioned in 1.1 and 1.2 

让我的自己的代码还是有一个“解决方案”,它已经存在这样的任务?

回答

2

我可以推荐别的东西flyway,希望你会觉得很容易把握

+0

谢谢!我会仔细看看的。它看起来很轻。 – 2012-07-31 23:46:37

2

我不知道你在问什么,但我相信你可以通过LiquiBase实现你所需要的。

+0

谢谢!看起来像我需要的东西。但对我来说这将是一个巨大的学习曲线。是否有一些小型API或代码可以完成这项任务?我可以自己编写代码,但这会很痛苦。 – 2012-07-31 23:08:19