summaryrefslogtreecommitdiffstats
path: root/modules/migrations/base/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/migrations/base/issue.go')
-rw-r--r--modules/migrations/base/issue.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/migrations/base/issue.go b/modules/migrations/base/issue.go
index 8b1b461244..7addd1336a 100644
--- a/modules/migrations/base/issue.go
+++ b/modules/migrations/base/issue.go
@@ -7,6 +7,25 @@ package base
import "time"
+// IssueContext is used to map between local and foreign issue/PR ids.
+type IssueContext interface {
+ LocalID() int64
+ ForeignID() int64
+}
+
+// BasicIssueContext is a 1:1 mapping between local and foreign ids.
+type BasicIssueContext int64
+
+// LocalID gets the local id.
+func (c BasicIssueContext) LocalID() int64 {
+ return int64(c)
+}
+
+// ForeignID gets the foreign id.
+func (c BasicIssueContext) ForeignID() int64 {
+ return int64(c)
+}
+
// Issue is a standard issue information
type Issue struct {
Number int64
@@ -25,4 +44,5 @@ type Issue struct {
Labels []*Label
Reactions []*Reaction
Assignees []string
+ Context IssueContext `yaml:"-"`
}