model User { id String @id @default(uuid()) username String @unique admin Boolean @default(false) enabled Boolean @default(true) email String displayName String profilePictureObjectId String // Object authMecs LinkedAuthMec[] mfas LinkedMFAMec[] clients Client[] notifications Notification[] collections Collection[] articles Article[] tokens APIToken[] sessions Session[] saves SaveSlot[] screenshots Screenshot[] playtime Playtime[] // See content.prisma's Game model for why M5 (and future milestones) do // NOT add a relation array here -- Mod/ModInstallation reference User.id // as a plain, unenforced-by-FK column, same pattern as devices.prisma. // --- M3: friends, presence, chat --- friendshipsSent Friendship[] @relation("FriendshipRequester") friendshipsReceived Friendship[] @relation("FriendshipAddressee") chatRoomsCreated ChatRoom[] @relation("ChatRoomCreatedBy") chatMessages ChatMessage[] @relation("ChatMessageSender") chatReadStates ChatReadState[] @relation("ChatReadState") } model Notification { id String @id @default(uuid()) nonce String? userId String user User @relation(fields: [userId], references: [id], onDelete: Cascade) acls String[] created DateTime @default(now()) title String description String actions String[] read Boolean @default(false) @@unique([userId, nonce]) }