|
@@ -68,6 +68,9 @@ func checkTable() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for tableName, createSQL := range config.Instance.Tables {
|
|
for tableName, createSQL := range config.Instance.Tables {
|
|
|
|
|
+ if createSQL == "" {
|
|
|
|
|
+ continue
|
|
|
|
|
+ }
|
|
|
if _, ok := existTable[tableName]; !ok {
|
|
if _, ok := existTable[tableName]; !ok {
|
|
|
_, err = Instance.Exec(createSQL)
|
|
_, err = Instance.Exec(createSQL)
|
|
|
log.Infof("Create Table: %s", createSQL)
|
|
log.Infof("Create Table: %s", createSQL)
|
|
@@ -76,6 +79,9 @@ func checkTable() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if initData, ok := config.Instance.TablesInitData[tableName]; ok {
|
|
if initData, ok := config.Instance.TablesInitData[tableName]; ok {
|
|
|
|
|
+ if initData == "" {
|
|
|
|
|
+ continue
|
|
|
|
|
+ }
|
|
|
_, err = Instance.Exec(initData)
|
|
_, err = Instance.Exec(initData)
|
|
|
log.Infof("Init Table: %s", initData)
|
|
log.Infof("Init Table: %s", initData)
|
|
|
if err != nil {
|
|
if err != nil {
|