remove unused codes

release/v1.15
Lunny Xiao 2014-03-19 15:46:16 +08:00
parent 9e8e910bd6
commit 01162bfc78
1 changed files with 1 additions and 4 deletions

View File

@ -145,10 +145,7 @@ func CreateRepository(user *User, repoName, desc, repoLang, license string, priv
return nil, err return nil, err
} }
rawSql := "UPDATE user SET num_repos = num_repos + 1 WHERE id = ?" rawSql := "UPDATE `user` SET num_repos = num_repos + 1 WHERE id = ?"
if base.Cfg.MustValue("database", "DB_TYPE") == "postgres" {
rawSql = "UPDATE \"user\" SET num_repos = num_repos + 1 WHERE id = ?"
}
if _, err = session.Exec(rawSql, user.Id); err != nil { if _, err = session.Exec(rawSql, user.Id); err != nil {
session.Rollback() session.Rollback()
if err2 := os.RemoveAll(repoPath); err2 != nil { if err2 := os.RemoveAll(repoPath); err2 != nil {