25 lines
936 B
Go
25 lines
936 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type PRStatus string
|
|
|
|
const (
|
|
PRStatusOpen PRStatus = "open"
|
|
PRStatusMerged PRStatus = "merged"
|
|
PRStatusClosed PRStatus = "closed"
|
|
)
|
|
|
|
type PullRequest struct {
|
|
ID int64 `xorm:"pk autoincr" json:"id"`
|
|
RepoID int64 `xorm:"notnull index" json:"repoId"`
|
|
AuthorID int64 `xorm:"notnull index" json:"authorId"`
|
|
Title string `xorm:"notnull varchar(255)" json:"title"`
|
|
Body string `xorm:"text" json:"body"`
|
|
SourceBranch string `xorm:"notnull varchar(255)" json:"sourceBranch"`
|
|
TargetBranch string `xorm:"default 'main' varchar(255)" json:"targetBranch"`
|
|
Status PRStatus `xorm:"default 'open' varchar(16)" json:"status"`
|
|
CreatedAt time.Time `xorm:"created" json:"createdAt"`
|
|
UpdatedAt time.Time `xorm:"updated" json:"updatedAt"`
|
|
}
|