Commit 393609f5 authored by 李德才's avatar 李德才

初始化Model 类之前创建表结构

parent aab61a9d
......@@ -50,6 +50,16 @@ public class MainConfig extends JFinalConfig {
*/
private static void beforeStart() {
loadConfig();
String dbType = p.get("dbType");
if (dbType == null || "".equals(dbType.trim())) {
System.out.println("数据库配置文件中dbType不能为空值");
return;
}
dbType = dbType.trim();
dbType = dbType.toUpperCase();
String configPath = PathKit.getRootClassPath() + "/DBUpdate/";
DBService dbService = new DBService();
dbService.upgrade(configPath, dbType);
}
......@@ -209,16 +219,7 @@ public class MainConfig extends JFinalConfig {
*/
@Override
public void onStart() {
String dbType = p.get("dbType");
if (dbType == null || "".equals(dbType.trim())) {
System.out.println("数据库配置文件中dbType不能为空值");
return;
}
dbType = dbType.trim();
dbType = dbType.toUpperCase();
String configPath = PathKit.getRootClassPath() + "/DBUpdate/";
DBService dbService = new DBService();
dbService.upgrade(configPath, dbType);
new GoodSync().run();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment