Skip to content

Commit 57217ca

Browse files
authored
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 <[email protected]>
1 parent 4a04740 commit 57217ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

models/migrations/v139.go

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ func prependRefsHeadsToIssueRefs(x *xorm.Engine) error {
1616
switch {
1717
case setting.Database.UseMSSQL:
1818
query = "UPDATE `issue` SET `ref` = 'refs/heads/' + `ref` WHERE `ref` IS NOT NULL AND `ref` <> '' AND `ref` NOT LIKE 'refs/%'"
19+
case setting.Database.UseMySQL:
20+
query = "UPDATE `issue` SET `ref` = CONCAT('refs/heads/', `ref`) WHERE `ref` IS NOT NULL AND `ref` <> '' AND `ref` NOT LIKE 'refs/%';"
1921
default:
2022
query = "UPDATE `issue` SET `ref` = 'refs/heads/' || `ref` WHERE `ref` IS NOT NULL AND `ref` <> '' AND `ref` NOT LIKE 'refs/%'"
2123
}

0 commit comments

Comments
 (0)