summaryrefslogtreecommitdiffstats
path: root/modules/migrations
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-27 01:23:57 +0000
committerGitHub <noreply@github.com>2020-12-27 09:23:57 +0800
commit212fa340cfb499297bf76cb9dd5751895700a2af (patch)
tree90e07cfdc01c88459ae331d0d9a503c419521189 /modules/migrations
parentcf9d4716310638ca047e93e476886b4e4ae0ce39 (diff)
downloadgitea-212fa340cfb499297bf76cb9dd5751895700a2af.tar.gz
gitea-212fa340cfb499297bf76cb9dd5751895700a2af.zip
Migration: drop to long repo topics (#14152)
Diffstat (limited to 'modules/migrations')
-rw-r--r--modules/migrations/gitea_uploader.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/migrations/gitea_uploader.go b/modules/migrations/gitea_uploader.go
index 20d7d81ae1..91ddda9c39 100644
--- a/modules/migrations/gitea_uploader.go
+++ b/modules/migrations/gitea_uploader.go
@@ -154,6 +154,15 @@ func (g *GiteaLocalUploader) Close() {
// CreateTopics creates topics
func (g *GiteaLocalUploader) CreateTopics(topics ...string) error {
+ // ignore topics to long for the db
+ c := 0
+ for i := range topics {
+ if len(topics[i]) <= 50 {
+ topics[c] = topics[i]
+ c++
+ }
+ }
+ topics = topics[:c]
return models.SaveTopics(g.repo.ID, topics...)
}