Add basic controllers and helper for roles

+ Directly link participants to teams for sake of query efficiency
This commit is contained in:
Stephan
2022-05-27 22:12:16 +02:00
parent c5e6568466
commit 197d1a52a3
2 changed files with 92 additions and 0 deletions
+3
View File
@@ -66,6 +66,7 @@ model Team {
leaderEmail String
roles Role[] @relation(name: "participants")
participants Participant[]
discipline Discipline @relation(fields: [disciplineId], references: [id], onDelete: Cascade)
disciplineId Int
}
@@ -79,6 +80,8 @@ model Participant {
group Group @relation(fields: [groupId], references: [id], onDelete: Cascade)
groupId Int
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
teamId Int
roles Role[]
}