generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DATABASE_URL") } model User { id String @id @default(uuid()) email String @unique username String @unique passwordHash String @map("password_hash") steamId String? @unique @map("steam_id") steamPersonaname String? @map("steam_personaname") steamAvatar String? @map("steam_avatar") createdAt DateTime @default(now()) @map("created_at") reviews Review[] votes Vote[] @@map("users") } model Game { appId Int @id @map("app_id") name String description String? @db.Text headerImage String? @map("header_image") capsuleImage String? @map("capsule_image") backgroundImage String? @map("background_image") releaseDate String? @map("release_date") developers String[] @default([]) publishers String[] @default([]) genres String[] @default([]) updatedAt DateTime @updatedAt @map("updated_at") reviews Review[] @@map("games") } model Review { id String @id @default(uuid()) userId String @map("user_id") appId Int @map("app_id") content String @db.Text rating Int playtimeHours Decimal? @map("playtime_hours") @db.Decimal(6, 2) createdAt DateTime @default(now()) @map("created_at") user User @relation(fields: [userId], references: [id]) game Game @relation(fields: [appId], references: [appId]) votes Vote[] @@map("reviews") } model Vote { id String @id @default(uuid()) userId String @map("user_id") reviewId String @map("review_id") voteType Int @map("vote_type") createdAt DateTime @default(now()) @map("created_at") user User @relation(fields: [userId], references: [id]) review Review @relation(fields: [reviewId], references: [id]) @@unique([userId, reviewId]) @map("user_review_unique") @@map("votes") }