Fixed table sync error (#4303)

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
This commit is contained in:
Alexey Terentyev 2018-06-24 18:18:43 +03:00
parent d1f1b7a5c2
commit 8d0787c1a9
No known key found for this signature in database
GPG Key ID: 60D6C550AEEBB467

View File

@ -5,6 +5,7 @@
package migrations
import (
"fmt"
"strings"
"code.gitea.io/gitea/models"
@ -20,6 +21,13 @@ func reformatAndRemoveIncorrectTopics(x *xorm.Engine) (err error) {
Name string `xorm:"unique"`
}
if err := x.Sync2(new(models.Topic)); err != nil {
return fmt.Errorf("Sync2: %v", err)
}
if err := x.Sync2(new(models.RepoTopic)); err != nil {
return fmt.Errorf("Sync2: %v", err)
}
sess := x.NewSession()
defer sess.Close()