- Fix network binding to allow external access (0.0.0.0) - Upgrade to Node.js 20.x for Next.js 16 compatibility - Fix next-auth v4 configuration and session handling - Add Steam client secret for Steam OAuth provider - Fix Prisma schema unique constraint syntax - Fix database creation script for automated deployment - Fix game search API to use new IStoreService endpoint - Fix session auth in API routes for Steam linking - Add TypeScript types for next-auth session
73 lines
2.0 KiB
Plaintext
73 lines
2.0 KiB
Plaintext
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], name: "user_review_unique")
|
|
@@map("votes")
|
|
}
|