File tree 3 files changed +18
-1
lines changed
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"code.gitea.io/gitea/models/migrations/v1_20"
22
22
"code.gitea.io/gitea/models/migrations/v1_21"
23
23
"code.gitea.io/gitea/models/migrations/v1_22"
24
+ "code.gitea.io/gitea/models/migrations/v1_23"
24
25
"code.gitea.io/gitea/models/migrations/v1_6"
25
26
"code.gitea.io/gitea/models/migrations/v1_7"
26
27
"code.gitea.io/gitea/models/migrations/v1_8"
@@ -587,6 +588,9 @@ var migrations = []Migration{
587
588
NewMigration ("Drop wrongly created table o_auth2_application" , v1_22 .DropWronglyCreatedTable ),
588
589
589
590
// Gitea 1.22.0-rc1 ends at 299
591
+
592
+ // v298 -> v299
593
+ NewMigration ("Add index for release sha1" , v1_23 .AddIndexForReleaseSha1 ),
590
594
}
591
595
592
596
// 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 {
77
77
Target string
78
78
TargetBehind string `xorm:"-"` // to handle non-existing or empty target
79
79
Title string
80
- Sha1 string `xorm:"VARCHAR(64)"`
80
+ Sha1 string `xorm:"INDEX VARCHAR(64)"`
81
81
NumCommits int64
82
82
NumCommitsBehind int64 `xorm:"-"`
83
83
Note string `xorm:"TEXT"`
You can’t perform that action at this time.
0 commit comments