aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations/v119.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-10 23:35:17 +0800
committerGitHub <noreply@github.com>2020-01-10 23:35:17 +0800
commit7a3a90aca3c4a8258805efa10022a81e4d1a4d73 (patch)
tree54d92bac08a2aa336825cd1545dcd19fba028c96 /models/migrations/v119.go
parent3143bb10da25cd66383c23aff7b31dbd7c3dd9d6 (diff)
downloadgitea-7a3a90aca3c4a8258805efa10022a81e4d1a4d73.tar.gz
gitea-7a3a90aca3c4a8258805efa10022a81e4d1a4d73.zip
Fix wrong original git service type on a migrated repository (#9693)
Diffstat (limited to 'models/migrations/v119.go')
-rw-r--r--models/migrations/v119.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/models/migrations/v119.go b/models/migrations/v119.go
new file mode 100644
index 0000000000..746a04ead4
--- /dev/null
+++ b/models/migrations/v119.go
@@ -0,0 +1,16 @@
+// Copyright 2020 The Gitea Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package migrations
+
+import (
+ "code.gitea.io/gitea/modules/structs"
+
+ "xorm.io/xorm"
+)
+
+func fixMigratedRepositoryServiceType(x *xorm.Engine) error {
+ _, err := x.Exec("UPDATE repository SET original_service_type = ? WHERE original_url LIKE 'https://github.com/%'", structs.GithubService)
+ return err
+}