From c4aad6b8037864b24f2db9ab0d50f807b98d6b17 Mon Sep 17 00:00:00 2001 From: Alma Date: Sun, 13 Apr 2025 12:57:12 +0200 Subject: [PATCH] calendar 4 --- prisma/schema.prisma | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 3f40a7d5..e684c2db 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -2,7 +2,8 @@ // learn more about it in the docs: https://pris.ly/d/prisma-schema generator client { - provider = "prisma-client-js" + provider = "prisma-client-js" + binaryTargets = ["native", "linux-arm64-openssl-3.0.x"] } datasource db { @@ -12,26 +13,27 @@ datasource db { model Calendar { id String @id @default(uuid()) - userId String - title String + name String + color String @default("#0082c9") description String? + userId String createdAt DateTime @default(now()) updatedAt DateTime @updatedAt events Event[] } model Event { - id String @id @default(cuid()) + id String @id @default(uuid()) title String description String? start DateTime end DateTime - allDay Boolean @default(false) location String? - userId String + isAllDay Boolean @default(false) + calendar Calendar @relation(fields: [calendarId], references: [id], onDelete: Cascade) + calendarId String createdAt DateTime @default(now()) updatedAt DateTime @updatedAt - @@index([userId]) - @@index([start, end]) + @@index([calendarId]) } \ No newline at end of file