From 2792860e3eb8ac8f53573c6f8b8e74dbf71d8473 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 20 May 2022 20:17:25 +0200 Subject: [PATCH] Add ride sharing models --- prisma/schema.prisma | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index d03b0a0..268e8b6 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -82,21 +82,27 @@ model Item { /// A vehicle which is being used to transport people from and to the event. model Vehicle { - id Int @id @default(autoincrement()) - eventId Int - event Event @relation(fields: [eventId], references: [id]) + id Int @id @default(autoincrement()) + eventId Int + event Event @relation(fields: [eventId], references: [id]) // - driverId Int - driver Partecipant @relation("VehicleDrive", fields: [driverId], references: [id]) - riders Partecipant[] @relation("VehicleRide") + driverId Int + driver Partecipant @relation("VehicleDrive", fields: [driverId], references: [id]) + riders Partecipant[] @relation("VehicleRide") // - slots Int @default(4) - password String? + type VehicleType @default(CAR) + slots Int @default(4) + password String? // - voyage VoyageType - location String + voyage VoyageType + location String departureAt DateTime - arrivalAt DateTime + arrivalAt DateTime +} + +enum VehicleType { + CAR + OTHER } enum VoyageType {