1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-22 22:54:22 +00:00

Add ride sharing models

This commit is contained in:
Steffo 2022-05-20 20:17:25 +02:00
parent 6145bc414c
commit 2792860e3e
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -82,21 +82,27 @@ model Item {
/// A vehicle which is being used to transport people from and to the event. /// A vehicle which is being used to transport people from and to the event.
model Vehicle { model Vehicle {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
eventId Int eventId Int
event Event @relation(fields: [eventId], references: [id]) event Event @relation(fields: [eventId], references: [id])
// //
driverId Int driverId Int
driver Partecipant @relation("VehicleDrive", fields: [driverId], references: [id]) driver Partecipant @relation("VehicleDrive", fields: [driverId], references: [id])
riders Partecipant[] @relation("VehicleRide") riders Partecipant[] @relation("VehicleRide")
// //
slots Int @default(4) type VehicleType @default(CAR)
password String? slots Int @default(4)
password String?
// //
voyage VoyageType voyage VoyageType
location String location String
departureAt DateTime departureAt DateTime
arrivalAt DateTime arrivalAt DateTime
}
enum VehicleType {
CAR
OTHER
} }
enum VoyageType { enum VoyageType {