aboutsummaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-08-05 22:29:40 +0800
committerLauris BH <lauris@nix.lv>2019-08-05 17:29:40 +0300
commit7b009626da2a8a2a46e0e205a3a7ce46cdf7ced2 (patch)
tree3c81393f4592e1b3735740fd4453cf735da00dcd /models/models.go
parent52feff5a5c76421fe90c8e6a62ec86eaaa4634f2 (diff)
downloadgitea-7b009626da2a8a2a46e0e205a3a7ce46cdf7ced2.tar.gz
gitea-7b009626da2a8a2a46e0e205a3a7ce46cdf7ced2.zip
Add SQL execution on log and indexes on table repository and comment (#7740)
* add index on comment * add SQL execution time on log and index owner_id on repository * add migration
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/models/models.go b/models/models.go
index f746f680a5..4c925fa570 100644
--- a/models/models.go
+++ b/models/models.go
@@ -262,6 +262,7 @@ func NewTestEngine(x *xorm.Engine) (err error) {
return fmt.Errorf("Connect to database: %v", err)
}
+ x.ShowExecTime(true)
x.SetMapper(core.GonicMapper{})
x.SetLogger(NewXORMLogger(!setting.ProdMode))
x.ShowSQL(!setting.ProdMode)
@@ -275,6 +276,7 @@ func SetEngine() (err error) {
return fmt.Errorf("Failed to connect to database: %v", err)
}
+ x.ShowExecTime(true)
x.SetMapper(core.GonicMapper{})
// WARNING: for serv command, MUST remove the output to os.stdout,
// so use log file to instead print to stdout.