Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create volunteer signup request model (Vaaranan/Yaser) #7

Merged
Merged
27 changes: 22 additions & 5 deletions backend/typescript/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ model test {
}

model user {
id String @id @default(auto()) @map("_id") @db.ObjectId
id String @id @default(auto()) @map("_id") @db.ObjectId
authId String
email String
firstName String
lastName String
role Role
serviceRequests serviceRequest[]
volunteerSignUp volunteerSignUp[]
}

model serviceRequest {
id String @id @default(auto()) @map("_id") @db.ObjectId
id String @id @default(auto()) @map("_id") @db.ObjectId
requestName String
requester user @relation(fields: [requesterId], references: [id])
requesterId String @db.ObjectId
requester user @relation(fields: [requesterId], references: [id])
requesterId String @db.ObjectId
location String
shiftTime DateTime?
description String?
Expand All @@ -35,6 +36,17 @@ model serviceRequest {
requestType ServiceRequestType
}

model volunteerSignUp {
id String @id @default(auto()) @map("_id") @db.ObjectId
v Int @map("__v")
Copy link
Member

Choose a reason for hiding this comment

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

Looks good to go, small thing - can you take out this v - we don't need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

email String
firstName String
lastName String
admin user @relation(fields: [admin_id], references: [id])
admin_id String @db.ObjectId
status Status
}

enum Role {
VOLUNTEER
ADMIN
Expand All @@ -43,4 +55,9 @@ enum Role {
enum ServiceRequestType {
SITE
KITCHEN
}
}

enum Status {
PENDING
ACCEPTED
}