File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
2121	"code.gitea.io/gitea/models/migrations/v1_20" 
2222	"code.gitea.io/gitea/models/migrations/v1_21" 
2323	"code.gitea.io/gitea/models/migrations/v1_22" 
24+ 	"code.gitea.io/gitea/models/migrations/v1_23" 
2425	"code.gitea.io/gitea/models/migrations/v1_6" 
2526	"code.gitea.io/gitea/models/migrations/v1_7" 
2627	"code.gitea.io/gitea/models/migrations/v1_8" 
@@ -587,6 +588,9 @@ var migrations = []Migration{
587588	NewMigration ("Drop wrongly created table o_auth2_application" , v1_22 .DropWronglyCreatedTable ),
588589
589590	// Gitea 1.22.0-rc1 ends at 299 
591+ 
592+ 	// v298 -> v299 
593+ 	NewMigration ("Add index for release sha1" , v1_23 .AddIndexForReleaseSha1 ),
590594}
591595
592596// GetCurrentDBVersion returns the current db version 
Original file line number Diff line number Diff line change 1+ // Copyright 2024 The Gitea Authors. All rights reserved. 
2+ // SPDX-License-Identifier: MIT 
3+ 
4+ package  v1_23 //nolint 
5+ 
6+ import  "xorm.io/xorm" 
7+ 
8+ func  AddIndexForReleaseSha1 (x  * xorm.Engine ) error  {
9+ 	type  Release  struct  {
10+ 		Sha1  string  `xorm:"INDEX VARCHAR(64)"` 
11+ 	}
12+ 	return  x .Sync (new (Release ))
13+ }
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ type Release struct {
7777	Target            string 
7878	TargetBehind      string  `xorm:"-"`  // to handle non-existing or empty target 
7979	Title             string 
80- 	Sha1              string  `xorm:"VARCHAR(64)"` 
80+ 	Sha1              string  `xorm:"INDEX  VARCHAR(64)"` 
8181	NumCommits        int64 
8282	NumCommitsBehind  int64               `xorm:"-"` 
8383	Note              string              `xorm:"TEXT"` 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments