Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion apps/backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")

}

model User {
Expand All @@ -29,6 +29,9 @@ model User {
ownedViews CardView[] @relation("cardOwner")
viewedCards CardView[] @relation("cardViewer")
followLogs FollowLog[]
organizer Event[]
attendedEvents EventAttendee[]


@@unique([provider, providerId])
@@map("users")
Expand Down Expand Up @@ -124,3 +127,31 @@ model FollowLog {

@@map("follow_logs")
}

model Event {
id String @id @default(uuid())
name String
slug String @unique
location String
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added location in the schema

description String?
organizerId String
startDate DateTime
endDate DateTime
isPublic Boolean @default(true)
createdAt DateTime @default(now()) @map("created_at")
attendees EventAttendee[]

organizer User @relation(fields: [organizerId], references: [id])
}

model EventAttendee {
id String @id @default(uuid())
userId String
eventId String
joinedAt DateTime

event Event @relation(fields: [eventId] , references: [id])
user User @relation(fields: [userId],references: [id])

@@unique([userId, eventId])
}
Loading