enum BADGES { P1 P2 P3 D1 D2 D3 DAY1 } enum PERMISSION { ADMIN_EVENT ADMIN_USER SUSPENDED PILOT DISPO } model User { id String @id @default(uuid()) publicId String @unique firstname String lastname String email String @unique password String vatsimCid Int? @map(name: "vatsim_cid") moodleId Int? @map(name: "moodle_id") emailVerified DateTime? @map(name: "email_verified") image String? badges BADGES[] @default([]) permissions PERMISSION[] @default([]) createdAt DateTime @default(now()) @map(name: "created_at") updatedAt DateTime @default(now()) @map(name: "updated_at") isBanned Boolean @default(false) @map(name: "is_banned") // relations: oauthTokens OAuthToken[] discordAccounts DiscordAccount[] participants Participant[] EventAppointmentUser EventAppointment[] @relation("EventAppointmentUser") EventAppointment EventAppointment[] @@map(name: "users") } model DiscordAccount { id Int @id @default(autoincrement()) discordId String @unique @map(name: "discord_id") userId String @map(name: "user_id") email String @map(name: "email") username String @map(name: "username") avatar String? @map(name: "avatar") globalName String @map(name: "global_name") verified Boolean @default(false) accessToken String @map(name: "access_token") refreshToken String @map(name: "refresh_token") tokenType String @map(name: "token_type") createdAt DateTime @default(now()) @map(name: "created_at") updatedAt DateTime @default(now()) @map(name: "updated_at") // relations: user User @relation(fields: [userId], references: [id]) // Beziehung zu User @@map(name: "discord_accounts") }