Prisma 7 removed support for `url` in schema.prisma datasources and the `engineType = "library"` native binary engine. All connections now go through a driver adapter. - Remove engineType and url from schema.prisma (no longer supported) - Configure prisma.config.ts with migrate.adapter using @libsql/client - Instantiate PrismaClient with PrismaLibSQL adapter in src/lib/prisma.ts - Add @libsql/client and @prisma/adapter-libsql dependencies - Remove PRISMA_CLIENT_ENGINE_TYPE from Dockerfile (obsolete) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
104 lines
2.3 KiB
Plaintext
104 lines
2.3 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"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
}
|
|
|
|
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
|
|
}
|