File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -9,3 +9,52 @@ datasource db {
9
9
provider = " postgresql "
10
10
url = env (" DATABASE_URL " )
11
11
}
12
+
13
+ model User {
14
+ id String @id @default (uuid () )
15
+ email String @unique
16
+ name String
17
+ created_at DateTime @default (now () )
18
+ updated_at DateTime @updatedAt
19
+
20
+ work_requests WorkRequest []
21
+ }
22
+
23
+ model Work {
24
+ id String @id @default (uuid () )
25
+ description String
26
+ start_date DateTime
27
+ approval_date DateTime
28
+ completion_date DateTime
29
+ work_type Int
30
+
31
+ work_request WorkRequest ?
32
+ //? If work should have more than one request, use:
33
+ // work_requests WorkRequest[]
34
+ }
35
+
36
+ model Authority {
37
+ id String @id @default (uuid () )
38
+ name String
39
+ email String @unique
40
+ work_type Int
41
+
42
+ work_requests WorkRequest []
43
+ }
44
+
45
+ model WorkRequest {
46
+ rating Float
47
+ created_at DateTime @default (now () )
48
+ updated_at DateTime @updatedAt
49
+
50
+ work_id String @unique //? remove @unique if work can have more than one request
51
+ work Work @relation (fields : [work_id ] , references : [id ] )
52
+
53
+ user_id String
54
+ user User @relation (fields : [user_id ] , references : [id ] )
55
+
56
+ approving_authority_id String
57
+ approving_authority Authority @relation (fields : [approving_authority_id ] , references : [id ] )
58
+
59
+ @@id ([work_id , user_id ] )
60
+ }
You can’t perform that action at this time.
0 commit comments