summaryrefslogtreecommitdiffstats
path: root/models/migrations/v158.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/migrations/v158.go')
-rw-r--r--models/migrations/v158.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/models/migrations/v158.go b/models/migrations/v158.go
index a6f2178f87..472516d70e 100644
--- a/models/migrations/v158.go
+++ b/models/migrations/v158.go
@@ -51,10 +51,12 @@ func updateCodeCommentReplies(x *xorm.Engine) error {
AND comment.id != first.id
AND comment.commit_sha != first.commit_sha`
- var sqlCmd string
- var start = 0
- var batchSize = 100
- sess := x.NewSession()
+ var (
+ sqlCmd string
+ start = 0
+ batchSize = 100
+ sess = x.NewSession()
+ )
defer sess.Close()
for {
if err := sess.Begin(); err != nil {
@@ -68,7 +70,7 @@ func updateCodeCommentReplies(x *xorm.Engine) error {
}
}
- var comments = make([]*Comment, 0, batchSize)
+ comments := make([]*Comment, 0, batchSize)
switch {
case setting.Database.UseMySQL: