/
model_sql.go
89 lines (66 loc) · 1.83 KB
/
model_sql.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package extractor
import (
"github.com/jinzhu/gorm"
"time"
)
type PullRequestComment struct {
gorm.Model
EventDbId string `gorm:"unique_index"`
PullRequestId string `sql:"index"`
RepoName string `sql:"index"`
RepoUrl string
PRUrl string
PRNumber int `sql:"index"`
CommentCreatedAt time.Time
CommentUpdatedAt time.Time
CommentAuthorName string `sql:"index"`
CommentAuthorType string `sql:"index"`
Body string
EventTimestamp time.Time `sql:"index"`
EventAction string `sql:"index"`
RawPayload []byte
}
type PullRequestReviewComment struct {
gorm.Model
EventDbId string `gorm:"unique_index"`
PullRequestId string `sql:"index"`
RepoName string `sql:"index"`
RepoUrl string
PRUrl string
PRNumber int `sql:"index"`
ReviewId int `sql:"index"`
CommentCreatedAt time.Time
CommentUpdatedAt time.Time
CommentAuthorName string `sql:"index"`
CommentAuthorType string `sql:"index"`
Body string
EventTimestamp time.Time `sql:"index"`
EventAction string `sql:"index"`
RawPayload []byte
}
type PullRequest struct {
gorm.Model
EventDbId string `gorm:"unique_index"`
PullRequestId string `sql:"index"`
RepoName string `sql:"index"`
RepoUrl string
PRUrl string
PRNumber int `sql:"index"`
State string `sql:"index"`
PRAuthorLogin string `sql:"index"`
PRAuthorType string `sql:"index"`
PullRequestCreatedAt time.Time `sql:"index"`
PullRequestUpdatedAt *time.Time
PullRequestClosedAt *time.Time
PullRequestMergedAt *time.Time `sql:"index"`
EventInitiatorLogin string `sql:"index"`
EventInitiatorDisplayName string `sql:"index"`
Comments int
Commits int
Additions int
Deletions int
FilesChanged int
EventTimestamp time.Time `sql:"index"`
EventAction string `sql:"index"`
RawPayload []byte
}