mirror of
https://github.com/detleph/server.git
synced 2026-09-06 23:44:26 +02:00
HOTFIX: Name of uuid function
The prisma schema didn't compile with the previous schema
This commit is contained in:
+38
-26
@@ -19,6 +19,7 @@ model Event {
|
|||||||
disciplines Discipline[]
|
disciplines Discipline[]
|
||||||
organisations Organisation[]
|
organisations Organisation[]
|
||||||
campaign Campaign[]
|
campaign Campaign[]
|
||||||
|
visual Media[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model Campaign {
|
model Campaign {
|
||||||
@@ -28,7 +29,7 @@ model Campaign {
|
|||||||
expiresAt DateTime
|
expiresAt DateTime
|
||||||
|
|
||||||
links Link[]
|
links Link[]
|
||||||
event Event @relation(fields: [eventId], references: [id])
|
event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)
|
||||||
eventId Int @unique
|
eventId Int @unique
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,17 +38,17 @@ model Link {
|
|||||||
pid String @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
pid String @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||||
link String
|
link String
|
||||||
|
|
||||||
campaign Campaign @relation(fields: [campaignId], references: [id])
|
campaign Campaign @relation(fields: [campaignId], references: [id], onDelete: Cascade)
|
||||||
campaignId Int
|
campaignId Int
|
||||||
group Group? @relation(fields: [groupId], references: [id])
|
group Group @relation(fields: [groupId], references: [id], onDelete: Cascade)
|
||||||
groupId Int @unique
|
groupId Int @unique
|
||||||
}
|
}
|
||||||
|
|
||||||
model Admin {
|
model Admin {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
pid String @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
pid String @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||||
name String @unique
|
name String @unique
|
||||||
password String // TODO: Probably specify hash size (VarChar or some other type)
|
password String // TODO: Probably specify hash size (VarChar or some other type)
|
||||||
|
|
||||||
permission_level AdminLevel @default(STANDARD)
|
permission_level AdminLevel @default(STANDARD)
|
||||||
revision DateTime @default(now())
|
revision DateTime @default(now())
|
||||||
@@ -60,11 +61,12 @@ model Discipline {
|
|||||||
name String
|
name String
|
||||||
minTeamSize Int
|
minTeamSize Int
|
||||||
maxTeamSize Int
|
maxTeamSize Int
|
||||||
roles RoleSchema[]
|
|
||||||
|
|
||||||
|
roles RoleSchema[]
|
||||||
teams Team[]
|
teams Team[]
|
||||||
event Event @relation(fields: [eventId], references: [id])
|
event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)
|
||||||
eventId Int
|
eventId Int
|
||||||
|
visual Media[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model RoleSchema {
|
model RoleSchema {
|
||||||
@@ -74,8 +76,9 @@ model RoleSchema {
|
|||||||
schema Json
|
schema Json
|
||||||
|
|
||||||
roles Role[]
|
roles Role[]
|
||||||
discipline Discipline @relation(fields: [disciplineId], references: [id])
|
discipline Discipline @relation(fields: [disciplineId], references: [id], onDelete: Cascade)
|
||||||
disciplineId Int
|
disciplineId Int
|
||||||
|
visual Media[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model Team {
|
model Team {
|
||||||
@@ -85,7 +88,7 @@ model Team {
|
|||||||
leaderEmail String
|
leaderEmail String
|
||||||
|
|
||||||
roles Role[] @relation(name: "participants")
|
roles Role[] @relation(name: "participants")
|
||||||
discipline Discipline @relation(fields: [disciplineId], references: [id])
|
discipline Discipline @relation(fields: [disciplineId], references: [id], onDelete: Cascade)
|
||||||
disciplineId Int
|
disciplineId Int
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,26 +98,23 @@ model Participant {
|
|||||||
firstName String
|
firstName String
|
||||||
lastName String
|
lastName String
|
||||||
gender Gender
|
gender Gender
|
||||||
|
relevance Job
|
||||||
|
|
||||||
verified Boolean @default(false)
|
group Group @relation(fields: [groupId], references: [id], onDelete: Cascade)
|
||||||
|
groupId Int
|
||||||
group Group @relation(fields: [groupId], references: [id])
|
roles Role[]
|
||||||
groupId Int
|
|
||||||
roles Role[]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model Role {
|
model Role {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
pid String @unique @default(dbgenerated("gen_random"))
|
pid String @unique @default(dbgenerated("gen_random_uuid()"))
|
||||||
name String //e.g. runner, swimmer,...
|
score String
|
||||||
importance Job
|
|
||||||
score String
|
|
||||||
|
|
||||||
participant Participant? @relation(fields: [participantId], references: [id])
|
participant Participant? @relation(fields: [participantId], references: [id], onDelete: SetNull)
|
||||||
participantId Int?
|
participantId Int?
|
||||||
team Team @relation(name: "participants", fields: [teamId], references: [id])
|
team Team @relation(name: "participants", fields: [teamId], references: [id], onDelete: Cascade)
|
||||||
teamId Int
|
teamId Int
|
||||||
schema RoleSchema @relation(fields: [schemaId], references: [id])
|
schema RoleSchema @relation(fields: [schemaId], references: [id], onDelete: Cascade)
|
||||||
schemaId Int
|
schemaId Int
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ model Organisation {
|
|||||||
name String
|
name String
|
||||||
|
|
||||||
groups Group[]
|
groups Group[]
|
||||||
event Event @relation(fields: [eventId], references: [id])
|
event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)
|
||||||
eventId Int
|
eventId Int
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,13 +135,24 @@ model Group {
|
|||||||
user_limit Int @default(40)
|
user_limit Int @default(40)
|
||||||
level Int
|
level Int
|
||||||
|
|
||||||
oragnisation Organisation @relation(fields: [oragnisationId], references: [id])
|
oragnisation Organisation @relation(fields: [oragnisationId], references: [id], onDelete: Cascade)
|
||||||
oragnisationId Int
|
oragnisationId Int
|
||||||
participants Participant[]
|
participants Participant[]
|
||||||
link Link?
|
link Link?
|
||||||
admins Admin[]
|
admins Admin[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model Media {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
pid String @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||||
|
description String
|
||||||
|
location String @unique
|
||||||
|
|
||||||
|
event Event[]
|
||||||
|
discipline Discipline[]
|
||||||
|
role RoleSchema[]
|
||||||
|
}
|
||||||
|
|
||||||
enum AdminLevel {
|
enum AdminLevel {
|
||||||
STANDARD
|
STANDARD
|
||||||
ELEVATED
|
ELEVATED
|
||||||
@@ -156,3 +167,4 @@ enum Gender {
|
|||||||
enum Job {
|
enum Job {
|
||||||
TEAMLEADER
|
TEAMLEADER
|
||||||
MEMBER
|
MEMBER
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user