-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
91 lines (82 loc) · 1.63 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
datasource db {
url = env("DATABASE_URL")
provider = "postgresql"
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
companyId String @default("dummy")
firstName String
lastName String
email String @unique
password String
bio String?
sessionIds String[]
role UserRole
tickets Ticket[]
projects Project[]
comments Comment[]
company Company @relation(fields: [companyId], references: [id])
}
model Ticket {
id String @id @default(uuid())
projectId String
companyId String @default("dummy")
title String
priority Priority
createdDate DateTime
dueDate DateTime?
closedDate DateTime?
content String?
status TicketStatus @default(new)
history Json[]
isClosed Boolean @default(false)
project Project @relation(fields: [projectId], references: [id])
assignedUsers User[]
comments Comment[]
}
model Project {
id String @id @default(uuid())
companyId String @default("dummy")
title String
description String?
createdDate DateTime
dueDate DateTime?
isArchived Boolean @default(false)
priority Priority
tickets Ticket[]
assignedUsers User[]
}
model Comment {
id String @id @default(uuid())
userId Int
ticketId String
message String
dateSent DateTime
user User @relation(fields: [userId], references: [id])
ticket Ticket @relation(fields: [ticketId], references: [id])
}
model Company {
id String @id @default(uuid())
name String
users User[]
}
enum UserRole {
admin
projectManager
developer
submitter
}
enum Priority {
low
medium
high
}
enum TicketStatus {
new
testing
reviewed
development
}