2023-04-06 09:12:49 +00:00
|
|
|
// This is your Prisma schema file,
|
|
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
|
|
|
|
generator client {
|
|
|
|
provider = "prisma-client-js"
|
|
|
|
previewFeatures = ["postgresqlExtensions"]
|
|
|
|
}
|
|
|
|
|
|
|
|
datasource db {
|
|
|
|
provider = "postgresql"
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
extensions = [postgis]
|
|
|
|
}
|
|
|
|
|
|
|
|
model Ad {
|
2023-05-11 15:47:55 +00:00
|
|
|
uuid String @id @db.Uuid
|
|
|
|
userUuid String @db.Uuid
|
2023-04-25 15:49:47 +00:00
|
|
|
driver Boolean
|
|
|
|
passenger Boolean
|
2023-05-11 15:47:55 +00:00
|
|
|
frequency Frequency
|
2023-04-25 15:49:47 +00:00
|
|
|
fromDate DateTime @db.Date
|
|
|
|
toDate DateTime @db.Date
|
2023-05-11 15:47:55 +00:00
|
|
|
monTime DateTime? @db.Timestamptz()
|
|
|
|
tueTime DateTime? @db.Timestamptz()
|
|
|
|
wedTime DateTime? @db.Timestamptz()
|
|
|
|
thuTime DateTime? @db.Timestamptz()
|
|
|
|
friTime DateTime? @db.Timestamptz()
|
|
|
|
satTime DateTime? @db.Timestamptz()
|
|
|
|
sunTime DateTime? @db.Timestamptz()
|
2023-04-25 15:49:47 +00:00
|
|
|
monMargin Int
|
|
|
|
tueMargin Int
|
|
|
|
wedMargin Int
|
|
|
|
thuMargin Int
|
|
|
|
friMargin Int
|
|
|
|
satMargin Int
|
|
|
|
sunMargin Int
|
2023-05-11 15:47:55 +00:00
|
|
|
driverDuration Int?
|
|
|
|
driverDistance Int?
|
|
|
|
passengerDuration Int?
|
|
|
|
passengerDistance Int?
|
2023-04-25 15:49:47 +00:00
|
|
|
waypoints Unsupported("geography(LINESTRING)")?
|
|
|
|
direction Unsupported("geography(LINESTRING)")?
|
|
|
|
fwdAzimuth Int
|
|
|
|
backAzimuth Int
|
|
|
|
seatsDriver Int @db.SmallInt
|
|
|
|
seatsPassenger Int @db.SmallInt
|
|
|
|
seatsUsed Int @db.SmallInt
|
2023-05-11 15:47:55 +00:00
|
|
|
strict Boolean
|
2023-04-25 15:49:47 +00:00
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @default(now()) @updatedAt
|
2023-04-06 09:12:49 +00:00
|
|
|
|
|
|
|
@@index([driver])
|
|
|
|
@@index([passenger])
|
2023-04-25 15:49:47 +00:00
|
|
|
@@index([fromDate])
|
|
|
|
@@index([toDate])
|
|
|
|
@@index([fwdAzimuth])
|
2023-04-06 09:12:49 +00:00
|
|
|
@@index([direction], name: "direction_idx", type: Gist)
|
|
|
|
@@map("ad")
|
|
|
|
}
|
2023-05-11 15:47:55 +00:00
|
|
|
|
|
|
|
enum Frequency {
|
|
|
|
PUNCTUAL
|
|
|
|
RECURRENT
|
|
|
|
}
|