2023-05-03 15:31:26 +00:00
|
|
|
// This is your Prisma schema file,
|
|
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
|
|
|
|
generator client {
|
2023-06-02 07:49:19 +00:00
|
|
|
provider = "prisma-client-js"
|
|
|
|
binaryTargets = ["linux-musl", "debian-openssl-3.0.x"]
|
2023-05-03 15:31:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
datasource db {
|
|
|
|
provider = "postgresql"
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
}
|
|
|
|
|
|
|
|
model Ad {
|
2023-07-25 14:52:41 +00:00
|
|
|
uuid String @id @default(uuid()) @db.Uuid
|
|
|
|
userUuid String @db.Uuid
|
2023-12-06 14:51:46 +00:00
|
|
|
status Status @default(PENDING)
|
2023-05-11 15:42:43 +00:00
|
|
|
driver Boolean
|
|
|
|
passenger Boolean
|
|
|
|
frequency Frequency
|
2023-07-25 14:52:41 +00:00
|
|
|
fromDate DateTime @db.Date
|
|
|
|
toDate DateTime @db.Date
|
|
|
|
schedule ScheduleItem[]
|
|
|
|
seatsProposed Int @db.SmallInt
|
|
|
|
seatsRequested Int @db.SmallInt
|
2023-05-11 15:42:43 +00:00
|
|
|
strict Boolean
|
2023-07-25 14:52:41 +00:00
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @default(now()) @updatedAt
|
2023-06-20 14:50:55 +00:00
|
|
|
waypoints Waypoint[]
|
2024-05-14 13:31:14 +00:00
|
|
|
pause Boolean @default(false)
|
2024-02-28 13:50:59 +00:00
|
|
|
comment String?
|
2023-05-03 15:31:26 +00:00
|
|
|
|
|
|
|
@@map("ad")
|
|
|
|
}
|
|
|
|
|
2023-07-25 14:52:41 +00:00
|
|
|
model ScheduleItem {
|
|
|
|
uuid String @id @default(uuid()) @db.Uuid
|
|
|
|
adUuid String @db.Uuid
|
|
|
|
day Int
|
|
|
|
time DateTime @db.Time(4)
|
|
|
|
margin Int
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
|
|
Ad Ad @relation(fields: [adUuid], references: [uuid], onDelete: Cascade)
|
|
|
|
|
|
|
|
@@map("schedule_item")
|
|
|
|
}
|
|
|
|
|
2023-06-20 14:50:55 +00:00
|
|
|
model Waypoint {
|
2023-05-11 15:42:43 +00:00
|
|
|
uuid String @id @default(uuid()) @db.Uuid
|
|
|
|
adUuid String @db.Uuid
|
|
|
|
position Int @db.SmallInt
|
2023-06-23 09:37:26 +00:00
|
|
|
lon Decimal @db.Decimal(9, 6)
|
|
|
|
lat Decimal @db.Decimal(8, 6)
|
2023-05-10 12:37:00 +00:00
|
|
|
name String?
|
2023-05-04 10:07:53 +00:00
|
|
|
houseNumber String?
|
|
|
|
street String?
|
|
|
|
locality String?
|
|
|
|
postalCode String?
|
2023-05-11 15:42:43 +00:00
|
|
|
country String
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
|
|
Ad Ad @relation(fields: [adUuid], references: [uuid], onDelete: Cascade)
|
2023-05-03 15:31:26 +00:00
|
|
|
|
2023-06-20 14:50:55 +00:00
|
|
|
@@map("waypoint")
|
2023-05-03 15:31:26 +00:00
|
|
|
}
|
2023-05-04 10:07:53 +00:00
|
|
|
|
|
|
|
enum Frequency {
|
|
|
|
PUNCTUAL
|
|
|
|
RECURRENT
|
|
|
|
}
|
2023-12-06 14:51:46 +00:00
|
|
|
|
|
|
|
enum Status {
|
|
|
|
PENDING
|
|
|
|
VALID
|
|
|
|
INVALID
|
|
|
|
SUSPENDED
|
|
|
|
}
|