-
Notifications
You must be signed in to change notification settings - Fork 61
/
schema.prisma
114 lines (80 loc) · 2.3 KB
/
schema.prisma
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
datasource db {
provider = "postgres"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl"]
}
model SyncedIssue {
id String @id @default(cuid())
githubIssueNumber BigInt
linearIssueNumber Int
githubIssueId BigInt
linearIssueId String
linearTeamId String
LinearTeam LinearTeam @relation(fields: [linearTeamId], references: [teamId])
githubRepoId BigInt
GitHubRepo GitHubRepo @relation(fields: [githubRepoId], references: [repoId])
@@map("synced_issues")
}
model LinearTeam {
id String @id @default(cuid())
teamId String @unique
teamName String
publicLabelId String
canceledStateId String
doneStateId String
toDoStateId String
Sync Sync[]
SyncedIssue SyncedIssue[]
Milestone Milestone[]
@@map("linear_teams")
}
model GitHubRepo {
id String @id @default(cuid())
repoId BigInt @unique
repoName String
webhookSecret String
Sync Sync[]
SyncedIssue SyncedIssue[]
Milestone Milestone[]
@@map("github_repos")
}
model Sync {
id String @id @default(cuid())
githubUserId BigInt
linearUserId String
GitHubRepo GitHubRepo @relation(fields: [githubRepoId], references: [repoId])
githubRepoId BigInt
githubApiKey String
githubApiKeyIV String
LinearTeam LinearTeam @relation(fields: [linearTeamId], references: [teamId])
linearTeamId String
linearApiKey String
linearApiKeyIV String
@@unique([githubUserId, linearUserId, githubRepoId, linearTeamId])
@@map("syncs")
}
model User {
id String @id @default(cuid())
githubUserId BigInt
githubUsername String
githubEmail String?
linearUserId String
linearUsername String
linearEmail String?
@@unique([githubUserId, linearUserId])
@@map("users")
}
model Milestone {
id String @id @default(cuid())
milestoneId Int
cycleId String
GitHubRepo GitHubRepo @relation(fields: [githubRepoId], references: [repoId])
githubRepoId BigInt
LinearTeam LinearTeam @relation(fields: [linearTeamId], references: [teamId])
linearTeamId String
@@unique([milestoneId, githubRepoId, cycleId, linearTeamId])
@@map("milestones")
}