forked from google/sqlcommenter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.prisma
More file actions
82 lines (72 loc) · 1.87 KB
/
schema.prisma
File metadata and controls
82 lines (72 loc) · 1.87 KB
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
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
}
model User {
id String @id @default(uuid())
name String
email String @unique
avatarUrl String?
assignedIssues Issue[] @relation("assignee")
createdIssues Issue[] @relation("creator")
comments Comment[]
createdAt DateTime @default(now())
}
model Project {
id String @id @default(uuid())
name String
key String @unique
description String?
issues Issue[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Issue {
id String @id @default(uuid())
number Int
title String
description String?
status IssueStatus @default(OPEN)
priority Priority @default(MEDIUM)
projectId String
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
assigneeId String?
assignee User? @relation("assignee", fields: [assigneeId], references: [id])
creatorId String
creator User @relation("creator", fields: [creatorId], references: [id])
labels Label[]
comments Comment[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([projectId, number])
}
enum IssueStatus {
OPEN
IN_PROGRESS
IN_REVIEW
CLOSED
}
enum Priority {
LOW
MEDIUM
HIGH
CRITICAL
}
model Label {
id String @id @default(uuid())
name String @unique
color String
issues Issue[]
}
model Comment {
id String @id @default(uuid())
body String
issueId String
issue Issue @relation(fields: [issueId], references: [id], onDelete: Cascade)
authorId String
author User @relation(fields: [authorId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}