Skip to content

Commit

Permalink
feat: prisma schema (#37)
Browse files Browse the repository at this point in the history
* feat: prisma schema

* udpate schema

* feat: add back config

* feat: add back key table

* feat: reorder tables

* feat: last missing params added
  • Loading branch information
HoussinSa authored Feb 11, 2024
1 parent 9cdb339 commit c5eddb2
Showing 1 changed file with 55 additions and 14 deletions.
69 changes: 55 additions & 14 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,17 @@ datasource db {
// Do not modify anything above this line unless you know what you are doing.

model User {
id String @id @unique @default(cuid())
email String @unique
firstName String
lastName String
verified Boolean @default(false)
receiveEmail Boolean @default(true)
token String? @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
auth_session Session[]
key Key[]
id String @id @unique @default(uuid())
username String @unique
email String @unique
created_at DateTime?
groups Group[]
meetings Meeting[]
generalAvailability Availability? @relation(fields: [availabilityId], references: [id])
availabilityId String?
MeetingUserAvailability MeetingUserAvailability[]
Key Key[]
Session Session[]
}

model Key {
Expand All @@ -50,3 +47,47 @@ model Session {
@@index([user_id])
}

model Meeting {
id String @id @unique @default(uuid())
title String
description String?
date DateTime
location String?
Invitees User[]
host_id String
group Group? @relation(fields: [groupId], references: [id])
from_time DateTime
to_time DateTime
groupId String?
MeetingUserAvailability MeetingUserAvailability[]
}

model Group {
id String @id @unique @default(uuid())
name String
description String?
created_at DateTime?
members User[]
Meeting Meeting[]
}

model MeetingUserAvailability {
id String @id @unique @default(uuid())
meeting Meeting @relation(fields: [meetingId], references: [id])
user User? @relation(fields: [userId], references: [id])
Availability Availability? @relation(fields: [availabilityId], references: [id])
meetingId String
userId String?
availabilityId String?
}

model Availability {
id String @id @unique @default(cuid())
from_time String
to_time String
from_date String
to_date String
User User[]
MeetingUserAvailability MeetingUserAvailability[]
}

0 comments on commit c5eddb2

Please sign in to comment.