ad/prisma/schema.prisma

69 lines
1.8 KiB
Plaintext
Raw Normal View History

// 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"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Ad {
uuid String @id @default(uuid()) @db.Uuid
userUuid String @db.Uuid
2023-05-11 15:42:43 +00:00
driver Boolean
passenger Boolean
frequency Frequency
fromDate DateTime @db.Date
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
seatsProposed Int @db.SmallInt
seatsRequested Int @db.SmallInt
2023-05-11 15:42:43 +00:00
strict Boolean
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
waypoints Waypoint[]
@@map("ad")
}
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
lon Float
lat Float
2023-05-10 12:37:00 +00:00
name String?
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)
@@map("waypoint")
}
enum Frequency {
PUNCTUAL
RECURRENT
}