1
0
mirror of https://github.com/beego/bee.git synced 2024-11-21 23:50:54 +00:00

fix #440 only get these tables information in custom the option ‘-tables’

This commit is contained in:
hudangwei 2017-05-20 13:06:25 +08:00
parent 0000e7d7c9
commit 8b01334faf

View File

@ -298,7 +298,14 @@ func gen(dbms, connStr string, mode byte, selectedTableNames map[string]bool, ap
defer db.Close() defer db.Close()
if trans, ok := dbDriver[dbms]; ok { if trans, ok := dbDriver[dbms]; ok {
beeLogger.Log.Info("Analyzing database tables...") beeLogger.Log.Info("Analyzing database tables...")
tableNames := trans.GetTableNames(db) var tableNames []string
if len(selectedTableNames) != 0 {
for tableName := range selectedTableNames {
tableNames = append(tableNames, tableName)
}
} else {
tableNames = trans.GetTableNames(db)
}
tables := getTableObjects(tableNames, db, trans) tables := getTableObjects(tableNames, db, trans)
mvcPath := new(MvcPath) mvcPath := new(MvcPath)
mvcPath.ModelPath = path.Join(apppath, "models") mvcPath.ModelPath = path.Join(apppath, "models")