diff options
author | kolaente <k@knt.li> | 2020-05-15 16:05:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 15:05:18 +0100 |
commit | 57217cabe34e2a01fbb3cb93bd93fbefa38fee91 (patch) | |
tree | c01985da037b151380326694f0d4c1eef7f81970 /models | |
parent | 4a04740dafb1da047300dfbb9da596fee16af948 (diff) | |
download | gitea-57217cabe34e2a01fbb3cb93bd93fbefa38fee91.tar.gz gitea-57217cabe34e2a01fbb3cb93bd93fbefa38fee91.zip |
Fix issue ref migration (#11419)
The migration introduced in #8742 breaks mysql installations. This pr fixes that by correctly using CONCAT.
Signed-off-by: kolaente <k@knt.li>
Diffstat (limited to 'models')
-rw-r--r-- | models/migrations/v139.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/models/migrations/v139.go b/models/migrations/v139.go index ffacad0a09..46b14b9869 100644 --- a/models/migrations/v139.go +++ b/models/migrations/v139.go @@ -16,6 +16,8 @@ func prependRefsHeadsToIssueRefs(x *xorm.Engine) error { switch { case setting.Database.UseMSSQL: query = "UPDATE `issue` SET `ref` = 'refs/heads/' + `ref` WHERE `ref` IS NOT NULL AND `ref` <> '' AND `ref` NOT LIKE 'refs/%'" + case setting.Database.UseMySQL: + query = "UPDATE `issue` SET `ref` = CONCAT('refs/heads/', `ref`) WHERE `ref` IS NOT NULL AND `ref` <> '' AND `ref` NOT LIKE 'refs/%';" default: query = "UPDATE `issue` SET `ref` = 'refs/heads/' || `ref` WHERE `ref` IS NOT NULL AND `ref` <> '' AND `ref` NOT LIKE 'refs/%'" } |