mirror of
https://github.com/go-gitea/gitea
synced 2025-07-16 07:18:37 +00:00
Add migrate from OneDev (#16356)
* Use context to simplify logic. * Added migration from OneDev. This PR adds [OneDev](https://code.onedev.io/) as migration source. Supported: - [x] Milestones - [x] Issues - [x] Pull Requests - [x] Comments - [x] Reviews - [x] Labels
This commit is contained in:
@@ -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:"-"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user