// This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema generator client { provider = "prisma-client-js" binaryTargets = ["native", "rhel-openssl-3.0.x"] } datasource db { provider = "mysql" url = env("DATABASE_URL") } model Level { id String @id @default(uuid()) image1Url String @map("image1_url") @db.VarChar(500) image1Description String? @map("image1_description") @db.VarChar(500) image2Url String @map("image2_url") @db.VarChar(500) image2Description String? @map("image2_description") @db.VarChar(500) answer String punchline String? @db.VarChar(500) hint1 String? hint2 String? hint3 String? sortKey String @default("a0") @map("sort_key") @db.VarChar(64) sortOrder Int @default(0) @map("sort_order") createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") userProgress WxUserLevelProgress[] @@index([sortKey]) @@map("levels") } model User { id String @id @default(uuid()) email String @unique emailVerified Boolean @default(false) @map("email_verified") name String? image String? createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") sessions Session[] accounts Account[] @@map("users") } model Session { id String @id expiresAt DateTime @map("expires_at") token String @unique ipAddress String? @map("ip_address") userAgent String? @map("user_agent") userId String @map("user_id") createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@map("sessions") } model Account { id String @id @default(uuid()) accountId String @map("account_id") providerId String @map("provider_id") userId String @map("user_id") accessToken String? @map("access_token") refreshToken String? @map("refresh_token") idToken String? @map("id_token") accessTokenExpires DateTime? @map("access_token_expires") refreshTokenExpires DateTime? @map("refresh_token_expires") scope String? password String? createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@map("accounts") } model Verification { id String @id @default(uuid()) identifier String value String expiresAt DateTime @map("expires_at") createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") @@map("verifications") } model WxUser { id String @id @default(uuid()) openid String @unique sessionKey String? @map("session_key") nickname String? avatarUrl String? @map("avatar_url") stamina Int @default(50) staminaUpdatedAt DateTime? @map("stamina_updated_at") createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") levelProgress WxUserLevelProgress[] @@map("wx_users") } model WxUserLevelProgress { id String @id @default(uuid()) userId String @map("user_id") levelId String @map("level_id") completedAt DateTime @default(now()) @map("completed_at") timeSpent Int @default(0) @map("time_spent") user WxUser @relation(fields: [userId], references: [id], onDelete: Cascade) level Level @relation(fields: [levelId], references: [id]) @@map("wx_user_level_progress") }