1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 20:20:49 +00:00

Modified bug of use -tables arguments.

This commit is contained in:
Liujian 2014-10-15 13:59:05 +08:00
parent 3dce57e793
commit eaae7694b8

View File

@ -145,8 +145,16 @@ func genHprose(dbms, connStr string, mode byte, selectedTableNames map[string]bo
ColorLog("[INFO] Analyzing database tables...\n")
tableNames := trans.GetTableNames(db)
// 添加 Hprose Function
for _, tb := range tableNames {
hproseAddFunctions = append(hproseAddFunctions, strings.Replace(HPROSE_ADDFUNCTION, "{{modelName}}", camelCase(tb), -1))
if selectedTableNames == nil {
for _, tb := range tableNames {
hproseAddFunctions = append(hproseAddFunctions, strings.Replace(HPROSE_ADDFUNCTION, "{{modelName}}", camelCase(tb), -1))
}
} else {
for tb, v := range selectedTableNames {
if v {
hproseAddFunctions = append(hproseAddFunctions, strings.Replace(HPROSE_ADDFUNCTION, "{{modelName}}", camelCase(tb), -1))
}
}
}
// 添加结束
tables := getTableObjects(tableNames, db, trans)