mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -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/%'"
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user