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 {
|
|
|
|
provider = "prisma-client-js"
|
|
|
|
}
|
|
|
|
|
|
|
|
datasource db {
|
|
|
|
provider = "postgresql"
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
}
|
|
|
|
|
|
|
|
model Ad {
|
2023-05-04 08:05:23 +00:00
|
|
|
uuid String @id @default(uuid()) @db.Uuid
|
|
|
|
userUuid String @db.Uuid
|
2023-05-04 10:07:53 +00:00
|
|
|
driver Boolean?
|
|
|
|
passenger Boolean?
|
|
|
|
frequency Frequency @default(RECURRENT)
|
2023-05-04 08:05:23 +00:00
|
|
|
fromDate DateTime @db.Date
|
2023-05-04 10:07:53 +00:00
|
|
|
toDate DateTime? @db.Date
|
|
|
|
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()
|
|
|
|
monMargin Int?
|
|
|
|
tueMargin Int?
|
|
|
|
wedMargin Int?
|
|
|
|
thuMargin Int?
|
|
|
|
friMargin Int?
|
|
|
|
satMargin Int?
|
|
|
|
sunMargin Int?
|
|
|
|
seatsDriver Int? @db.SmallInt
|
|
|
|
seatsPassenger Int? @db.SmallInt
|
2023-05-04 08:05:23 +00:00
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
|
|
addresses Address[]
|
2023-05-03 15:31:26 +00:00
|
|
|
|
|
|
|
@@index([driver])
|
|
|
|
@@index([passenger])
|
|
|
|
@@index([fromDate])
|
|
|
|
@@index([toDate])
|
|
|
|
@@map("ad")
|
|
|
|
}
|
|
|
|
|
|
|
|
model Address {
|
2023-05-04 10:07:53 +00:00
|
|
|
uuid String @id @default(uuid()) @db.Uuid
|
|
|
|
adUuid String @db.Uuid
|
|
|
|
position Int @db.SmallInt
|
2023-05-03 15:31:26 +00:00
|
|
|
lon Float
|
|
|
|
lat Float
|
2023-05-04 10:07:53 +00:00
|
|
|
houseNumber String?
|
|
|
|
street String?
|
|
|
|
locality String?
|
|
|
|
postalCode String?
|
|
|
|
country String?
|
|
|
|
type AddressType? @default(OTHER)
|
|
|
|
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
|
|
|
|
|
|
|
@@map("address")
|
|
|
|
}
|
2023-05-04 10:07:53 +00:00
|
|
|
|
|
|
|
enum Frequency {
|
|
|
|
PUNCTUAL
|
|
|
|
RECURRENT
|
|
|
|
}
|
|
|
|
|
|
|
|
enum AddressType {
|
|
|
|
HOUSE_NUMBER
|
|
|
|
STREET_ADDRESS
|
|
|
|
LOCALITY
|
|
|
|
VENUE
|
|
|
|
OTHER
|
|
|
|
}
|