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
1 changed files with 8 additions and 1 deletions

View File

@ -298,7 +298,14 @@ func gen(dbms, connStr string, mode byte, selectedTableNames map[string]bool, ap
defer db.Close()
if trans, ok := dbDriver[dbms]; ok {
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)
mvcPath := new(MvcPath)
mvcPath.ModelPath = path.Join(apppath, "models")