Prisma 7's prisma.config.ts only configures the CLI, not the runtime PrismaClient. Without url in the datasource block, the generated client defaults to engineType "client" (WASM) which requires an adapter, causing next-auth adapter errors on OAuth callback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
106 lines
2.4 KiB
Plaintext
106 lines
2.4 KiB
Plaintext
// 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"
|
|
engineType = "library"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
type String
|
|
provider String
|
|
providerAccountId String
|
|
refresh_token String?
|
|
access_token String?
|
|
expires_at Int?
|
|
token_type String?
|
|
scope String?
|
|
id_token String?
|
|
session_state String?
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([provider, providerAccountId])
|
|
}
|
|
|
|
model Session {
|
|
id String @id @default(cuid())
|
|
sessionToken String @unique
|
|
userId String
|
|
expires DateTime
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
email String? @unique
|
|
emailVerified DateTime?
|
|
image String?
|
|
role Role @default(EMPLOYEE)
|
|
accounts Account[]
|
|
sessions Session[]
|
|
reports Report[]
|
|
}
|
|
|
|
model VerificationToken {
|
|
identifier String
|
|
token String @unique
|
|
expires DateTime
|
|
|
|
@@unique([identifier, token])
|
|
}
|
|
|
|
enum Role {
|
|
EMPLOYEE
|
|
ADMIN
|
|
}
|
|
|
|
model Report {
|
|
id String @id @default(cuid())
|
|
date DateTime @default(now())
|
|
managerName String
|
|
status ReportStatus @default(IN_PROGRESS)
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id])
|
|
tasks Task[]
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
enum ReportStatus {
|
|
IN_PROGRESS
|
|
COMPLETED
|
|
SUBMITTED
|
|
}
|
|
|
|
model Task {
|
|
id String @id @default(cuid())
|
|
type TaskType
|
|
description String
|
|
timeEstimate String?
|
|
notes String?
|
|
status String? @default("PENDING") // For completed tasks: DONE, IN_PROGRESS, etc.
|
|
link String? // Google Drive link
|
|
reportId String
|
|
report Report @relation(fields: [reportId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model Setting {
|
|
id String @id @default(cuid())
|
|
key String @unique
|
|
value String
|
|
}
|
|
|
|
enum TaskType {
|
|
PLANNED
|
|
COMPLETED
|
|
}
|