Browse Source

修复sqlite数据库位置

Minho 8 years ago
parent
commit
1d6f63972a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      commands/command.go

+ 3 - 0
commands/command.go

@@ -54,6 +54,9 @@ func RegisterDataBase() {
 		}
 	} else if adapter == "sqlite3" {
 		database := beego.AppConfig.String("db_database")
+		if strings.HasPrefix(database,"./") {
+			database = filepath.Join(WorkingDirectory,string(database[1:]))
+		}
 		dbPath := filepath.Dir(database)
 		os.MkdirAll(dbPath, 0777)