Added settings for user data deletion
This commit is contained in:
parent
59e15cfde8
commit
f49490042a
35 changed files with 2758 additions and 499 deletions
|
|
@ -12,40 +12,58 @@ model User {
|
|||
email String @unique
|
||||
passwordHash String
|
||||
name String
|
||||
screenName String?
|
||||
avatarUrl String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
games Game[] @relation("GameMaster")
|
||||
teams TeamMember[]
|
||||
captainOf Team? @relation("TeamCaptain")
|
||||
chatMessages ChatMessage[]
|
||||
locationHistory LocationHistory[]
|
||||
}
|
||||
|
||||
model Game {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
description String?
|
||||
prizeDetails String?
|
||||
visibility Visibility @default(PUBLIC)
|
||||
startDate DateTime?
|
||||
locationLat Float?
|
||||
locationLng Float?
|
||||
searchRadius Float?
|
||||
rules String?
|
||||
status GameStatus @default(DRAFT)
|
||||
inviteCode String? @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
gameMasterId String
|
||||
gameMaster User @relation("GameMaster", fields: [gameMasterId], references: [id])
|
||||
legs Leg[]
|
||||
teams Team[]
|
||||
chatMessages ChatMessage[]
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
description String?
|
||||
prizeDetails String?
|
||||
visibility Visibility @default(PUBLIC)
|
||||
startDate DateTime?
|
||||
locationLat Float?
|
||||
locationLng Float?
|
||||
searchRadius Float?
|
||||
rules String?
|
||||
randomizeRoutes Boolean @default(false)
|
||||
status GameStatus @default(DRAFT)
|
||||
inviteCode String? @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
gameMasterId String
|
||||
gameMaster User @relation("GameMaster", fields: [gameMasterId], references: [id])
|
||||
routes Route[]
|
||||
teams Team[]
|
||||
chatMessages ChatMessage[]
|
||||
locationHistory LocationHistory[]
|
||||
}
|
||||
|
||||
model Leg {
|
||||
model Route {
|
||||
id String @id @default(uuid())
|
||||
gameId String
|
||||
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
|
||||
name String
|
||||
description String?
|
||||
color String @default("#3498db")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
routeLegs RouteLeg[]
|
||||
teamRoutes TeamRoute[]
|
||||
}
|
||||
|
||||
model RouteLeg {
|
||||
id String @id @default(uuid())
|
||||
gameId String
|
||||
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
|
||||
routeId String
|
||||
route Route @relation(fields: [routeId], references: [id], onDelete: Cascade)
|
||||
sequenceNumber Int
|
||||
description String
|
||||
conditionType String @default("photo")
|
||||
|
|
@ -53,7 +71,6 @@ model Leg {
|
|||
locationLat Float?
|
||||
locationLng Float?
|
||||
timeLimit Int?
|
||||
teams Team[]
|
||||
}
|
||||
|
||||
model Team {
|
||||
|
|
@ -61,19 +78,30 @@ model Team {
|
|||
gameId String
|
||||
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
|
||||
name String
|
||||
captainId String? @unique
|
||||
captain User? @relation("TeamCaptain", fields: [captainId], references: [id])
|
||||
currentLegId String?
|
||||
currentLeg Leg? @relation(fields: [currentLegId], references: [id])
|
||||
status TeamStatus @default(ACTIVE)
|
||||
totalTimeDeduction Int @default(0)
|
||||
captainId String? @unique
|
||||
captain User? @relation("TeamCaptain", fields: [captainId], references: [id])
|
||||
currentLegIndex Int @default(0)
|
||||
status TeamStatus @default(ACTIVE)
|
||||
totalTimeDeduction Int @default(0)
|
||||
lat Float?
|
||||
lng Float?
|
||||
rank Int?
|
||||
createdAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
members TeamMember[]
|
||||
photoSubmissions PhotoSubmission[]
|
||||
chatMessages ChatMessage[]
|
||||
teamRoutes TeamRoute[]
|
||||
}
|
||||
|
||||
model TeamRoute {
|
||||
id String @id @default(uuid())
|
||||
teamId String
|
||||
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||
routeId String
|
||||
route Route @relation(fields: [routeId], references: [id])
|
||||
assignedAt DateTime @default(now())
|
||||
|
||||
@@unique([teamId])
|
||||
}
|
||||
|
||||
model TeamMember {
|
||||
|
|
@ -91,7 +119,8 @@ model PhotoSubmission {
|
|||
id String @id @default(uuid())
|
||||
teamId String
|
||||
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||
legId String
|
||||
routeId String
|
||||
routeLegId String
|
||||
photoUrl String
|
||||
approved Boolean @default(false)
|
||||
submittedAt DateTime @default(now())
|
||||
|
|
@ -109,6 +138,19 @@ model ChatMessage {
|
|||
sentAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model LocationHistory {
|
||||
id String @id @default(uuid())
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
gameId String
|
||||
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
|
||||
teamId String
|
||||
lat Float
|
||||
lng Float
|
||||
accuracy Float?
|
||||
recordedAt DateTime @default(now())
|
||||
}
|
||||
|
||||
enum Visibility {
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue