Files
var-monorepo/packages/database/prisma/schema/booking.prisma
2025-09-20 00:28:53 +02:00

27 lines
802 B
Plaintext

enum BOOKING_TYPE {
STATION
LST_01
LST_02
LST_03
LST_04
}
model Booking {
id String @id @default(uuid())
userId String @map(name: "user_id")
type BOOKING_TYPE
stationId Int? @map(name: "station_id")
startTime DateTime @map(name: "start_time")
endTime DateTime @map(name: "end_time")
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @updatedAt @map(name: "updated_at")
// Relations
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
Station Station? @relation(fields: [stationId], references: [id], onDelete: Cascade)
@@index([startTime, endTime])
@@index([type, startTime, endTime])
@@map(name: "bookings")
}