Skip to content

Commit 00c2098

Browse files
Loïc Dacharyrealaravinth
Loïc Dachary
authored andcommitted
define all ForeignType and increase the size from 8 to 16
1 parent 7197bf2 commit 00c2098

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

models/foreignreference.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,23 @@ import (
88
"code.gitea.io/gitea/models/db"
99
)
1010

11-
// ForeignTypeIssue is to be used for the Type field in ForeignReference
12-
const ForeignTypeIssue = "issue"
11+
// ForeignType* are valid values for the Type field of ForeignReference
12+
const (
13+
ForeignTypeIssue = "issue"
14+
ForeignTypePullRequest = "pull_request"
15+
ForeignTypeComment = "comment"
16+
ForeignTypeReview = "review"
17+
ForeignTypeReviewComment = "review_comment"
18+
ForeignTypeRelease = "release"
19+
)
1320

1421
// ForeignReference represents external references
1522
type ForeignReference struct {
1623
// RepoID is the first column in all indices. now we only need 2 indices: (repo, local) and (repo, foreign, type)
1724
RepoID int64 `xorm:"UNIQUE(repo_foreign_type) INDEX(repo_local)" `
1825
LocalIndex int64 `xorm:"INDEX(repo_local)"` // the resource key inside Gitea, it can be IssueIndex, or some model ID.
1926
ForeignIndex string `xorm:"INDEX UNIQUE(repo_foreign_type)"`
20-
Type string `xorm:"VARCHAR(8) INDEX UNIQUE(repo_foreign_type)"`
27+
Type string `xorm:"VARCHAR(16) INDEX UNIQUE(repo_foreign_type)"`
2128
}
2229

2330
func init() {

0 commit comments

Comments
 (0)