-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathschema.prisma
More file actions
126 lines (109 loc) · 3.29 KB
/
schema.prisma
File metadata and controls
126 lines (109 loc) · 3.29 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
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
115
116
117
118
119
120
121
122
123
124
125
126
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model hospitals {
id Int @id @default(autoincrement())
name String
health_board_id Int
health_boards health_boards @relation(fields: [health_board_id], references: [id])
departments departments[]
}
model questions {
id Int @id @default(autoincrement())
default_url String
standard_id Int
body String
type question_type
archived Boolean? @default(false)
standards standards @relation(fields: [standard_id], references: [id])
question_urls question_urls[]
words words[]
}
model responses {
id Int @id @default(autoincrement())
user_id String
timestamp DateTime
department_id Int
is_mentoring_session Boolean
departments departments @relation(fields: [department_id], references: [id])
users users @relation(fields: [user_id], references: [id])
scores scores[]
words words[]
}
model scores {
response_id Int
standard_id Int
score Int
responses responses @relation(fields: [response_id], references: [id])
standards standards @relation(fields: [standard_id], references: [id])
@@id([response_id, standard_id])
}
model standards {
id Int @id @default(autoincrement())
name String
questions questions[]
scores scores[]
}
model users {
id String @id
user_type user_type? @default(unknown)
responses responses[]
}
model words {
id Int @id @default(autoincrement())
response_id Int
word String
question_id Int
questions questions @relation(fields: [question_id], references: [id])
responses responses @relation(fields: [response_id], references: [id])
}
model health_boards {
id Int @id @default(autoincrement())
name String
hospitals hospitals[]
}
model departments {
id Int @id @default(autoincrement())
name String
hospital_id Int
archived Boolean? @default(false)
hospitals hospitals @relation(fields: [hospital_id], references: [id])
clinician_join_codes clinician_join_codes?
department_join_codes department_join_codes?
question_urls question_urls[]
responses responses[]
}
model question_urls {
question_id Int
department_id Int
url String
departments departments @relation(fields: [department_id], references: [id])
questions questions @relation(fields: [question_id], references: [id])
@@id([question_id, department_id])
}
model clinician_join_codes {
department_id Int @id
code String
departments departments @relation(fields: [department_id], references: [id])
}
model department_join_codes {
department_id Int @id
code String
departments departments @relation(fields: [department_id], references: [id])
}
enum question_type {
likert_scale
words
}
enum user_type {
unknown
platform_administrator
health_board
hospital
department_manager
clinician
}