43 lines
1.0 KiB
Plaintext
43 lines
1.0 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"
|
|
binaryTargets = ["native", "linux-arm64-openssl-3.0.x"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Calendar {
|
|
id String @id @default(uuid())
|
|
name String
|
|
color String @default("#0082c9")
|
|
description String?
|
|
userId String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
events Event[]
|
|
|
|
@@index([userId])
|
|
}
|
|
|
|
model Event {
|
|
id String @id @default(uuid())
|
|
title String
|
|
description String?
|
|
start DateTime
|
|
end DateTime
|
|
location String?
|
|
isAllDay Boolean @default(false)
|
|
calendar Calendar @relation(fields: [calendarId], references: [id], onDelete: Cascade)
|
|
calendarId String
|
|
userId String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@index([calendarId])
|
|
@@index([userId])
|
|
} |