71 lines
1.7 KiB
Plaintext
71 lines
1.7 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
output = "../generated/prisma"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
name String
|
|
email String @unique
|
|
pwdHash String?
|
|
role UserRole @default(Standard)
|
|
boards Board[]
|
|
}
|
|
|
|
model Board {
|
|
id Int @id @default(autoincrement())
|
|
userId Int
|
|
name String
|
|
description String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
user User @relation(fields: [userId], references: [id])
|
|
tasks Task[]
|
|
taskLists TaskList[]
|
|
}
|
|
|
|
model TaskList {
|
|
id Int @id @default(autoincrement())
|
|
boardId Int
|
|
name String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
board Board @relation(fields: [boardId], references: [id])
|
|
tasks Task[]
|
|
}
|
|
|
|
model Task {
|
|
id Int @id @default(autoincrement())
|
|
boardId Int
|
|
taskListId Int?
|
|
title String
|
|
description String?
|
|
status Status @default(todo)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
board Board @relation(fields: [boardId], references: [id])
|
|
taskList TaskList? @relation(fields: [taskListId], references: [id])
|
|
}
|
|
|
|
enum UserRole {
|
|
Standard
|
|
Admin
|
|
}
|
|
|
|
enum Status {
|
|
todo
|
|
in_progress
|
|
done
|
|
}
|